/* Shared emerald and champagne theme. Load after the base component styles. */
:root {
    --emerald: #122b24;
    --hover: #1a3b32;
    --gold: #c49a4b;
    --gold-text: #806023;
    --soft: #f5efe2;
    --alabaster: #f6f5f0;
    --canvas: #edebe4;
    --hairline: #e5e2d9;
    --ink: #18201d;
    --muted: #5b6661;
    --radius: 16px;
    --button: 12px;
    --shadow: 0 1px 2px #122b240a,0 4px 12px #122b2408;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --text-sm: .875rem;
    --text-base: 1rem;
    --text-title: 1.625rem;
    --sans: "Kantumruy Pro",system-ui,sans-serif;
    --serif: "Playfair Display",Georgia,serif;
    --blue: var(--emerald);
    --border: var(--hairline);
    --text: var(--ink);
}

body, html[lang=km] body, button, input, summary {
    font-family: var(--sans);
}

body {
    font-size: var(--text-sm);
    line-height: 1.54;
}

html[lang=km] body {
    line-height: 1.73;
}

h1, h2, h3, html[lang=km] h1 {
    font-family: var(--sans);
    color: var(--ink);
    margin: 0;
}

p {
    margin: 0;
}

button, .button, .action {
    min-height: 44px;
    border-radius: var(--button);
    background: var(--emerald);
    color: #fff;
    border: 1px solid var(--emerald);
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 650;
    text-decoration: none;
}

button:hover, .action:hover {
    background: var(--hover);
}

button:active, .action:active {
    transform: translateY(1px);
}

.secondary {
    background: white;
    color: var(--emerald);
    border-color: #d5d1c7;
}

.secondary:hover {
    background: var(--alabaster);
}

a {
    color: var(--emerald);
}

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
    outline: 3px solid var(--gold-text);
    outline-offset: 3px;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
}

.action:not(.secondary) .icon, .scan-action .icon {
    color: var(--gold);
}

.digits {
    font-family: var(--serif);
    font-variant-numeric: lining-nums tabular-nums;
}

.application {
    display: block;
    min-height: 100vh;
}

.rail {
    display: none;
}

.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    min-height: 64px;
    background: var(--emerald);
    color: #fff;
    border-bottom: 1px solid var(--gold);
}

.classic-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.monogram {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 41px;
    height: 38px;
    border: 1px solid var(--gold);
    border-radius: 9px;
    background: #faf8f1;
    color: var(--emerald);
    font: bold 13px Georgia,serif;
    letter-spacing: .07em;
}

.tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.page-top .languages button, .mobile-menu summary {
    min-width: 44px;
    min-height: 44px;
    padding: 5px 7px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 9px;
    color: #fff;
    background: var(--emerald);
    cursor: pointer;
}

.mobile-menu {
    position: relative;
}

.mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-menu .menu-sheet {
    position: absolute;
    z-index: 5;
    top: 50px;
    right: 0;
    width: 264px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 12px;
}

.mobile-menu .menu-sheet nav, .rail nav {
    display: grid;
    gap: 3px;
    margin: 0;
}

.classic-nav a, .mobile-menu .menu-sheet>a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    color: inherit;
    padding: 8px 9px;
    text-decoration: none;
    border-radius: 9px;
}

.classic-nav a[aria-current] {
    background: #eaf2ee;
    color: var(--emerald);
    box-shadow: inset 3px 0 var(--gold);
}

.identity {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.desktop-title, .desktop-account {
    display: none;
}

.content {
    max-width: 1200px;
    padding: 18px 14px 24px;
}

.student .content {
    padding-bottom: 92px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 13px;
}

.page-heading::before {
    content: "";
    width: 4px;
    height: 23px;
    margin-top: 4px;
    background: var(--gold);
    border-radius: 4px;
    flex: none;
}

.page-heading h1 {
    font-size: var(--text-title);
    line-height: 1.29;
    font-weight: 760;
    letter-spacing: -.025em;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-4);
    min-width: 0;
}

.card h2 {
    font-size: 17px;
    font-weight: 720;
    margin: 0 0 9px;
}

.stack {
    display: grid;
    gap: var(--space-3);
}

.student-actions {
    display: grid;
    gap: 8px;
}

