@font-face {
    font-family: Manrope;
    src: url("assets/manrope-regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: Manrope;
    src: url("assets/manrope-bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
:root {
    color-scheme: light;
    --bg: #f4f6fa;
    --surface: #fff;
    --raised: #eaf0f8;
    --field: #f5f7fb;
    --ink: #16243a;
    --muted: #56667a;
    --line: #dce4ef;
    --green: #226354;
    --focus: #247d6b;
    --control-accent: #22785f;
    --control-accent-hover: #1a6451;
    --control-off: #8392a5;
    --on-solid: #fff;
    --hero: #1c344e;
    --hero-end: #13253d;
    --mint: #20634e;
    --mint-soft: #e5f5ee;
    --mint-line: #b8dccb;
    --blue: #3e5792;
    --blue-soft: #edf2ff;
    --blue-line: #c9d6f4;
    --violet: #714891;
    --violet-soft: #f3edfb;
    --violet-line: #decef0;
    --cyan: #206277;
    --cyan-soft: #e8f4f9;
    --cyan-line: #bfdae7;
    --warning: #79511d;
    --warning-soft: #fff3df;
    --warning-line: #eddbbc;
    --danger: #a13e37;
    --danger-soft: #fff0eb;
    --danger-line: #efc7be;
    --surface-shadow: 0 3px 18px #13253d08;
    --board-ink: #17374f;
    --board-muted: #3a556b;
    --board-wash: linear-gradient(105deg, #e4f5f3f5, #deecf7b8);
    --sidebar-width: 238px;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #080f1c;
    --surface: #111d2c;
    --raised: #1d2a3e;
    --field: #0d1828;
    --ink: #f1f5fc;
    --muted: #afbed1;
    --line: #2d3c50;
    --green: #a1e8d3;
    --focus: #87d6bd;
    --control-off: #526278;
    --hero: #254764;
    --hero-end: #142d48;
    --mint: #a1e8d3;
    --mint-soft: #193a35;
    --mint-line: #326154;
    --blue: #c1d3ff;
    --blue-soft: #233451;
    --blue-line: #415782;
    --violet: #dfc8f6;
    --violet-soft: #342848;
    --violet-line: #574369;
    --cyan: #a3deed;
    --cyan-soft: #163744;
    --cyan-line: #305a6d;
    --warning: #f5d7a6;
    --warning-soft: #3b2d23;
    --warning-line: #67503b;
    --danger: #ffc5b8;
    --danger-soft: #3e2529;
    --danger-line: #67404a;
    --surface-shadow: 0 3px 20px #0002;
    --board-ink: #f3f7fd;
    --board-muted: #c3d2e6;
    --board-wash: linear-gradient(110deg, #0c192ce8, #0c192cc4);
}
body {
    font-family: Manrope, system-ui, sans-serif;
}
button.primary {
    background: linear-gradient(135deg, var(--hero), var(--hero-end));
    border-color: transparent;
    color: var(--on-solid);
    font-weight: 700;
}
button.primary:not(:disabled):hover {
    background: var(--hero);
    border-color: var(--hero);
}
button:disabled {
    opacity: 0.64;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline-color: var(--focus);
}
input:not([type="checkbox"], [type="radio"], [type="file"]),
select,
textarea {
    background: var(--field);
    border-color: var(--line);
    border-radius: 10px;
}
input::placeholder,
textarea::placeholder {
    color: var(--muted);
}
dialog {
    background: var(--surface);
    color: var(--ink);
    border-radius: 18px;
}
dialog::backdrop {
    background: #080f1c99;
}
.kuantum-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.surface-icon:has(.kuantum-icon),
.summary-icon:has(.kuantum-icon),
.upload-glyph:has(.kuantum-icon) {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.theme-toggle {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
}
.theme-toggle .theme-sun,
:root[data-theme="dark"] .theme-toggle .theme-moon,
.logo-dark,
.sidebar-mark {
    display: none;
}
:root[data-theme="dark"] .theme-toggle .theme-sun {
    display: inline-flex;
}
:root[data-theme="dark"] .logo-light {
    display: none;
}
:root[data-theme="dark"] .logo-dark {
    display: block;
}
#workspace > aside {
    padding: 18px 12px 14px;
    background: var(--surface);
}
#workspace > aside .sidebar-brand {
    min-height: 58px;
    padding: 4px 10px 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.sidebar-logo {
    width: 168px;
    max-width: 100%;
    height: auto;
}
aside nav button {
    min-height: 39px;
    padding: 7px 10px;
    border-radius: 10px;
    color: var(--muted);
}
aside nav button .ui-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
}
aside nav button.active,
aside nav button.active:hover:not(:disabled) {
    background: var(--mint-soft);
    color: var(--mint);
}
aside nav button.active::before {
    background: var(--focus);
}
.nav-label {
    color: var(--muted);
    font-size: 10px;
    margin: 15px 10px 5px;
}
.nav-group:not(:has(button:not(.hidden))) {
    display: none;
}
#workspace.nav-collapsed aside .sidebar-brand {
    padding-inline: 4px;
}
@media (min-width: 901px) {
    #workspace.nav-collapsed .sidebar-logo {
        display: none;
    }
    #workspace.nav-collapsed .sidebar-mark {
        display: block;
    }
}
#workspace > main > header {
    background: color-mix(in srgb, var(--surface) 93%, transparent);
}
.breadcrumb,
.profile,
.workspace-search {
    font-size: 12px;
}
.breadcrumb strong {
    font-weight: 700;
    margin-left: 0;
}
.workspace-search,
.workspace-tab button.tab-close {
    color: var(--muted);
}
.workspace-search {
    border-radius: 11px;
}
.profile select {
    background: var(--field);
}
.workspace-tabs {
    align-items: center;
    padding-top: 5px;
    padding-bottom: 5px;
    background: var(--surface);
}
.workspace-tab {
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
}
.workspace-tab.selected {
    background: var(--raised);
    border-color: var(--line);
    color: var(--ink);
}
.workspace-tab.selected::after {
    content: none;
}
.connection {
    color: var(--muted);
}
.heading h1 {
    font-size: clamp(24px, 2.1vw, 31px);
    line-height: 1.23;
    letter-spacing: -0.85px;
}
.heading p {
    font-size: 13px;
}
.heading .actions button,
.heading > button {
    min-height: 36px;
    font-size: 12px;
    border-radius: 10px;
}
.card,
.surface,
.entity-card,
.resource-card {
    box-shadow: var(--surface-shadow);
}
.entity-card,
.resource-card {
    border-radius: 17px;
}
.entity-card-title strong,
.resource-card-body h3 {
    color: var(--ink);
}
.entity-fields dt {
    text-transform: none;
    font-size: 11px;
    letter-spacing: 0;
}
.entity-fields dd {
    color: var(--ink);
}
.entity-card-actions button:not([role="switch"]) {
    border-radius: 9px;
    min-height: 32px;
}
.collection-shell {
    box-shadow: none;
}
#program .stat {
    display: grid;
    justify-items: start;
    align-content: start;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--surface-shadow);
}
#program .stat[data-metric="lessons"] {
    background:
        var(--board-wash),
        url("assets/lesson-cloud.webp") center right / cover,
        var(--raised);
}
#program .stat[data-metric="lessons"] strong {
    color: var(--board-ink);
}
#program .stat[data-metric="lessons"] small {
    color: var(--board-muted);
}
#program .stat[data-metric="module"] {
    background: linear-gradient(130deg, var(--surface), var(--mint-soft));
}
#program .stat strong {
    margin: 4px 0;
    font-size: 27px;
    line-height: 1.15;
}
#program #moduleMode {
    font-size: 20px;
    padding: 3px 0;
    overflow-wrap: anywhere;
}
#program .stat small:first-of-type {
    font-weight: 700;
}
#program .stat .surface-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}
#program .cal-day.is-today {
    background: var(--mint-soft);
}
#program .cal-column.is-today {
    background-color: color-mix(in srgb, var(--mint-soft) 32%, var(--surface));
}
.cal-lesson {
    border-left-color: var(--mint);
}
.cal-lesson.tone-1 {
    border-left-color: var(--blue);
}
.cal-lesson.tone-2 {
    border-left-color: var(--violet);
}
.cal-lesson.tone-3 {
    border-left-color: var(--warning);
}
.cal-lesson.tone-4 {
    border-left-color: var(--cyan);
}
.cal-lesson:hover:not(:disabled) {
    background: color-mix(in srgb, currentColor 12%, var(--surface));
}
.segmented {
    border-radius: 10px;
}
.segmented button {
    border-radius: 7px;
    min-height: 28px;
    font-size: 11px;
}
.resource-file-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
}
.upload-dropzone {
    background:
        var(--board-wash),
        url("assets/study-orbit.webp") center / cover,
        var(--raised);
    color: var(--board-ink);
    border-color: var(--mint-line);
    border-radius: 17px;
}
.upload-dropzone h3 {
    color: var(--board-ink);
}
.upload-dropzone p {
    color: var(--board-muted);
}
.upload-dropzone.drag-over {
    background: var(--mint-soft);
    color: var(--ink);
    border-color: var(--focus);
}
.upload-dropzone.drag-over :is(h3, p) {
    color: var(--ink);
}
#loginView {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(18px, 4vw, 60px);
    gap: clamp(24px, 5vw, 78px);
    align-items: center;
    justify-content: center;
    grid-template-columns: minmax(0, 660px) minmax(300px, 440px);
    background: var(--bg);
}
.login-story {
    display: flex;
    flex-direction: column;
    min-height: 580px;
    justify-content: space-between;
    padding: clamp(32px, 5vw, 64px);
    border: 0;
    border-radius: 28px;
    background:
        linear-gradient(110deg, #10243cf5 10%, #10243cdd 47%, #142d4894),
        url("assets/lesson-cloud.webp") 71% center / cover,
        #13253d;
    color: #f3f7fd;
    box-shadow: var(--surface-shadow);
}
.login-story .brand {
    padding: 0;
}
.login-logo {
    width: min(252px, 100%);
    height: auto;
}
.login-copy h1 {
    font-size: clamp(34px, 4vw, 58px);
    letter-spacing: -0.055em;
    margin: 0 0 12px;
    max-width: none;
}
.login-copy p {
    color: #e2edf9;
    font-size: 14px;
    max-width: 28ch;
}
.login-feature-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 20px;
}
.login-feature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #10243cd9;
    border: 1px solid #c3d2e64d;
    border-radius: 13px;
    padding: 12px;
    gap: 8px;
}
.login-feature .surface-icon {
    flex-basis: auto;
}
.login-feature strong {
    font-size: 12px;
    color: #f3f7fd;
}
.login-form {
    width: 100%;
    min-width: 0;
    padding: clamp(24px, 4vw, 42px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--surface-shadow);
}
.login-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.login-form .login-form-head h2 {
    margin: 0;
    font-size: 25px;
}
.login-form .theme-toggle {
    width: 36px;
    height: 36px;
}
.login-form > p {
    margin-bottom: 22px;
}
.login-form label,
.login-form input {
    font-size: 13px;
}
.login-form input {
    width: 100%;
    min-height: 44px;
    margin-bottom: 8px;
}
.login-form .primary {
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    border-radius: 11px;
}
.login-form .footnote {
    font-size: 11px;
    margin-bottom: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
@media (max-width: 850px) {
    #loginView {
        grid-template-columns: minmax(0, 530px);
        align-content: center;
        gap: 16px;
    }
    .login-story {
        min-height: 0;
        padding: 25px;
        gap: 22px;
    }
    .login-feature-cards {
        display: none;
    }
    .login-logo {
        width: min(200px, 100%);
    }
    .login-copy h1 {
        font-size: 27px;
    }
    .login-copy p {
        max-width: 42ch;
        font-size: 13px;
    }
}
@media (max-width: 600px) {
    .breadcrumb strong {
        max-width: 22vw;
    }
    .workspace-search {
        margin-left: auto;
    }
    .profile {
        font-size: 11px;
    }
    .profile .theme-toggle {
        width: 30px;
        height: 30px;
    }
    #program .stat {
        padding: 10px;
    }
    #program .stat .surface-icon {
        width: 30px;
        height: 30px;
    }
    #program .stat strong {
        font-size: 21px;
    }
    #program #moduleMode {
        font-size: 15px;
    }
    #program .stat small {
        font-size: 10px;
    }
}

