:root {
    --ink: #1e302b;
    --muted: #76847d;
    --paper: #f5f7f4;
    --line: #e4eae5;
    --green: #278464;
    --green-dark: #195e49;
    --orange: #cc7145;
}
body { background: var(--paper); color: var(--ink); font-family: "Source Sans Pro", "Segoe UI", sans-serif; }
a { color: inherit; }
.bg-highlight { background-color: var(--green) !important; }
.color-highlight { color: var(--green) !important; }
.app-header { height: 72px; padding: 0 max(22px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 900; line-height: 1; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 19px; }
.brand-accent { color: var(--green); }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.header-account { display: flex; align-items: center; gap: 18px; }
.header-account form { margin: 0; }
.account-name { font-size: 13px; font-weight: 700; }
.account-name small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; text-align: right; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: white; }
.app-content { width: min(1120px, calc(100% - 40px)); min-height: calc(100vh - 120px); margin: 0 auto; padding: 42px 0 72px; }
.app-footer { padding: 18px; color: var(--muted); text-align: center; font-size: 12px; }
.app-footer span { margin: 0 7px; color: var(--green); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 3px 0 30px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-heading h1 { margin: 8px 0 4px; color: var(--ink); font-size: 32px; font-weight: 700; }
.page-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.eyebrow { display: block; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: 1.3px; }
.content-section, .stat-panel { margin: 0 0 20px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 5px 0 0; font-size: 20px; font-weight: 700; }
.section-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #eaf4ee; color: var(--green); font-size: 17px; }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-panel { position: relative; min-height: 145px; margin: 0; padding: 23px; overflow: hidden; }
.stat-label { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.stat-panel strong { display: inline-block; margin-top: 10px; font-size: 34px; line-height: 1; }
.stat-panel small { margin-left: 8px; color: var(--muted); }
.stat-icon { position: absolute; top: 20px; right: 22px; color: #b4d9c8; font-size: 24px; }
.stat-orange .stat-icon { color: #edc2a8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.form-grid-wide { min-width: 0; grid-column: 1 / -1; }
.form-grid-wide > label { display: block; margin-bottom: 7px; color: #43534c; font-size: 13px; font-weight: 700; }
.login-switch { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; color: var(--green-dark); font-size: 13px; font-weight: 700; }
.login-switch:hover { color: var(--green); }
.student-login-aside { background: #255b4b; }
.student-login-aside .brand-mark { background: #d98554; }
.student-login-aside .brand-accent { color: #f0c69f; }
.student-login-aside .aside-copy .eyebrow { color: #e5be98; }
.unplaced-shortcut { padding: 9px 12px; border: 1px solid #e7cfb4; border-radius: 4px; background: #fff7ed; color: #9d6132; }
.section-caption { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.unplaced-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff2e6; color: #ba7544; }
.bulk-assign-toolbar { display: flex; align-items: end; gap: 16px; margin-bottom: 12px; }
.bulk-class-field { min-width: 220px; flex: 1; color: #43534c; font-size: 12px; font-weight: 700; }
.bulk-class-field .form-control { margin-top: 5px; }
.bulk-assign-toolbar .btn { min-height: 42px; padding: 11px 15px; background: var(--green); color: #fff; white-space: nowrap; }
.unplaced-list { max-height: 350px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.unplaced-select-all, .unplaced-student { min-height: 44px; display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.unplaced-select-all { position: sticky; top: 0; z-index: 1; background: #f7f9f7; color: var(--ink); font-size: 12px; font-weight: 700; }
.unplaced-select-all small { margin-left: auto; color: var(--muted); font-weight: 400; }
.unplaced-student:last-child { border-bottom: 0; }
.unplaced-student input, .unplaced-select-all input { accent-color: var(--green); }
.unplaced-student input[type="checkbox"],
.unplaced-select-all input[type="checkbox"],
.filter-unplaced input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0 2px 0 0;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--green);
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer;
}
.unplaced-student input[type="checkbox"]:hover,
.unplaced-select-all input[type="checkbox"]:hover,
.filter-unplaced input[type="checkbox"]:hover {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--green-dark);
    filter: none !important;
    box-shadow: 0 0 0 4px #27846420 !important;
}
.unplaced-student input[type="checkbox"]:focus-visible,
.unplaced-select-all input[type="checkbox"]:focus-visible,
.filter-unplaced input[type="checkbox"]:focus-visible {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    outline: 2px solid var(--green) !important;
    outline-offset: 3px !important;
}
.unplaced-student input[type="checkbox"]:checked,
.unplaced-select-all input[type="checkbox"]:checked,
.filter-unplaced input[type="checkbox"]:checked {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--green);
    opacity: 1 !important;
}
.unplaced-student span { min-width: 0; }
.unplaced-student strong, .unplaced-student small { display: block; }
.unplaced-student strong { color: var(--ink); font-size: 13px; }
.unplaced-student small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.ms-parent { min-height: 42px; }
.ms-parent .ms-choice { min-height: 42px; padding: 8px 12px; border-color: #dfe6e0; border-radius: 4px; box-shadow: none; color: var(--ink); }
.ms-parent .ms-choice > span { top: 9px; padding-right: 26px; font-family: "Source Sans Pro", "Segoe UI", sans-serif; font-size: 13px; }
.ms-parent .ms-choice > div { top: 10px; right: 10px; }
.ms-parent .ms-drop { z-index: 20; border-color: #dfe6e0; border-radius: 4px; box-shadow: 0 8px 24px #18382d18; }
.ms-parent .ms-choice:focus { border-color: var(--green); outline: 2px solid #27846420; }
.ms-parent .ms-drop ul > li label { padding: 8px 10px; color: var(--ink); font-size: 12px; }
.ms-parent .ms-drop input[type=checkbox] { accent-color: var(--green); }
.ms-parent .ms-search input { min-height: 36px; border-color: #dfe6e0; }
.ms-parent .ms-select-all { border-bottom: 1px solid var(--line); }
.filter-bar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 14px; background: #f7f9f7; border: 1px solid var(--line); border-radius: 4px; }
.filter-bar label, .import-class-field { min-width: 150px; flex: 1; margin: 0; color: #43534c; font-size: 11px; font-weight: 700; }
.filter-bar .form-control, .import-class-field .form-control { min-height: 38px; margin-top: 5px; font-size: 12px; }
.filter-bar .btn { min-height: 38px; padding: 9px 14px; background: var(--green); color: white; }
.filter-reset { padding: 10px 5px; color: var(--muted); font-size: 12px; }
.class-fields { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.class-student-count { align-self: end; padding: 10px; color: var(--muted); font-size: 12px; }
.class-student-count strong { color: var(--green-dark); }
.import-class-field { max-width: 190px; }
.form-grid label, .login-form label { display: block; margin: 0 0 7px; color: #43534c; font-size: 13px; font-weight: 700; }
.form-control { min-height: 44px; border: 1px solid #dfe6e0; border-radius: 4px; color: var(--ink); box-shadow: none; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px #27846420; }
.form-action { display: flex; align-items: end; }
.form-action .btn, .page-heading > .btn, .import-form > .btn, .scanner-section > .btn { min-height: 44px; padding: 12px 18px; background: var(--green); color: #fff; }
.form-action .btn:hover, .page-heading > .btn:hover, .import-form > .btn:hover, .scanner-section > .btn:hover { background: var(--green-dark); color: #fff; }
.count-label { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.data-list, .session-list, .attendance-list { border-top: 1px solid var(--line); }
.data-row, .session-row, .attendance-row { min-height: 68px; display: flex; align-items: center; gap: 14px; padding: 10px 3px; border-bottom: 1px solid var(--line); }
.session-row { color: inherit; text-decoration: none; }
a.session-row:hover { color: var(--green-dark); background: #f8fbf8; }
.row-main { min-width: 0; flex: 1; }
.row-main strong, .row-main small { display: block; overflow: hidden; text-overflow: ellipsis; }
.row-main strong { color: var(--ink); font-size: 14px; }
.row-main small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.avatar, .attendance-index { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; background: #fff0e7; color: var(--orange); }
.role-tag, .status-tag { padding: 6px 10px; border-radius: 3px; background: #edf5ef; color: var(--green-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-closed { background: #f0f1ef; color: #6e7973; }
.status-waiting { background: #fff2e9; color: #a45732; }
.session-date { width: 44px; height: 48px; flex: 0 0 44px; display: grid; place-content: center; border-radius: 5px; background: #fff2e9; color: var(--orange); text-align: center; }
.session-date strong { font-size: 18px; line-height: 1; }
.session-date small { margin-top: 3px; font-size: 10px; text-transform: uppercase; }
.session-date-green { background: #eaf4ee; color: var(--green); font-size: 17px; }
.attendance-count { min-width: 48px; text-align: center; }
.attendance-count strong, .attendance-count small { display: block; }
.attendance-count strong { color: var(--green-dark); font-size: 16px; }
.attendance-count small { color: var(--muted); font-size: 10px; }
.empty-state { padding: 28px 10px; margin: 0; color: var(--muted); text-align: center; font-size: 14px; }
.notice { margin: 0 0 18px; padding: 12px 15px; border-radius: 4px; font-size: 14px; }
.notice-error { border-left: 3px solid #c65143; background: #fff1ef; color: #87372e; }
.notice-success { border-left: 3px solid var(--green); background: #edf7f0; color: var(--green-dark); }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--green); font-size: 13px; font-weight: 700; }
.back-link i { margin-right: 6px; }
.import-form { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.import-form input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.file-picker { min-width: 230px; flex: 1; min-height: 58px; display: flex; align-items: center; gap: 13px; padding: 9px 13px; border: 1px dashed #b8c9be; border-radius: 4px; cursor: pointer; }
.file-picker > i { color: var(--green); font-size: 22px; }
.file-picker strong, .file-picker small { display: block; }
.file-picker strong { font-size: 13px; }
.file-picker small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.import-result { margin-top: 18px; padding: 14px; background: #f6f8f6; border-radius: 4px; font-size: 13px; }
.import-result > strong { color: var(--green-dark); }
.import-result > span { margin-left: 14px; color: #a45732; }
.import-result ul { margin: 10px 0 0; padding-left: 20px; color: #815b4a; }
.table-scroll { overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th, .app-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.app-table th { color: var(--muted); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }
.app-table td .form-control { min-width: 100px; min-height: 38px; padding: 7px 9px; font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.table-actions form { margin: 0; }
.table-subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-scan-link { display: inline-block; text-decoration: none; }
.admin-session-row { min-height: 74px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: start; gap: 12px; padding: 16px 3px; border-bottom: 1px solid var(--line); }
.admin-session-row > .session-date { grid-column: 1; grid-row: 1; }
.admin-session-row > .admin-session-edit { grid-column: 2; grid-row: 1 / span 2; }
.admin-session-row > .status-tag { grid-column: 3; grid-row: 1; margin-top: 5px; }
.admin-session-row > .management-actions { grid-column: 4; grid-row: 1; margin-top: 1px; }
.admin-session-row .row-main { min-width: 130px; }
.admin-session-row .management-actions { margin-left: 0; }
.admin-session-edit { min-width: 290px; flex: 1; display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(90px, .7fr) minmax(165px, 1fr) 38px; align-items: end; gap: 7px; }
.admin-session-edit label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.admin-session-edit .form-control { min-height: 36px; margin-top: 4px; padding: 6px 8px; font-size: 11px; }
.admin-session-edit .table-subtext { grid-column: 1 / -1; margin-top: 0; }
.admin-class-options { width: 100%; grid-column: 1 / -1; min-width: 0; margin: 0; color: var(--muted); font-size: 10px; }
.admin-class-options .ms-parent { margin-top: 4px; }
.class-management-row .management-fields { align-items: end; }
.class-management-row .management-fields .class-student-count { grid-column: 1 / -1; }
.management-list { border-top: 1px solid var(--line); }
.management-row { display: flex; align-items: center; gap: 14px; padding: 16px 3px; border-bottom: 1px solid var(--line); }
.management-fields { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); flex: 1; gap: 10px; }
.management-fields label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.management-fields label small { font-weight: 400; }
.management-fields .form-control { margin-top: 5px; }
.management-actions { display: flex; align-items: center; gap: 5px; }
.management-actions form { margin: 0; }
.action-save { color: var(--green); }
.action-delete { color: #a14338; }
.delete-session-form { margin-top: 15px; }
.mono { font-family: Consolas, monospace; }
.session-detail-grid { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.session-qr { width: min(280px, 100%); display: block; margin: 4px auto 12px; image-rendering: pixelated; }
.qr-section { text-align: center; }
.qr-section .section-heading { text-align: left; }
.qr-caption { color: var(--muted); font-size: 12px; }
.qr-section .btn-outline-danger { border: 1px solid #e4b7b1; color: #a14338; }
.attendance-section .section-heading { margin-bottom: 13px; }
.attendance-section .section-heading h2 { display: flex; align-items: center; gap: 10px; }
.live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #4ca57c; box-shadow: 0 0 0 4px #4ca57c20; }
.attendance-row { min-height: 58px; }
.attendance-index { width: 30px; height: 30px; flex-basis: 30px; background: #eef4ef; color: var(--green); font-size: 12px; }
.attendance-row time { color: var(--muted); font-size: 12px; }
.scanner-section { width: min(560px, 100%); margin-right: auto; margin-left: auto; text-align: center; }
#qr-reader { width: min(100%, 420px); margin: 0 auto; border: 0 !important; }
#qr-reader video { border-radius: 5px; }
#qr-reader__dashboard_section_csr button { margin: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.scan-status { margin: 15px 0; color: var(--muted); font-size: 13px; }
.login-page { min-height: 100vh; background: #f5f7f4; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .94fr) minmax(380px, 1.06fr); }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 36px; overflow: hidden; background: #1e4c3d; color: #fff; }
.login-aside::after { position: absolute; right: -110px; bottom: 85px; width: 360px; height: 360px; border: 1px solid #ffffff19; border-radius: 50%; box-shadow: 0 0 0 42px #ffffff0a, 0 0 0 92px #ffffff08; content: ""; }
.brand-light { position: relative; z-index: 1; color: #fff; }
.brand-light:hover { color: #fff; }
.brand-light .brand-mark { background: #d98554; }
.brand-light .brand-accent { color: #a8d8bf; }
.brand-light small { color: #b8cec3; }
.aside-copy { position: relative; z-index: 1; max-width: 470px; padding: 70px 0; }
.aside-copy .eyebrow { color: #a8d8bf; }
.aside-copy h1 { margin: 18px 0; color: #fff; font-family: Georgia, serif; font-size: clamp(38px, 4.5vw, 60px); font-weight: 400; line-height: 1.08; }
.aside-copy p { max-width: 390px; color: #c7d9d0; font-size: 16px; line-height: 1.6; }
.aside-stamp { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 13px; font-weight: 700; }
.aside-stamp > i { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #6a9985; border-radius: 50%; color: #a8d8bf; }
.aside-stamp small { display: block; margin-top: 4px; color: #b8cec3; font-size: 11px; font-weight: 400; }
.login-form-wrap { display: grid; place-items: center; padding: 35px; }
.login-form { width: min(380px, 100%); }
.login-form h2 { margin: 9px 0 3px; color: var(--ink); font-size: 28px; font-weight: 700; }
.muted { margin-bottom: 26px; color: var(--muted); font-size: 14px; }
.login-form .form-control { margin-bottom: 17px; }
.login-form select.form-control { appearance: auto; }
.login-submit { width: 100%; min-height: 47px; margin-top: 10px; background: var(--green); color: #fff; }
.login-footnote { margin-top: 22px; color: var(--muted); text-align: center; font-size: 12px; }
.login-footnote i { margin-right: 5px; color: var(--green); }
.qr-swal-popup { border-radius: 8px !important; padding: 24px !important; font-family: "Source Sans Pro", "Segoe UI", sans-serif !important; }
.qr-swal-title { color: var(--ink) !important; font-size: 22px !important; }
.qr-swal-actions { gap: 9px !important; }
.qr-swal-confirm, .qr-swal-cancel {
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.qr-swal-confirm { background: var(--green); color: #fff; }
.qr-swal-confirm:hover, .qr-swal-confirm:focus-visible { background: var(--green-dark); color: #fff; }
.qr-swal-cancel { background: #edf1ed; color: var(--ink); }
.qr-swal-cancel:hover, .qr-swal-cancel:focus-visible { background: #dfe7e0; color: var(--ink); }
.qr-swal-confirm:focus-visible, .qr-swal-cancel:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { min-height: 280px; padding: 24px; }
    .aside-copy { padding: 30px 0; }
    .aside-copy h1 { font-size: 40px; }
    .aside-copy p { max-width: 420px; margin-bottom: 0; font-size: 14px; }
    .aside-stamp { display: none; }
    .login-form-wrap { padding: 38px 24px; }
    .app-content { width: min(100% - 28px, 600px); padding-top: 27px; }
    .app-header { height: 62px; padding: 0 15px; }
    .page-heading { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 23px; }
    .heading-actions { width: 100%; }
    .heading-actions .btn { flex: 1; padding: 10px 8px; font-size: 10px; text-align: center; }
    .page-heading h1 { font-size: 27px; }
    .page-heading > .btn { align-self: stretch; text-align: center; }
    .content-section { padding: 18px; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-panel { min-height: 128px; padding: 17px; }
    .stat-panel strong { font-size: 29px; }
    .form-grid { grid-template-columns: 1fr; gap: 13px; }
    .form-grid-wide { grid-column: auto; }
    .filter-bar { align-items: stretch; flex-direction: column; gap: 9px; }
    .filter-bar label, .import-class-field { min-width: 100%; max-width: none; }
    .filter-bar .btn { width: 100%; }
    .filter-reset { text-align: center; }
    .form-action .btn { width: 100%; }
    .session-detail-grid { grid-template-columns: 1fr; gap: 0; }
    .session-row { gap: 9px; }
    .status-tag { padding: 5px 7px; font-size: 10px; }
    .attendance-count { display: none; }
    .file-picker { min-width: 100%; }
    .bulk-assign-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
    .bulk-class-field { min-width: 100%; }
    .bulk-assign-toolbar .btn { width: 100%; }
    .import-form > .btn { width: 100%; }
    .management-row { align-items: start; flex-wrap: wrap; }
    .management-fields { grid-template-columns: 1fr; flex-basis: calc(100% - 56px); }
    .management-actions { margin-left: 52px; }
    .admin-session-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 9px; }
    .admin-session-row > .session-date { grid-column: 1; grid-row: 1; }
    .admin-session-row > .status-tag { grid-column: 2; grid-row: 1; justify-self: start; margin-top: 4px; }
    .admin-session-row > .management-actions { grid-column: 3; grid-row: 1; }
    .admin-session-row > .admin-session-edit { grid-column: 1 / -1; grid-row: 2; min-width: 0; margin: 0; grid-template-columns: 1fr 1fr; }
    .admin-session-edit > label:first-of-type { grid-column: 1 / -1; }
    .admin-session-edit .table-subtext { grid-column: 1 / -1; }
    .history-table { min-width: 680px; }
}