.student-actions .action:first-child {
    width: 100%;
    min-height: 55px;
}

.student-actions .action.secondary {
    justify-self: start;
}

.dashboard-date {
    margin: -6px 0 12px;
    color: var(--muted);
}

.report-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--emerald);
    text-decoration: none;
    font-weight: 690;
}

.badge {
    --status: #4a5568;
    --tint: #f0f2f5;
    color: var(--status);
    background: var(--tint);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid color-mix(in srgb,var(--status),transparent 87%);
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 11.5px;
    font-weight: 700;
    max-width: 100%;
    line-height: 1.45;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.present, .approved {
    --status: #1d6a50;
    --tint: #eaf5f0;
}

.late, .pending {
    --status: #8b570f;
    --tint: #fdf5e6;
}

.absent, .rejected {
    --status: #9e2a3b;
    --tint: #fbecef;
}

.permission {
    --status: #6b427a;
    --tint: #f4eef7;
}

.early_departure {
    --status: #a84e24;
    --tint: #fbf0ea;
}

.early_checkin, .record_open {
    --status: #1a6b78;
    --tint: #ebf6f8;
}

.total_students, .students_for_date, .record_completed, .in_session {
    --status: #122b24;
    --tint: #ebf2ef;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.schedule-list {
    display: grid;
    gap: 7px;
}

.schedule-row {
    background: var(--alabaster);
    padding: 8px 9px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    display: grid;
    gap: 3px;
}

.schedule-row.active {
    background: #ebf2ef;
    border-inline-start: 3px solid var(--gold);
}

.course-line {
    display: flex;
    gap: 7px;
    justify-content: space-between;
    align-items: flex-start;
}

.course-line strong {
    overflow-wrap: anywhere;
}

.course-line .badge {
    flex: none;
}

.schedule-detail {
    color: var(--muted);
    font-size: 12px;
}

.bottom-nav {
    position: fixed;
    margin: 0;
    z-index: 3;
    bottom: 0;
    inset-inline: 0;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 4px;
    padding: 5px 7px max(5px,env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--hairline);
}

.bottom-nav a {
    min-height: 49px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

.bottom-nav a[aria-current] {
    background: #e8f0ec;
    color: var(--emerald);
    font-weight: 750;
}

.bottom-nav a[aria-current] .icon {
    color: #1d6a50;
}

.content.scan-preview {
    max-width: 670px;
    margin-inline: auto;
}

.steps {
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 7px;
    margin: 0 0 15px;
}

.steps li {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 0 7px;
    border-bottom: 2px solid #d6d6ce;
    color: var(--muted);
}

.steps b {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    flex: none;
    background: var(--alabaster);
    border-radius: 50%;
}

.steps .icon {
    width: 14px;
    height: 14px;
}

.steps .finished {
    border-color: #76a894;
    color: #1d6a50;
}

.steps .finished b {
    background: #eaf5f0;
}

.steps [aria-current] {
    border-color: var(--gold);
    color: var(--emerald);
}

.steps [aria-current] b {
    background: var(--emerald);
    color: white;
}

.scan-countdown {
    background: var(--alabaster);
    text-align: center;
    margin: 0;
    padding: 14px;
    border-radius: var(--radius);
    background-image: linear-gradient(90deg,var(--gold),var(--emerald));
    background-position: top;
    background-repeat: no-repeat;
    background-size: 100% 3px;
}

.scan-countdown strong {
    display: block;
    font-size: 55px;
    color: var(--emerald);
    line-height: 1.12;
    margin: 1px 0 9px;
}

.scan-countdown progress {
    display: block;
    width: 100%;
    height: 7px;
    appearance: none;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e1d6;
}

.scan-countdown progress::-webkit-progress-bar {
    background: #e5e1d6;
}

.scan-countdown progress::-webkit-progress-value {
    background: linear-gradient(90deg,var(--gold),var(--emerald));
}

.scan-countdown progress::-moz-progress-bar {
    background: linear-gradient(90deg,var(--gold),var(--emerald));
}

.confirm-form {
    margin: 0;
    display: grid;
    gap: 10px;
}

.confirm-form .scan-action {
    width: 100%;
    min-height: 52px;
}

.confirm-form .details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 3px 12px;
    margin: 0;
}

.confirm-form .details dt {
    font-size: 12px;
    color: var(--muted);
}

.confirm-form dd {
    margin: 0;
}

.scan-option .scan-action {
    background: var(--emerald);
}

.notice {
    background: var(--emerald);
    color: white;
    border-radius: 12px;
    padding: 10px 12px;
}

.notice::before {
    content: "";
    display: inline-block;
    background: var(--gold);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-inline-end: 8px;
}

.scan-fallback {
    justify-content: center;
}

.guest .content {
    max-width: 32rem;
}

.guest .panel {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 16px;
}

@media(min-width:800px) {
    .application {
        display: grid;
        grid-template-columns: 226px minmax(0,1fr);
    }
    .rail {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 17px 12px;
        min-height: 100vh;
        background: var(--emerald);
        color: white;
    }
    .rail .classic-brand {
        padding: 0 5px 10px;
        border-bottom: 1px solid #c49a4b55;
    }
    .rail .identity {
        margin-top: 3px;
        color: #eee8d8;
    }
    .rail .secondary {
        color: white;
        background: #1a3b32;
        border-color: #80938a;
        width: 100%;
        justify-content: flex-start;
    }
    .rail .classic-nav a[aria-current] {
        background: var(--hover);
        color: white;
    }
    .rail .classic-nav a[aria-current] .icon {
        color: var(--gold);
    }
    .mobile-menu, .mobile-brand, .bottom-nav {
        display: none;
    }
    .desktop-title {
        display: block;
        flex: 1;
        font-weight: 700;
    }
    .desktop-account {
        display: block;
        color: #faf8f1;
        font-size: 12px;
    }
    .page-top {
        padding-inline: 25px;
    }
    .content, .student .content {
        padding: 24px 25px 30px;
    }
    .page-heading h1 {
        font-size: 34px;
    }
    .dash-grid {
        display: grid;
        grid-template-columns: 1.13fr 1fr;
        gap: 14px;
        align-items: start;
    }
    .admin .dash-grid {
        grid-template-columns: 1.35fr 1fr;
    }
    .student-actions .action:first-child {
        min-height: 55px;
    }
    .card {
        padding: 16px;
    }
    .schedule-row {
        padding: 10px 11px;
    }
}

@media(prefers-reduced-motion:reduce) {
    *, *::before, *::after {
        scroll-behavior: auto!important;
        animation: none!important;
        transition: none!important;
        transform: none!important;
    }
}

.scan-countdown.card {
    padding: 15px;
}

.scan-countdown {
    border-top: 1px solid var(--hairline);
}

.rail .report-link {
    color: #faf8f1;
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 8px;
}

.account-menu  {
    display: grid;
    gap: var(--space-1);
}

.account-menu .report-link  {
    justify-content: flex-start;
}

.account-menu .identity  {
    overflow-wrap: anywhere;
}

.rail .account-menu  {
    padding-top: var(--space-3);
    border-top: 1px solid #c49a4b55;
}

.rail .identity  {
    padding-inline: 8px;
}

.mobile-menu .menu-sheet  {
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 75px);
    max-height: calc(100dvh - 75px);
    overflow-y: auto;
}

