:root {
    --ink: #f5f7fb;
    --muted: rgba(245, 247, 251, 0.72);
    --line: rgba(139, 174, 226, 0.46);
    --nav: #385685;
    --nav-dark: #2f4975;
    --panel: #3a5a8d;
    --panel-deep: #2f4b79;
    --field: #385789;
    --gold: #ffc318;
    --green: #24c31a;
    --red: #ff2c21;
    --sad: #7db1ff;
    --shadow: 0 14px 24px rgba(20, 32, 56, 0.28);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #42679f;
    font-family: "Aptos", "Segoe UI", sans-serif;
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

.app-shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 86px minmax(0, 1fr);
}

.side-nav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%),
        var(--nav);
    border-right: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset -1px 0 0 rgba(15, 28, 52, 0.22);
    min-width: 0;
}

.sidebar-head {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.brand-block {
    display: flex;
    align-items: center;
    min-height: 76px;
    margin-bottom: 0;
}

.brand-logo-img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.42));
}

.brand-registered {
    position: absolute;
    left: -6px;
    top: 2px;
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border: 1px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.brand-logo {
    display: block;
    color: #fff;
    font-size: clamp(42px, 4.9vw, 58px);
    line-height: 0.92;
    letter-spacing: -1px;
    text-shadow: 0 7px 8px rgba(0, 0, 0, 0.45);
}

.side-nav nav {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    min-width: 0;
    max-width: 100%;
}

.nav-link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font-size: 16px;
    text-align: left;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(255, 255, 255, 0.26);
    background: linear-gradient(90deg, rgba(255, 195, 24, 0.22), rgba(255, 255, 255, 0.15));
    transform: translateX(3px);
}

.nav-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: rgba(23, 38, 67, 0.64);
    font-size: 12px;
    font-weight: 900;
}

.nav-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.nav-copy small,
.nav-caption {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-caption {
    padding: 0 4px 2px;
}

.sidebar-toggle {
    display: inline-grid;
    grid-template-columns: 22px auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    gap: 4px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: #263e69;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.sidebar-toggle strong {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    font-size: 13px;
}

.sidebar-toggle span {
    display: block;
    grid-column: 1;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: #fff;
}

.sidebar-collapsed .side-nav {
    padding: 16px 10px;
}

.sidebar-collapsed .brand-block {
    min-height: 50px;
}

.sidebar-collapsed .brand-logo-img {
    width: 64px;
    max-width: none;
}

.sidebar-collapsed .nav-link {
    grid-template-columns: 1fr;
    padding: 9px 6px;
}

.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-copy small,
.sidebar-collapsed .nav-caption,
.sidebar-collapsed .sidebar-toggle strong,
.sidebar-collapsed .ai-pill {
    display: none;
}

.sidebar-collapsed .nav-icon {
    margin: 0 auto;
}

.ai-pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: 132px;
    min-height: 34px;
    place-items: center;
    margin: auto auto 20px;
    border-radius: 999px;
    background: #263e69;
    color: #fff;
    font-weight: 800;
}

.ai-pill span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(36, 195, 26, 0.9);
}

.workspace {
    width: min(1280px, 100%);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 22px 40px;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.workspace-header > div {
    min-width: 0;
    max-width: 100%;
}

.workspace-header h1 {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: clamp(42px, 4vw, 58px);
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

.kiosk-page .workspace-header h1 {
    color: #fff;
    font-size: 20px;
}

.kiosk-brand-header {
    position: relative;
    justify-content: center;
    min-height: 78px;
}

.kiosk-logo-lockup {
    display: flex;
    justify-content: center;
    width: min(320px, 60vw);
}

.kiosk-logo-lockup img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.36));
}