.student-record-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
}
.student-record-fields {
    min-width: 0;
    margin: 0;
    padding: 16px;
}
.student-record-fields legend {
    padding-inline: 6px;
    font-size: 13px;
    font-weight: 700;
}
.student-record-fields .form-grid,
.student-contact-card .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}
.student-record-fields :is(input:not([type="checkbox"]), select, textarea) {
    display: block;
    width: 100%;
    margin-top: 6px;
}
.student-contacts-fields {
    grid-column: 1 / -1;
}
.student-contacts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 12px;
}
.student-contact-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    padding: 12px;
}
.student-contact-head,
.student-record-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.student-record-footer,
#studentAddContact,
.student-group-options,
#studentPortalIssue,
#studentPortalResult {
    margin-top: 12px;
}
.student-group-options {
    max-height: 200px;
    overflow: auto;
}
.student-group-options label {
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 8px 0;
    margin: 0;
}
.student-record-tabs {
    max-width: 100%;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.student-record [data-student-pane] > .entity-grid {
    padding-top: 8px;
}
.student-record .student-history {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}
.student-record .student-history summary {
    cursor: pointer;
}
.student-record .invitation-token {
    display: block;
    overflow-wrap: anywhere;
    padding: 10px;
    background: var(--field);
    border-radius: 8px;
    margin: 8px 0;
}
@media (max-width: 700px) {
    .student-record-grid,
    .student-record-fields .form-grid,
    .student-contact-card .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