.mobile-menu .menu-sheet .account-menu  {
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--hairline);
}

.mobile-menu .menu-sheet .account-menu button  {
    width: 100%;
    justify-content: flex-start;
}

.mobile-menu .menu-sheet .report-link  {
    padding-inline: 8px;
}

.rail :focus-visible, .page-top :focus-visible  {
    outline-color: var(--gold);
}

.guest .mobile-brand {
    display: flex;
}

.guest .content {
    padding-top: clamp(25px,8vh,90px);
    max-width: 30rem;
}

.guest .panel  {
    padding: clamp(16px,5vw,27px);
    background: white;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.guest .page-heading h1  {
    font-size: clamp(1.65rem,5vw,2rem);
}

.guest .login-action  {
    min-height: 51px;
}

.guest input, .guest select, .student input, .student textarea, .student select  {
    font-size: var(--text-base);
    min-height: 44px;
}

.student .plain-panel  {
    min-width: 0;
}

.student form.row  {
    align-items: end;
}

.student .leave-choices  {
    padding: var(--space-3);
    border-radius: var(--radius);
}

.student .leave-shift  {
    background: var(--alabaster);
    padding: var(--space-2);
    border-radius: 10px;
}

.student .leave-shift:has(input:checked)  {
    background: #ebf2ef;
}

.student .leave-shift input  {
    min-height: 0;
    flex: none;
}

.student button[type=submit], .student form.stack>div>button  {
    min-height: 48px;
}

.student .panel .table  {
    overflow: visible;
}

.student .panel .sheet-table  {
    margin-top: var(--space-3);
}

.student .leave-review a, .student .leave-review summary  {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.student .form-error  {
    background: #fbecef;
    color: #852837;
}

.student .leave-choices.form-error  {
    border-color: #9e2a3b;
}

.student .score-low, .student .score-mid, .student .score-high  {
    font-family: var(--serif);
    font-variant-numeric: lining-nums tabular-nums;
    font-size: 1.15rem;
}

.student .announcement h2  {
    margin-bottom: var(--space-1);
}

.student .announcement p+p  {
    margin-top: var(--space-2);
}

.student .panel > .row a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.student .summary {
    gap: var(--space-2);
}

.student .summary .summary-metric {
    background: var(--alabaster);
    color: var(--emerald);
    border: 1px solid var(--hairline);
    border-radius: 10px;
}

.student .summary .badge {
    margin-block: var(--space-1);
}

.open-link  {
    background: var(--soft);
    border-color: #e3d6bb;
    padding: 8px 12px;
    margin-block: var(--space-3);
}

.open-link .icon  {
    color: var(--gold-text);
}

.scan-camera .row  {
    gap: var(--space-2);
}

.scan-camera .row button  {
    min-height: 48px;
}

.confirm-form .details  {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
}

.confirm-form .course-line  {
    font-size: var(--text-base);
}

.pin-input  {
    min-height: 50px;
    font-size: 1.5rem!important;
    letter-spacing: .08em;
}

.scan-receipt  {
    grid-template-columns: minmax(0,1fr) minmax(0,1.3fr);
    margin: 0;
    border-radius: 12px;
    background: var(--alabaster);
    padding: var(--space-3);
}

.scan-receipt dt  {
    color: var(--muted);
}

.scan-receipt dd  {
    overflow-wrap: anywhere;
}

.receipt-tick  {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: var(--space-3);
    border-radius: 50%;
    background: #eaf5f0;
    color: #1d6a50;
}

.receipt-tick .icon  {
    width: 27px;
    height: 27px;
}

.receipt-actions  {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.receipt-actions a  {
    flex: 1 1 9rem;
}

.sheet-table  {
    width: 100%;
    border-collapse: collapse;
}

.sheet-table thead  {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.sheet-table tbody  {
    display: grid;
    gap: var(--space-2);
}

.sheet-table tr  {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: var(--space-1) var(--space-3);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--alabaster);
    padding: var(--space-2);
}

.sheet-table td  {
    border: 0;
    padding: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.sheet-table td.wide  {
    grid-column: 1/-1;
}

.sheet-table td[data-label]::before  {
    content: attr(data-label);
    font-family: var(--sans);
    color: var(--muted);
    display: block;
    font-size: .75rem;
}

@media (max-width:479px)  {
    .student form.row > label  {
        width: 100%;
    }
    .student .scan-option label  {
        min-width: 0;
    }
}

@media (min-width:800px)  {
    .sheet-table thead  {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }
    .sheet-table tbody  {
        display: table-row-group;
    }
    .sheet-table tr  {
        display: table-row;
        border: 0;
        background: white;
    }
    .sheet-table td, .sheet-table th  {
        padding: 8px 6px;
        border-bottom: 1px solid var(--hairline);
        vertical-align: top;
    }
    .sheet-table th  {
        background: var(--alabaster);
        font-size: .75rem;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
    .sheet-table td[data-label]::before  {
        display: none;
    }
    .sheet-table td:last-child .badge  {
        white-space: nowrap;
    }
    .student .panel .table  {
        overflow-x: auto;
    }
    .content.scan-preview  {
        padding-inline: 25px;
    }
}

@media print  {
    .application  {
        display: block;
    }
    .rail, .page-top, .bottom-nav  {
        display: none!important;
    }
    .content  {
        padding: 0;
    }
}