.kiosk-brand-header .status-pill {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.workspace-header p {
    margin: 8px 0 0;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.eyebrow {
    margin: 0 0 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    border: 2px solid rgba(126, 168, 229, 0.82);
    border-radius: var(--radius);
    padding: 5px 10px;
    background: var(--field);
    color: #fff;
    outline: none;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #a9c8ff;
    box-shadow: 0 0 0 3px rgba(169, 200, 255, 0.16);
}

.date-filter,
.button-row,
.enroll-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter input {
    width: 136px;
    min-height: 35px;
    text-align: center;
}

.mood-date-filter {
    justify-content: flex-end;
}

.mood-date-filter input {
    width: 142px;
}

.range-separator {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 900;
}

.primary-action,
.secondary-action,
.mood-choice {
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.primary-action {
    min-height: 36px;
    padding: 8px 16px;
    background: #263e69;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 8px 14px;
    background: #29456f;
}

.compact-action {
    min-height: 35px;
}

.primary-action:hover,
.secondary-action:hover,
.employee-actions button:hover,
.employee-actions a:hover,
.mini-actions a:hover {
    filter: brightness(1.12);
}

button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.status-pill {
    min-width: 150px;
    border-radius: 999px;
    padding: 8px 14px;
    background: #263e69;
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.status-pill[data-tone="success"] {
    background: #229a26;
}

.status-pill[data-tone="danger"] {
    background: #c92924;
}

.kiosk-workspace {
    max-width: none;
    padding: 18px;
}

.kiosk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: stretch;
}

.camera-stage {
    position: relative;
    min-height: calc(100vh - 118px);
    overflow: hidden;
    border-radius: 19px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 34px rgba(20, 32, 56, 0.32);
}

.camera-stage video,
.camera-stage canvas,
.enroll-camera video,
.enroll-camera canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-stage video,
.camera-stage canvas,
.enroll-camera video,
.enroll-camera canvas {
    transform: scaleX(-1);
}

.camera-stage::before {
    content: "";
    position: absolute;
    inset: 14px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    pointer-events: none;
}

.camera-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 28%, transparent 62%, rgba(0, 0, 0, 0.46)),
        radial-gradient(circle at 50% 42%, transparent 0 24%, rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.36) 100%);
}

.kiosk-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
}

.scan-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: min(430px, 62%);
    aspect-ratio: 4 / 5;
    transform: translate(-50%, -50%);
    border-radius: 28px;
    overflow: hidden;
    pointer-events: none;
    box-shadow: inset 0 0 42px rgba(47, 211, 125, 0.14);
}

.scan-frame::before,
.scan-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.scan-frame::before {
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.08);
}

.scan-frame::after {
    bottom: auto;
    background: linear-gradient(180deg, transparent, rgba(36, 195, 26, 0.82), transparent);
    height: 4px;
    top: 12%;
    box-shadow: 0 0 18px rgba(36, 195, 26, 0.85);
    animation: scanSweep 1.8s ease-in-out infinite;
}

.identity-panel,
.mini-feed {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: rgba(47, 75, 121, 0.78);
    box-shadow: 0 14px 24px rgba(20, 32, 56, 0.18);
}

.identity-panel {
    display: grid;
    align-content: center;
    padding: 22px;
}

.identity-panel h2 {
    margin: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1.05;
}

.identity-panel p:not(.eyebrow) {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
}

.confidence-meter {
    height: 10px;
    overflow: hidden;
    margin-top: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.confidence-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffc318, #2fd37d);
    transition: width 220ms ease;
}

.mini-feed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 96px;
    padding: 18px;
}

.mini-feed strong {
    display: block;
    color: #fff;
    font-size: 16px;
    line-height: 1.25;
}

#clock {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 22px;
    font-weight: 900;
}

@keyframes scanSweep {
    0% {
        top: 12%;
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 88%;
        opacity: 0.35;
    }
}

.recognition-toast {
    position: absolute;
    left: 24px;
    bottom: 16px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(38, 62, 105, 0.9);
    color: #fff;
    box-shadow: 0 14px 24px rgba(20, 32, 56, 0.24);
    animation: toastIn 220ms ease;
}

