@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --ink: #19352e;
    --ink-soft: #52645e;
    --muted: #82918b;
    --line: #e8eeeb;
    --paper: #ffffff;
    --canvas: #f5f8f6;
    --green: #2d8c68;
    --green-deep: #176647;
    --green-soft: #e6f3ec;
    --mint: #cde8d8;
    --blue: #527ba7;
    --amber: #b98330;
    --rose: #bd6664;
    --shadow: 0 12px 32px rgba(25, 53, 46, .055);
    font-family: 'DM Sans', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: 'DM Sans', sans-serif; font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(45, 140, 104, .25); outline-offset: 2px; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 800 19px 'Manrope', sans-serif; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px 10px 10px 3px; background: #d9efdf; color: var(--green-deep); font-size: 18px; }
.brand-accent { color: var(--green); }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.muted { color: var(--muted); }

/* Sign-in */
.auth-page { min-height: 100vh; background: #f4f7f4; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 7fr) minmax(340px, 3fr); min-height: 100vh; }
.auth-aside { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 42px clamp(36px, 6vw, 92px); background: #e6f1e9; }
.auth-aside::before { position: absolute; right: -165px; bottom: -205px; width: 520px; height: 520px; border: 1px solid rgba(45, 140, 104, .13); border-radius: 50%; content: ''; }
.auth-aside::after { position: absolute; right: -86px; bottom: -125px; width: 355px; height: 355px; border: 1px solid rgba(45, 140, 104, .16); border-radius: 50%; content: ''; }
.brand-light { position: relative; z-index: 1; }
.auth-intro { position: absolute; z-index: 1; top: 50%; max-width: 510px; padding: 0; translate: 0 -50%; animation: slide-in-left .65s ease both; }
.auth-intro h1 { margin: 15px 0 20px; font: 700 clamp(35px, 4vw, 52px)/1.14 'Manrope', sans-serif; letter-spacing: 0; }
.auth-intro h1 span { color: var(--green); }
.auth-intro > p:last-child { max-width: 370px; margin: 0; color: #60736a; font-size: 16px; line-height: 1.75; }
.auth-aside-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #60736a; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #57a77d; box-shadow: 0 0 0 4px rgba(87, 167, 125, .12); }
.auth-main { display: grid; place-items: center; padding: 54px clamp(20px, 2.25vw, 36px); background: #fff; }
.auth-form-wrap { width: min(100%, 410px); animation: slide-in-left .65s .08s ease both; }
.brand-mobile { display: none; }
.auth-heading { margin: 0 0 25px; }
.auth-heading h2 { margin: 0 0 8px; font: 700 29px 'Manrope', sans-serif; letter-spacing: 0; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 22px; padding: 4px; border-radius: 7px; background: #f2f5f3; }
.auth-tab { min-height: 38px; border: 0; border-radius: 5px; background: transparent; color: #77867f; cursor: pointer; font-weight: 600; }
.auth-tab.is-active { background: white; color: var(--green-deep); box-shadow: 0 1px 5px rgba(30, 59, 48, .10); }
.auth-form, .stack-form { display: grid; gap: 16px; }
.auth-form:not([hidden]) { animation: slide-in-left .38s ease both; }
.auth-inline-link { justify-self: center; padding: 4px 8px; border: 0; background: transparent; color: var(--green-deep); cursor: pointer; font-size: 11px; font-weight: 600; }
.auth-inline-link-right { justify-self: end; }
.auth-inline-link:hover { text-decoration: underline; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { padding-right: 45px; }
.password-visibility-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 32px; height: 32px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 4px; background: transparent; color: #718078; cursor: pointer; }
.password-visibility-toggle:hover { background: #f2f6f3; color: var(--green-deep); }
.password-visibility-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
label { display: grid; gap: 7px; color: #344b42; font-size: 12px; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe7e2; border-radius: 5px; background: #fff; color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s; }
input::placeholder, textarea::placeholder { color: #a6b0ab; }
input:focus, textarea:focus, select:focus { border-color: #72b694; box-shadow: 0 0 0 3px rgba(45, 140, 104, .09); }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
input[type=file] { padding: 8px; color: var(--muted); font-size: 11px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 0; border-radius: 4px; background: var(--green-soft); color: var(--green-deep); cursor: pointer; font-weight: 600; }
.auth-footnote { margin: 23px 0 0; color: #98a39d; font-size: 11px; text-align: center; }
.notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; line-height: 1.55; }
.notice.is-dismissing { opacity: 0; transition: opacity .25s ease; }
.notice-success { border-color: #cce8d7; background: #eff8f2; color: #287047; }
.notice-danger { border-color: #f0d1ce; background: #fff4f2; color: #9a4d49; }
.notice-warning { border-color: #f0dfbc; background: #fff9eb; color: #8b682d; }

/* Dashboard frame */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 244px; flex-direction: column; overflow-y: auto; padding: 25px 15px 17px; border-right: 1px solid #e9efeb; background: white; }
.sidebar .brand { padding: 0 10px 35px; }
.sidebar-label { padding: 0 12px 10px; color: #a0aaa4; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.side-nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 41px; align-items: center; gap: 11px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: #66756e; cursor: pointer; font-size: 12px; text-align: left; transition: background .16s, color .16s; }
.nav-link:hover { background: #f4f8f5; color: var(--green-deep); }
.nav-link.is-active { background: #eaf4ed; color: #247551; font-weight: 600; }
.nav-icon { display: grid; width: 18px; place-items: center; color: #7e9086; font-size: 17px; }
.nav-link.is-active .nav-icon { color: var(--green); }
.nav-arrow { margin-left: auto; color: #72a98c; font-size: 18px; }
.sidebar-bottom { margin-top: auto; }

.settings-page-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px; }
.settings-panel { display: flex; min-width: 0; min-height: 112px; align-items: center; justify-content: space-between; gap: 24px; }
.settings-panel .panel-heading { margin: 0; }
.setting-toggle { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; cursor: pointer; }
.setting-toggle input { position: absolute; width: 1px; min-height: 0; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; }
.setting-switch-track { position: relative; display: block; width: 46px; height: 26px; border: 1px solid #d5dfd8; border-radius: 999px; background: #e9efeb; transition: background .18s, border-color .18s; }
.setting-switch-track::before { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(25, 53, 46, .2); content: ''; transition: transform .18s; }
.setting-toggle input:checked + .setting-switch-track { border-color: var(--green); background: var(--green); }
.setting-toggle input:checked + .setting-switch-track::before { transform: translateX(20px); }
.setting-toggle input:focus-visible + .setting-switch-track { outline: 3px solid rgba(45, 140, 104, .25); outline-offset: 2px; }
.settings-page-status { grid-column: 1 / -1; margin: -6px 0 0; color: var(--green-deep); font-size: 11px; line-height: 1.5; }
.settings-security { margin-top: 4px; }
.profile-mini { display: flex; align-items: center; gap: 9px; padding: 13px 7px 0; border-top: 1px solid var(--line); }
.profile-mini > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.profile-mini strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini small { color: var(--muted); font-size: 9px; }
.profile-more { margin-left: auto; color: #83928a; font-size: 17px; }
.avatar { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; background: #e8f1eb; color: #377e5e; font: 700 12px 'Manrope', sans-serif; }
.avatar-small { width: 29px; height: 29px; flex-basis: 29px; font-size: 11px; }
.avatar-table { width: 29px; height: 29px; flex-basis: 29px; font-size: 10px; }
.avatar-green { background: #dff0e5; }
.main-area { min-height: 100vh; margin-left: 244px; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; height: 62px; align-items: center; justify-content: space-between; padding: 0 37px; border-bottom: 1px solid #e9efeb; background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8c9992; font-size: 11px; }
.breadcrumb strong { color: #354d42; font-weight: 600; }
.crumb-divider { color: #c6cfca; }
.topbar-right { display: flex; align-items: center; gap: 13px; color: #7f8d86; font-size: 11px; }
.topbar-divider { width: 1px; height: 20px; background: var(--line); }
.button-logout { min-height: 32px; gap: 7px; padding: 0 10px; border-color: #e2ebe5; background: #fff; color: #5c7566; }
.button-logout:hover { border-color: #bdd8c6; background: #f4f9f5; color: var(--green-deep); }
.button-danger-soft { min-height: 32px; gap: 7px; padding: 0 10px; border-color: #f1d5d2; background: #fff3f1; color: #a6534d; }
.button-danger-soft:hover { border-color: #e7bcb7; background: #fde9e6; color: #8f3934; }
.account-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.account-actions form { margin: 0; }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; overflow: hidden; border: 1px solid #e7ece8; border-radius: 9px; background: #fff; color: var(--ink); box-shadow: 0 22px 70px rgba(26, 51, 39, .2); animation: confirm-dialog-enter .18s ease-out both; }
.confirm-dialog::backdrop { background: rgba(24, 39, 31, .42); backdrop-filter: blur(3px); }
.confirm-dialog-header { display: flex; min-height: 42px; align-items: center; padding: 0 25px; background: #e6f3ec; }
.confirm-dialog-label { color: #19352e; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.confirm-dialog-content { padding: 23px 25px 25px; }
.confirm-dialog h2 { margin: 0 0 10px; color: #176647; font: 700 17px/1.45 'Manrope', sans-serif; }
.confirm-dialog-note { margin: 0; padding-top: 11px; border-top: 1px solid #edf1ee; color: #718078; font-size: 12px; line-height: 1.65; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.confirm-dialog-cancel { border-color: #cde8d8; background: #eaf5ee; color: #176647; }
.confirm-dialog-cancel:hover { border-color: #a9d2b8; background: #dff0e5; }
.confirm-dialog-submit { border-color: #f1d5d2; background: #fff0ee; color: #bd332b; }
.confirm-dialog-submit:hover { border-color: #e7bcb7; background: #fde5e2; color: #a3221b; }
.menu-toggle { display: none !important; }
.content-wrap { width: min(100%, 1320px); margin: 0 auto; padding: 32px 37px 24px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.welcome-row .eyebrow { margin-bottom: 6px; }
.welcome-row h1 { margin: 0; font: 700 25px 'Manrope', sans-serif; letter-spacing: 0; }
.wave { color: #65a57f; }
.welcome-row .muted { margin: 7px 0 0; font-size: 12px; }
.clock-block { display: grid; justify-items: end; gap: 3px; color: #7b8982; font-size: 10px; }
.clock-block strong { color: var(--ink); font: 700 17px 'Manrope', sans-serif; font-variant-numeric: tabular-nums; }
.clock-block small { color: #98a39d; font-size: 9px; }

/* Dashboard content */
.hero-strip { position: relative; display: flex; min-height: 228px; align-items: center; overflow: hidden; margin-bottom: 21px; padding: 29px 38px; border-radius: 7px; background: #e7f2e9; animation: slide-in-left .55s cubic-bezier(.2, .65, .3, 1) both; }
.hero-strip > div:first-child { position: relative; z-index: 1; max-width: 390px; }
.hero-kicker { color: #448564; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.hero-strip h2 { margin: 11px 0 8px; font: 700 25px/1.28 'Manrope', sans-serif; letter-spacing: 0; }
.hero-strip p { margin: 0 0 17px; color: #667a6d; font-size: 11px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 16px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 600; transition: background .16s, transform .16s, border-color .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-deep); }
.button-light { background: white; color: #286e4e; }
.button-light:hover { background: #f5fbf6; }
.button-outline { border-color: #d9e6de; background: white; color: #5e7167; }
.button-outline:hover { border-color: #a8cbb5; }
.button-wide { width: 100%; margin-top: 3px; }
.hero-illustration { position: absolute; inset: 0 0 0 auto; width: 47%; overflow: hidden; }
.orbit { position: absolute; top: -101px; right: 82px; width: 345px; height: 345px; border: 1px solid rgba(45, 140, 104, .15); border-radius: 50%; }
.orbit-two { top: -48px; right: 135px; width: 240px; height: 240px; }
.hero-leaf { position: absolute; top: 47px; right: 191px; color: #79aa89; font-size: 35px; transform: rotate(-16deg); }
.hero-chart { position: absolute; right: 69px; bottom: 36px; display: flex; width: 190px; height: 91px; align-items: end; gap: 9px; padding: 15px 18px 0; border: 1px solid rgba(72, 133, 92, .14); border-bottom: 0; border-radius: 12px 12px 0 0; background: rgba(255, 255, 255, .58); transform: rotate(-5deg); }
.hero-chart span { width: 16px; height: 35%; border-radius: 3px 3px 0 0; background: #a8d4b3; }
.hero-chart span:nth-child(2) { height: 63%; background: #79bd91; }
.hero-chart span:nth-child(3) { height: 48%; }
.hero-chart span:nth-child(4) { height: 78%; background: #68a97f; }
.hero-chart span:nth-child(5) { height: 58%; }
.hero-chart span:nth-child(6) { height: 91%; background: #428d66; }
.hero-tag { position: absolute; top: 42px; right: 44px; display: grid; width: 51px; height: 51px; place-content: center; border-radius: 50%; background: #fff; color: #81958a; font-size: 8px; text-align: center; transform: rotate(7deg); }
.hero-tag strong { color: var(--green); font: 700 11px 'Manrope', sans-serif; }
.class-banner { display: flex; min-height: 105px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 19px 23px; border: 1px solid #dfebe2; border-radius: 6px; background: linear-gradient(105deg, #eaf4ec 0%, #f7faf7 76%); animation: slide-in-left .55s cubic-bezier(.2, .65, .3, 1) both; }
.class-banner h2 { margin: 0 0 5px; font: 700 18px 'Manrope', sans-serif; }
.class-banner p { margin: 0; color: #78877f; font-size: 11px; }
.class-banner .eyebrow { margin-bottom: 6px; }
.code-chip { display: inline-flex; min-height: 30px; align-items: center; padding: 0 11px; border: 1px solid #cfe3d4; border-radius: 4px; background: white; color: #387652; font: 700 10px 'Manrope', sans-serif; letter-spacing: .5px; }
.code-chip-small { min-height: 22px; padding: 0 7px; font-size: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 29px; }
.stat-grid:has(.stat-card:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { position: relative; display: flex; min-height: 91px; align-items: center; gap: 13px; padding: 15px; border: 1px solid #ebf0ed; border-radius: 5px; background: white; animation: slide-in-left .5s cubic-bezier(.2, .65, .3, 1) both; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
.stat-icon { display: grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; border-radius: 5px; font-size: 17px; }
.tone-mint { background: #e6f3ea; color: #37835c; }
.tone-blue { background: #eaf0f7; color: var(--blue); }
.tone-amber { background: #fbf1df; color: var(--amber); }
.tone-rose { background: #faeaea; color: var(--rose); }
.stat-card p { margin: 0 0 5px; color: #839088; font-size: 10px; }
.stat-card strong { font: 700 21px 'Manrope', sans-serif; font-variant-numeric: tabular-nums; }
.stat-mark { position: absolute; top: 13px; right: 13px; color: #a8b8ad; font-size: 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; font: 700 16px 'Manrope', sans-serif; }
.section-heading .muted { margin: 7px 0 0; font-size: 11px; }
.text-link { flex: 0 0 auto; color: #3c8561; font-size: 10px; font-weight: 600; }
.text-link span { padding-left: 4px; font-size: 14px; }
.table-panel, .class-overview, .form-panel, .list-panel { border: 1px solid #e9efeb; border-radius: 5px; background: white; }
.form-panel, .list-panel, .settings-panel, .grade-list { animation: slide-in-left .55s cubic-bezier(.2, .65, .3, 1) both; }
.table-panel { margin-bottom: 15px; animation: slide-in-left .55s .12s cubic-bezier(.2, .65, .3, 1) both; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 38px; padding: 0 15px; border-bottom: 1px solid #edf1ee; background: #fbfcfb; color: #8a9790; font-size: 9px; font-weight: 600; white-space: nowrap; }
td { height: 52px; padding: 8px 15px; border-bottom: 1px solid #f0f3f1; color: #63716a; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #334b40; font-weight: 600; }
.cell-sub { display: block; margin-top: 4px; color: #9aa59e; font-size: 9px; }
.truncate-cell { max-width: 290px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-cell { height: 82px; color: #99a59e; text-align: center; }
.badge { display: inline-flex; min-height: 22px; align-items: center; gap: 5px; padding: 0 7px; border-radius: 3px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: #e9f5ed; color: #3b895d; }
.badge-warning { background: #fff4df; color: #a5772b; }
.badge-danger { background: #fff0ee; color: #b35b56; }
.badge-neutral { background: #f0f3f1; color: #728078; }
.class-overview { margin-bottom: 22px; padding: 16px 0 0; animation: slide-in-left .55s .08s cubic-bezier(.2, .65, .3, 1) both; }
.mini-section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.mini-section-title h3 { margin: 0 0 5px; font: 700 12px 'Manrope', sans-serif; }
.mini-section-title p { margin: 0; color: #8b9790; font-size: 9px; }
.capacity-track { width: 68px; height: 5px; overflow: hidden; margin-top: 7px; border-radius: 9px; background: #edf2ef; }
.capacity-track span { display: block; height: 100%; border-radius: inherit; background: #75b78b; }
.section-heading-list { margin: 3px 0 17px; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.account-create-trigger { width: 100%; margin: 0 0 15px; animation: slide-in-left .55s .18s cubic-bezier(.2, .65, .3, 1) both; }
.account-create-plus { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 17px; font-weight: 400; line-height: 1; }
.account-dialog { position: fixed; width: min(460px, calc(100% - 32px)); max-height: min(680px, calc(100% - 32px)); padding: 27px; overflow: auto; border: 1px solid #e3ebe5; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 24px 75px rgba(0, 0, 0, .24); }
.account-dialog::backdrop { background: rgba(16, 29, 21, .58); backdrop-filter: blur(3px); }
.account-dialog .panel-heading { padding-right: 20px; }
.account-dialog .stack-form { margin-top: 20px; }
.account-dialog .stack-form .muted { margin: 0; font-size: 10px; line-height: 1.55; }
.account-dialog-close { position: absolute; top: 10px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: #eff4f0; color: var(--ink); cursor: pointer; font-size: 22px; line-height: 1; }
.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #e3eae5; border-radius: 5px; background: white; color: #62756a; cursor: pointer; }
.icon-button:hover { border-color: #bfd9c7; color: var(--green-deep); }
.delete-button { color: #b8645f; font-size: 16px; }
.workspace-grid { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(0, 1.45fr); align-items: start; gap: 16px; }
.workspace-grid > :first-child { animation: slide-in-left .55s .06s cubic-bezier(.2, .65, .3, 1) both; }
.workspace-grid > :last-child { animation: slide-in-left .55s .14s cubic-bezier(.2, .65, .3, 1) both; }
.form-panel { padding: 21px; }
.panel-heading { margin-bottom: 19px; }
.panel-heading .eyebrow { margin-bottom: 6px; }
.panel-heading h2 { margin: 0 0 6px; font: 700 16px 'Manrope', sans-serif; }
.panel-heading p { margin: 0; color: #89968f; font-size: 10px; line-height: 1.6; }
.stack-form { gap: 13px; }
.stack-form input, .stack-form textarea, .stack-form select { font-size: 11px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-actions, .item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.form-actions form, .item-actions form { margin: 0; }
.button-small { min-height: 27px; gap: 5px; padding: 0 8px; font-size: 9px; }
.coordinate-tools { display: grid; justify-items: start; gap: 8px; }
.coordinate-tools .button { margin: 0; }
.map-help { margin: -4px 0; color: #89968f; font-size: 10px; line-height: 1.5; }
.place-picker-map { width: 100%; height: 280px; z-index: 0; border: 1px solid #dfe7e2; border-radius: 5px; background: #f2f5f3; }
.place-picker-map.map-unavailable { display: grid; place-items: center; padding: 18px; color: #74837a; font-size: 11px; line-height: 1.6; text-align: center; }
.form-panel .button { margin-top: 3px; justify-self: start; }
.list-panel { min-width: 0; padding: 20px; }
.list-panel .panel-heading { margin-bottom: 15px; }
.empty-state { padding: 24px 12px; color: #96a29b; font-size: 11px; line-height: 1.65; text-align: center; }
.location-item { display: flex; gap: 12px; padding: 15px 0; border-top: 1px solid #eff2f0; animation: slide-in-left .45s ease both; }
.location-item:nth-of-type(1) { animation-delay: .22s; }
.location-item:nth-of-type(2) { animation-delay: .28s; }
.location-item:nth-of-type(3) { animation-delay: .34s; }
.location-item:nth-of-type(4) { animation-delay: .4s; }
.location-item:nth-of-type(5) { animation-delay: .46s; }
.location-details { min-width: 0; flex: 1; }
.location-details .item-actions { margin-top: 10px; }
.location-pin { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 5px; background: #eaf4ec; color: #39825d; font-size: 18px; }
.location-item strong { font-size: 11px; }
.location-item p { margin: 5px 0; color: #819087; font-size: 10px; line-height: 1.5; }
.location-item small { color: #9aa69f; font-size: 9px; }
.dot-separator { padding: 0 4px; }
.attendance-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 20px; border: 1px solid #dfebe2; border-radius: 5px; background: #eff7f0; animation: slide-in-left .55s cubic-bezier(.2, .65, .3, 1) both; }
.attendance-copy { display: flex; align-items: center; gap: 13px; }
.attendance-icon { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 50%; background: white; color: #438a62; font-size: 21px; }
.attendance-copy h3 { margin: 0 0 5px; font: 700 13px 'Manrope', sans-serif; }
.attendance-copy p { max-width: 430px; margin: 0; color: #788b7f; font-size: 10px; line-height: 1.55; }
.attendance-panel form { flex: 0 0 auto; text-align: right; }
.attendance-panel form[data-geolocation-form] { display: grid; justify-items: end; gap: 8px; width: min(100%, 390px); }
.attendance-camera { width: min(100%, 360px); overflow: hidden; border: 1px solid #dfe7e2; border-radius: 5px; background: #17221b; }
.attendance-camera video, .attendance-camera img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.attendance-camera-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 29, 21, .72); backdrop-filter: blur(4px); }
.attendance-camera-overlay[hidden] { display: none !important; }
.attendance-camera-dialog { display: grid; width: min(100%, 560px); gap: 12px; padding: 19px; border: 1px solid #e3ebe5; border-radius: 9px; background: #fff; box-shadow: 0 24px 75px rgba(0, 0, 0, .28); }
.attendance-camera-dialog > .eyebrow { margin: 0; }
.attendance-camera-dialog .attendance-camera { width: 100%; }
.attendance-camera-dialog .attendance-camera video, .attendance-camera-dialog .attendance-camera img { max-height: min(66vh, 560px); }
.attendance-camera-preview { width: 100%; }
.attendance-camera-preview button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px; border: 1px solid #dfe7e2; border-radius: 5px; background: #fff; color: var(--green-deep); cursor: pointer; font-size: 10px; text-align: left; }
.attendance-camera-preview img { width: 66px; height: 54px; border-radius: 3px; object-fit: cover; }
.photo-dialog { position: fixed; width: fit-content; max-width: min(920px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 42px 12px 12px; overflow: auto; border: 1px solid #e3ebe5; border-radius: 8px; background: #fff; box-shadow: 0 24px 75px rgba(0, 0, 0, .28); }
.photo-dialog::backdrop { background: rgba(16, 29, 21, .76); backdrop-filter: blur(4px); }
.photo-dialog > img { display: block; max-width: 100%; max-height: calc(100vh - 76px); object-fit: contain; }
.photo-dialog-close { position: absolute; top: 7px; right: 9px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #eff4f0; color: var(--ink); cursor: pointer; font-size: 23px; line-height: 1; }
.attendance-camera-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.attendance-camera-actions .button { min-height: 35px; }
.attendance-camera-actions [hidden] { display: none !important; }
.form-feedback { max-width: 260px; margin: 7px 0 0; color: #71877a; font-size: 9px; }
.form-guide { display: grid; gap: 4px; margin: 0; padding: 10px 12px; border: 1px solid #d6eade; border-left: 3px solid var(--green); border-radius: 4px; background: #f0f8f2; color: #5d7465; font-size: 10px; line-height: 1.55; }
.form-guide strong { color: var(--green-deep); font-size: 10px; }
.attendance-panel .form-guide { margin-bottom: 10px; text-align: left; }
.label-note { display: inline; color: #a0aaa4; font-size: 9px; font-weight: 400; }
.logbook-grid { grid-template-columns: minmax(275px, .8fr) minmax(0, 1.3fr); }
.journal-item { padding: 16px 0; border-top: 1px solid #edf1ee; animation: slide-in-left .45s ease both; }
.journal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.journal-head > strong, .journal-head > div > strong { color: #344d41; font-size: 11px; }
.journal-item > p { margin: 10px 0; color: #63746a; font-size: 10px; line-height: 1.7; }
.photo-link { color: #38815b; font-size: 10px; font-weight: 600; }
.teacher-note { margin-top: 12px; padding: 10px 12px; border-left: 2px solid #e0b76c; background: #fff9ee; }
.teacher-note strong { color: #826530; font-size: 9px; }
.teacher-note p { margin: 5px 0 0; color: #796e59; font-size: 10px; line-height: 1.55; }
.journal-list { display: grid; gap: 12px; }
.review-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(215px, .75fr); gap: 20px; padding: 18px; border: 1px solid #e9efeb; border-radius: 5px; background: white; animation: slide-in-left .55s cubic-bezier(.2, .65, .3, 1) both; }
.review-main .journal-head > div { display: grid; gap: 3px; }
.review-main .cell-sub { margin: 0; }
.review-activity { margin: 14px 0 10px; color: #607168; font-size: 11px; line-height: 1.75; }
.review-form { display: grid; align-content: start; gap: 10px; padding-left: 17px; border-left: 1px solid #edf1ee; }
.review-form label { gap: 5px; color: #68776f; font-size: 10px; }
.review-form input { min-height: 35px; }
.review-form textarea { min-height: 57px; }
.review-actions { display: flex; gap: 7px; }
.review-actions .button { min-height: 33px; gap: 5px; padding: 0 9px; font-size: 9px; }
.result-count { color: #829087; font-size: 10px; }
.grade-list { border: 1px solid #e9efeb; border-radius: 5px; background: white; }
.grade-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 70px; gap: 20px; align-items: center; padding: 17px 20px; border-bottom: 1px solid #edf1ee; animation: slide-in-left .45s ease both; }
.grade-row:last-child { border-bottom: 0; }
.grade-date { display: grid; gap: 5px; }
.grade-date .eyebrow { margin: 0; font-size: 8px; }
.grade-date strong { font-size: 10px; }
.grade-detail p { margin: 8px 0 4px; color: #65756b; font-size: 10px; line-height: 1.6; }
.grade-detail > small { color: #8c9991; font-size: 9px; }
.grade-score { display: grid; justify-items: center; gap: 4px; color: #8c9991; font-size: 9px; }
.grade-score strong { color: #34805a; font: 700 20px 'Manrope', sans-serif; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 23px 2px 0; color: #a0aaa4; font-size: 9px; }

body.app-page[data-theme=dark] {
    color-scheme: dark;
    --ink: #e1eee7;
    --ink-soft: #bdcdc3;
    --muted: #9aac9f;
    --line: #34483d;
    --paper: #1d2d25;
    --canvas: #14221b;
    --green: #72c396;
    --green-deep: #8dd4a8;
    --green-soft: #263e31;
    background: var(--canvas);
    color: var(--ink);
}
body.app-page[data-theme=dark] .sidebar,
body.app-page[data-theme=dark] .topbar,
body.app-page[data-theme=dark] .table-panel,
body.app-page[data-theme=dark] .class-overview,
body.app-page[data-theme=dark] .form-panel,
body.app-page[data-theme=dark] .list-panel,
body.app-page[data-theme=dark] .review-card,
body.app-page[data-theme=dark] .stat-card {
    border-color: var(--line);
    background: var(--paper);
}
body.app-page[data-theme=dark] .topbar { background: rgba(29, 45, 37, .96); }
body.app-page[data-theme=dark] .sidebar-label,
body.app-page[data-theme=dark] .nav-link,
body.app-page[data-theme=dark] .breadcrumb,
body.app-page[data-theme=dark] .topbar-right,
body.app-page[data-theme=dark] .panel-heading p,
body.app-page[data-theme=dark] .location-item p,
body.app-page[data-theme=dark] .location-item small,
body.app-page[data-theme=dark] .empty-state,
body.app-page[data-theme=dark] .stat-card p,
body.app-page[data-theme=dark] .cell-sub,
body.app-page[data-theme=dark] td,
body.app-page[data-theme=dark] .clock-block,
body.app-page[data-theme=dark] .welcome-row .muted {
    color: #a5b7ac;
}
body.app-page[data-theme=dark] .class-banner,
body.app-page[data-theme=dark] .attendance-panel,
body.app-page[data-theme=dark] .form-guide {
    border-color: #344d3e;
    background: #22372b;
}
body.app-page[data-theme=dark] .profile-mini strong,
body.app-page[data-theme=dark] .breadcrumb strong,
body.app-page[data-theme=dark] .welcome-row h1,
body.app-page[data-theme=dark] .section-heading h2,
body.app-page[data-theme=dark] .panel-heading h2,
body.app-page[data-theme=dark] .mini-section-title h3,
body.app-page[data-theme=dark] td strong,
body.app-page[data-theme=dark] .journal-head > strong,
body.app-page[data-theme=dark] .journal-head > div > strong,
body.app-page[data-theme=dark] .attendance-copy h3 {
    color: #e1eee7;
}
body.app-page[data-theme=dark] label,
body.app-page[data-theme=dark] .map-help,
body.app-page[data-theme=dark] .coordinate-tools .form-feedback,
body.app-page[data-theme=dark] .empty-cell {
    color: #c1d1c6;
}
body.app-page[data-theme=dark] .settings-status { color: #a5e0b8; }
body.app-page[data-theme=dark] .nav-link:hover,
body.app-page[data-theme=dark] .nav-link.is-active {
    background: #294235;
    color: #a5e0b8;
}
body.app-page[data-theme=dark] input,
body.app-page[data-theme=dark] textarea,
body.app-page[data-theme=dark] select,
body.app-page[data-theme=dark] .icon-button {
    border-color: #40564a;
    background: #17271f;
    color: #e1eee7;
}
body.app-page[data-theme=dark] .account-dialog {
    border-color: var(--line);
    background: var(--paper);
}
body.app-page[data-theme=dark] .account-dialog-close {
    background: #294235;
    color: #e1eee7;
}
body.app-page[data-theme=dark] input::placeholder,
body.app-page[data-theme=dark] textarea::placeholder { color: #879b8e; }
body.app-page[data-theme=dark] th { border-color: var(--line); background: #22352a; color: #a5b7ac; }
body.app-page[data-theme=dark] td,
body.app-page[data-theme=dark] .journal-item,
body.app-page[data-theme=dark] .location-item,
body.app-page[data-theme=dark] .review-form { border-color: var(--line); }
body.app-page[data-theme=dark] .location-pin,
body.app-page[data-theme=dark] .avatar,
body.app-page[data-theme=dark] .avatar-green { background: #294235; color: #a5e0b8; }
body.app-page[data-theme=dark] .hero-strip { background: #22392c; }
body.app-page[data-theme=dark] .class-banner p,
body.app-page[data-theme=dark] .attendance-copy p,
body.app-page[data-theme=dark] .review-activity,
body.app-page[data-theme=dark] .journal-item > p { color: #b0c1b6; }
body.app-page[data-theme=dark] .form-guide { color: #c1d6c7; }
body.app-page[data-theme=dark] .form-guide strong { color: #a5e0b8; }
body.app-page[data-theme=dark] .sidebar-bottom .profile-mini { border-color: var(--line); }
body.app-page[data-theme=dark] .button-outline,
body.app-page[data-theme=dark] .button-logout { border-color: #40564a; background: #24382c; color: #c3d6c9; }
body.app-page[data-theme=dark] .button-outline:hover,
body.app-page[data-theme=dark] .button-logout:hover { border-color: #648d70; background: #2d4836; }

@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes confirm-dialog-enter { from { opacity: 0; transform: translateY(7px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1080px) {
    .sidebar { width: 218px; }
    .main-area { margin-left: 218px; }
    .content-wrap { padding-right: 25px; padding-left: 25px; }
    .topbar { padding-right: 25px; padding-left: 25px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace-grid, .logbook-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
@media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { min-height: 100vh; align-items: start; padding: 30px 23px; }
    .auth-form-wrap { padding-top: 8vh; }
    .brand-mobile { display: inline-flex; margin-bottom: 42px; }
    .auth-heading h2 { font-size: 26px; }
    .sidebar { width: 254px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 12px 0 30px rgba(25, 53, 46, .08); }
    .sidebar.is-open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .topbar { height: 57px; padding: 0 17px; }
    .menu-toggle { display: grid !important; width: 31px; height: 31px; margin-right: 10px; font-size: 15px; }
    .breadcrumb { margin-right: auto; font-size: 10px; }
    .topbar-right { gap: 8px; }
    .topbar-date, .topbar-divider { display: none; }
    .content-wrap { padding: 24px 17px 19px; }
    .welcome-row { align-items: start; margin-bottom: 18px; }
    .welcome-row h1 { font-size: 21px; }
    .clock-block { padding-top: 6px; }
    .clock-block > span { max-width: 112px; text-align: right; }
    .hero-strip { min-height: 226px; padding: 24px; }
    .hero-strip h2 { max-width: 255px; font-size: 22px; }
    .hero-strip p { max-width: 235px; font-size: 10px; line-height: 1.5; }
    .hero-illustration { right: -20%; width: 62%; opacity: .68; }
    .hero-chart { right: 5px; }
    .hero-tag { right: 20px; }
    .stat-grid { gap: 9px; margin-bottom: 24px; }
    .stat-card { min-height: 78px; gap: 9px; padding: 11px; }
    .stat-icon { width: 31px; height: 31px; flex-basis: 31px; font-size: 14px; }
    .stat-card p { max-width: 115px; font-size: 9px; line-height: 1.35; }
    .stat-card strong { font-size: 18px; }
    .stat-mark { top: 9px; right: 9px; }
    .workspace-grid, .logbook-grid { grid-template-columns: 1fr; }
    .settings-panel { min-height: 100px; gap: 16px; padding: 17px; }
    .attendance-panel { align-items: flex-start; flex-direction: column; }
    .attendance-panel form[data-geolocation-form] { width: 100%; justify-items: stretch; text-align: left; }
    .attendance-camera { width: 100%; max-width: none; }
    .attendance-camera-dialog { padding: 14px; }
    .attendance-camera-overlay { padding: 12px; }
    .attendance-camera-actions { justify-content: flex-start; }
    .attendance-camera-actions .button { flex: 1 1 auto; }
    .review-card { grid-template-columns: 1fr; gap: 14px; }
    .review-form { padding: 13px 0 0; border-top: 1px solid #edf1ee; border-left: 0; }
    .grade-row { grid-template-columns: 1fr 53px; gap: 9px 13px; padding: 14px; }
    .grade-date { grid-column: 1 / -1; }
    .grade-detail { grid-column: 1; }
    .grade-score { grid-column: 2; grid-row: 2; }
    .app-footer { font-size: 8px; }
}
@media (max-width: 440px) {
    .auth-main { padding-right: 20px; padding-left: 20px; }
    .auth-form-wrap { padding-top: 4vh; }
    .brand-mobile { margin-bottom: 32px; }
    .welcome-row { gap: 8px; }
    .welcome-row h1 { font-size: 19px; }
    .welcome-row .muted { max-width: 190px; font-size: 10px; line-height: 1.5; }
    .clock-block { font-size: 9px; }
    .clock-block strong { font-size: 14px; }
    .hero-illustration { right: -38%; width: 71%; opacity: .48; }
    .hero-strip { padding: 20px; }
    .hero-strip h2 { max-width: 220px; font-size: 20px; }
    .hero-strip p { max-width: 210px; }
    .class-banner { padding: 16px; }
    .class-banner h2 { font-size: 16px; }
    .code-chip { padding: 0 7px; font-size: 9px; }
    .section-heading h2 { font-size: 14px; }
    .form-row { grid-template-columns: 1fr; }
    .list-panel, .form-panel { padding: 15px; }
    .app-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}