.recognition-toast span,
.modal-success-mark span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-weight: 900;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-tile,
.report-band,
.data-panel,
.control-panel,
.enroll-panel,
.mood-panel,
.quick-panel {
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: none;
    animation: panelIn 260ms ease both;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.registration-slide {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 220;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(82px, 11vw, 150px);
    align-items: center;
    gap: clamp(18px, 4vw, 58px);
    width: min(1540px, calc(100vw - 34px));
    min-height: clamp(122px, 13vw, 206px);
    padding: clamp(18px, 2.4vw, 36px) clamp(22px, 3vw, 48px) clamp(18px, 2.4vw, 36px) clamp(42px, 7vw, 118px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: linear-gradient(100deg, #94df3d 0%, #5cb84c 38%, #2b9458 100%);
    box-shadow: 0 18px 34px rgba(13, 68, 43, 0.36);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -145%);
    transition: opacity 220ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.registration-slide.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.registration-slide-copy {
    min-width: 0;
    color: #fff;
    text-align: center;
}

.registration-slide-copy strong,
.registration-slide-copy span {
    display: block;
}

.registration-slide-copy strong {
    font-size: clamp(38px, 5.2vw, 82px);
    font-weight: 900;
    line-height: 0.95;
    text-transform: uppercase;
}

.registration-slide-copy span {
    margin-top: clamp(15px, 2vw, 30px);
    font-size: clamp(21px, 2.8vw, 42px);
    font-weight: 400;
    line-height: 1.12;
}

.registration-slide-mark {
    position: relative;
    width: clamp(82px, 11vw, 150px);
    height: clamp(82px, 11vw, 150px);
    border-radius: 50%;
    background: #9bf226;
    box-shadow: 13px 0 28px rgba(10, 80, 50, 0.34);
}

.registration-slide-mark::before {
    content: "";
    position: absolute;
    top: 47%;
    left: 50%;
    width: 45%;
    height: 25%;
    border: solid #fff;
    border-width: 0 8px 8px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.metric-tile {
    min-height: 102px;
    padding: 14px 16px;
}

.metric-tile span {
    display: block;
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-tile strong {
    display: block;
    margin-top: 4px;
    color: var(--gold);
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1;
    font-weight: 500;
}

.metric-tile small,
.report-band small,
.quick-panel small,
.subtle-label,
.empty-state {
    color: var(--muted);
}

.report-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 12px 20px;
    margin-bottom: 16px;
}

.report-band strong,
.report-band small {
    display: block;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    margin-bottom: 16px;
}

.mood-panel,
.quick-panel,
.data-panel,
.control-panel,
.enroll-panel {
    padding: 16px;
}

.quick-panel {
    display: grid;
    align-content: start;
    gap: 11px;
}

.quick-panel h2,
.mood-panel h2,
.data-panel h2,
.enroll-panel h2,
.control-panel h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.mood-chart-row {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.pie-chart {
    display: grid;
    width: 148px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--panel) 0 44%, transparent 45%),
        conic-gradient(var(--green) 0 var(--happy), var(--sad) var(--happy) calc(var(--happy) + var(--sad)), var(--red) calc(var(--happy) + var(--sad)) 100%);
}

.pie-chart.empty {
    background:
        radial-gradient(circle at center, var(--panel) 0 44%, transparent 45%),
        conic-gradient(rgba(255, 255, 255, 0.18) 0 100%);
}

.pie-chart span {
    font-size: 28px;
    font-weight: 900;
}

.legend-stack {
    display: grid;
    gap: 10px;
    font-weight: 800;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 50%;
}

.legend-dot.happy,
.stacked-bar .happy {
    background: var(--green);
}

.legend-dot.sad,
.stacked-bar .sad {
    background: var(--sad);
}

.legend-dot.angry,
.stacked-bar .angry {
    background: var(--red);
}

.daily-mood-bars {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.day-mood {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
}

.stacked-bar {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
}

.stacked-bar i {
    display: block;
    height: 100%;
}

.split-layout {
    display: grid;
    grid-template-columns: 322px minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 38px;
}

.section-title {
    margin: -16px -16px 12px;
    padding: 9px 14px;
    border-radius: var(--radius);
    background: var(--panel-deep);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
}

.control-panel {
    display: grid;
    align-content: start;
    gap: 9px;
}

label {
    display: grid;
    gap: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.form-note {
    min-height: 22px;
    margin: 0;
    color: var(--muted);
}

.form-note[data-tone="success"] {
    color: #b8ffb3;
}

.form-note[data-tone="danger"] {
    color: #ffd0cf;
}

.enroll-camera {
    position: relative;
    min-height: 326px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    margin: 22px 2px 12px;
}

.search-input {
    max-width: 172px;
    min-height: 21px;
    font-size: 13px;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 12px;
    max-height: 330px;
    overflow: auto;
    padding-right: 4px;
}

.employee-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 86px;
    padding: 10px;
    border-radius: var(--radius);
    background: transparent;
}

.employee-card.is-disabled {
    opacity: 0.62;
    filter: grayscale(1);
}

.employee-card.is-disabled strong,
.employee-card.is-disabled small {
    color: #c3cbd7;
}

.employee-card.is-disabled .employee-avatar {
    background: #aeb7c4;
}

.employee-avatar {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    overflow: hidden;
    border-radius: 4px;
    background: #e8edf4;
    color: var(--panel);
    font-weight: 900;
}

.employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-card strong,
.employee-card small {
    display: block;
}

.employee-card strong {
    font-size: 13px;
    line-height: 1.1;
}

.employee-card small {
    margin: 2px 0 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.employee-actions,
.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.employee-actions button,
.employee-actions a,
.employee-actions .disabled-action,
.mini-actions a,
.permission-card button {
    display: inline-grid;
    min-height: 24px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    padding: 3px 8px;
    background: #29456f;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.employee-actions .disabled-action,
.employee-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    background: #5e6a7a;
    color: #d9dee7;
}

.employee-actions .danger-action {
    background: #7c2630;
}

.permission-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.permission-tab {
    min-height: 40px;
    border: 0;
    border-radius: var(--radius);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    white-space: nowrap;
}

.permission-tab.active {
    background: #263e69;
}

.time-permit-modes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.time-permit-mode {
    min-height: 36px;
    border: 1px solid rgba(38, 62, 105, 0.18);
    border-radius: 999px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.time-permit-mode.active {
    background: #263e69;
    border-color: #263e69;
    color: #fff;
}

.permission-layout {
    margin-bottom: 18px;
}

.permission-form {
    display: none;
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--panel);
}

.permission-form.active {
    display: grid;
    gap: 12px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
}

.permission-list {
    display: grid;
    gap: 10px;
    max-height: 430px;
    overflow: auto;
}

.permission-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(38, 62, 105, 0.42);
}

.permission-card strong,
.permission-card small,
.permission-card b {
    display: block;
}

.permission-card small {
    margin-top: 3px;
    color: var(--muted);
}

.mood-pro-panel {
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 38%),
        var(--panel);
}

.mood-dashboard {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.pro-pie {
    position: relative;
    width: min(280px, 100%);
    margin: 0 auto;
    border: 10px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 18px 34px rgba(15, 28, 52, 0.24);
}

.pro-pie::before {
    content: "";
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.pro-pie::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.18) 0 1deg, transparent 1deg 18deg);
    pointer-events: none;
    opacity: 0.56;
    -webkit-mask: radial-gradient(circle, transparent 0 61%, #000 62% 100%);
    mask: radial-gradient(circle, transparent 0 61%, #000 62% 100%);
}

.pro-pie div {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 52%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #2f4b79;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.pro-pie strong {
    color: var(--gold);
    font-size: 38px;
    line-height: 1;
}

.pro-pie span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mood-detail-stack {
    display: grid;
    gap: 14px;
}

.mood-summary-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(38, 62, 105, 0.48);
}

.mood-summary-card span,
.mood-summary-card small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mood-summary-card strong {
    color: #fff;
    font-size: 28px;
}

.pro-legend {
    gap: 8px;
}

.pro-legend span {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.pro-legend em {
    color: rgba(255, 255, 255, 0.74);
    font-style: normal;
}

.pro-daily-mood {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.permission-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.permission-overview article {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    padding: 16px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 44%),
        #334f80;
}

.permission-overview article::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -36px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 18px solid rgba(255, 255, 255, 0.06);
}

.permission-overview span {
    display: inline-grid;
    min-width: 34px;
    height: 26px;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 999px;
    background: var(--gold);
    color: #263e69;
    font-weight: 900;
}

.permission-overview strong,
.permission-overview small {
    display: block;
}

.permission-overview strong {
    font-size: 18px;
}

.permission-overview small {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.35;
}

.permission-tabs {
    padding: 6px;
    border-radius: 14px;
    background: rgba(38, 62, 105, 0.48);
}

.permission-tab {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
}

.permission-tab.active {
    border-color: rgba(255, 255, 255, 0.20);
    background: linear-gradient(90deg, #263e69, #315386);
    box-shadow: 0 10px 22px rgba(20, 32, 56, 0.20);
}

.permission-form {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(58, 90, 141, 0.94);
    box-shadow: 0 16px 34px rgba(20, 32, 56, 0.18);
}

.permission-form.active {
    gap: 0;
}

.permission-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background:
        linear-gradient(90deg, rgba(255, 195, 24, 0.18), transparent),
        #263e69;
}

.permission-form-header h2 {
    margin: 0;
    font-size: 24px;
    text-transform: uppercase;
}

.permission-form-header > span {
    display: inline-grid;
    min-height: 32px;
    place-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-weight: 900;
}

.permission-form .form-grid,
.permission-form > label,
.permission-form .form-actions {
    padding-left: 20px;
    padding-right: 20px;
}

.permission-form .form-grid {
    padding-top: 18px;
}

.permission-form > label {
    padding-top: 12px;
}

.permission-form .form-actions {
    padding-top: 16px;
    padding-bottom: 18px;
}

.permission-form input,
.permission-form select,
.permission-form textarea {
    min-height: 42px;
    border-color: rgba(169, 200, 255, 0.72);
    background: #315386;
}

.permission-list {
    max-height: 520px;
}

.permission-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent),
        rgba(38, 62, 105, 0.48);
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.tag.success {
    background: rgba(36, 195, 26, 0.18);
    color: #caffc6;
}

.tag.warning {
    background: rgba(255, 195, 24, 0.20);
    color: #ffe38a;
}

.tag.danger {
    background: rgba(255, 44, 33, 0.20);
    color: #ffd0cf;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 2px solid rgba(126, 168, 229, 0.54);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 3px;
    color: var(--muted);
}

.mood-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 6, 12, 0.62);
    backdrop-filter: blur(8px);
}

.mood-card {
    width: min(460px, 100%);
    border-radius: var(--radius);
    padding: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.modal-success-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #fff;
    font-weight: 900;
}

.mood-card h2 {
    margin: 0;
    font-size: 31px;
}

.mood-card #employee-name {
    margin: 10px 0 4px;
    font-size: 18px;
    font-weight: 900;
}

.mood-card #employee-meta {
    margin: 0;
    color: var(--muted);
}

.mood-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.mood-choice {
    display: grid;
    min-height: 98px;
    place-items: center;
    padding: 12px;
}

.mood-choice span {
    font-size: 48px;
    line-height: 1;
}

.mood-choice.positive {
    background: var(--green);
}

.mood-choice.calm {
    background: #447fd4;
}

.mood-choice.alert {
    background: var(--red);
}

.mood-choice:disabled {
    cursor: wait;
    opacity: 0.65;
}

.modal-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .app-shell,
    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .side-nav {
        display: none;
    }

    .workspace {
        width: 100%;
    }

    .kiosk-page {
        min-height: 100svh;
    }

    .kiosk-workspace {
        min-height: 100svh;
        padding: 14px;
    }

    .kiosk-page .workspace-header {
        margin-bottom: 12px;
    }

    .kiosk-brand-header {
        min-height: 66px;
    }

    .kiosk-logo-lockup {
        width: min(260px, 58vw);
    }

    .kiosk-logo-lockup img {
        max-height: 60px;
    }

    .kiosk-layout {
        grid-template-columns: 1fr;
    }

    .kiosk-panel {
        display: none;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-layout,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .mood-dashboard {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }

    .permission-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .camera-stage {
        min-height: calc(100svh - 108px);
    }
}

@media (max-width: 760px) {
    .workspace {
        padding: 18px 12px 28px;
    }

    .workspace-header,
    .report-band,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-header h1 {
        font-size: 38px;
    }

    .workspace-header p {
        font-size: 18px;
        line-height: 1.35;
    }

    .brand-logo {
        font-size: 46px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .button-row,
    .enroll-actions,
    .date-filter,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-action,
    .secondary-action {
        width: 100%;
    }

    .date-filter input,
    .search-input {
        width: 100%;
        max-width: none;
    }

    .mood-chart-row {
        grid-template-columns: 1fr;
    }

    .pie-chart {
        margin: 0 auto;
    }

    .mood-dashboard {
        grid-template-columns: 1fr;
    }

    .pro-pie {
        max-width: 230px;
    }

    .permission-overview {
        grid-template-columns: 1fr;
    }

    .registration-slide {
        top: 12px;
        grid-template-columns: minmax(0, 1fr) 66px;
        gap: 12px;
        width: calc(100vw - 20px);
        min-height: 94px;
        padding: 15px 18px 15px 28px;
    }

    .registration-slide-copy {
        text-align: left;
    }

    .registration-slide-copy strong {
        font-size: 30px;
    }

    .registration-slide-copy span {
        margin-top: 8px;
        font-size: 17px;
    }

    .registration-slide-mark {
        width: 66px;
        height: 66px;
    }

    .registration-slide-mark::before {
        border-width: 0 5px 5px 0;
    }

    .permission-form-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .camera-stage {
        min-height: calc(100svh - 128px);
        aspect-ratio: auto;
        border-radius: 14px;
    }

    .scan-frame {
        width: min(290px, 70%);
        border-radius: 22px;
    }

    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .permission-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .permission-card button {
        width: 100%;
    }

    .sidebar-collapsed .side-nav {
        padding-bottom: 10px;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 12px;
        border: 2px solid rgba(126, 168, 229, 0.54);
        border-radius: var(--radius);
    }

    td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 44px;
        border-bottom: 1px solid rgba(126, 168, 229, 0.44);
        text-align: right;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        color: #fff;
        font-size: 12px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    td[data-label="Empleado"] {
        align-items: flex-start;
        flex-direction: column;
        text-align: left;
    }

    td[data-label="Empleado"]::before {
        display: none;
    }
}

@media (max-width: 520px) {
    .workspace-header h1 {
        font-size: 34px;
    }

    .kiosk-workspace {
        padding: 10px;
    }

    .kiosk-page .workspace-header {
        margin-bottom: 10px;
    }

    .kiosk-brand-header {
        min-height: 58px;
        justify-content: center;
    }

    .kiosk-logo-lockup {
        width: min(210px, 62vw);
    }

    .kiosk-logo-lockup img {
        max-height: 52px;
    }

    .kiosk-brand-header .status-pill {
        right: 0;
        min-width: 96px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .kiosk-page .camera-stage {
        min-height: calc(100svh - 116px);
    }

    .permission-tabs {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .permission-overview article {
        min-height: 0;
    }

    .permission-form-header h2 {
        font-size: 22px;
    }
}
