:root {
    --bg: #f6f7f4;
    --panel: #ffffff;
    --ink: #18201d;
    --muted: #64706a;
    --line: #dfe5dd;
    --green: #1f7a4d;
    --teal: #1d6f73;
    --amber: #b76621;
    --red: #a94034;
    --shadow: 0 18px 45px rgba(23, 35, 31, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.login-shell {
    width: min(440px, calc(100vw - 32px));
}

.login-panel h1 {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #17231f;
    color: #f8fbf6;
    padding: 24px;
    overflow-y: auto;
}

.logout-form {
    margin-top: 24px;
}

.logout-form button {
    width: 100%;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 34px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f1c65b;
    color: #17231f;
    font-weight: 800;
}

.brand small,
.eyebrow,
.section-title p,
.option-head p,
small {
    color: var(--muted);
}

.sidebar .brand small {
    color: #b9c8c1;
    display: block;
}

nav {
    display: grid;
    gap: 20px;
}

.nav-group {
    display: grid;
    gap: 6px;
}

.nav-group span {
    color: #91a49b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    padding: 0 14px;
    text-transform: uppercase;
}

nav a {
    border-radius: 8px;
    color: #dce7e1;
    padding: 9px 14px;
}

nav a.active,
nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.main {
    margin-left: 260px;
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.page-description {
    color: var(--muted);
    margin: 6px 0 0;
    max-width: 860px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.toolbar.left {
    justify-content: flex-start;
    margin: 12px 0 18px;
}

.topbar h1,
.section-title h2,
.panel h2,
.ai-banner h2 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.split {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.split.wide-left {
    grid-template-columns: minmax(420px, 560px) minmax(0, 1fr);
}

.metrics div,
.panel,
.ai-banner {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metrics div {
    padding: 20px;
}

.metrics div.metric-alert {
    border-color: #d98b80;
    background: #fff3f1;
}

.metrics strong {
    display: block;
    font-size: 32px;
}

.metrics span {
    color: var(--muted);
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.action-panel {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.action-panel p {
    color: var(--muted);
    margin-bottom: 0;
}

.feature-grid,
.data-lists {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

.feature-grid h3,
.data-lists h3 {
    margin-bottom: 8px;
}

.feature-grid p,
.data-lists p {
    color: var(--muted);
    line-height: 1.55;
}

.data-lists small {
    display: block;
}

.grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tabbar a {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #40514a;
    font-weight: 800;
    padding: 10px 13px;
}

.tabbar a.active,
.tabbar a:hover {
    background: var(--green);
    border-color: var(--green);
    color: #ffffff;
}

.wide {
    grid-column: 1 / -1;
}

.form {
    display: grid;
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.filter-panel {
    align-items: end;
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #35423d;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 11px 16px;
}

.button-link {
    border-radius: 8px;
    display: inline-block;
    font-weight: 800;
    padding: 11px 16px;
}

button.secondary {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.button-link.secondary {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
}

button.approve {
    background: var(--amber);
}

button.ghost {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.row-action,
.cancel-link {
    color: var(--green);
    font-weight: 800;
}

.row-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.row-actions form {
    margin: 0;
}

.link-button {
    background: transparent;
    color: var(--red);
    padding: 0;
}

.cancel-link {
    display: inline-block;
}

.notice {
    background: #e8f5ec;
    border: 1px solid #b8dec4;
    border-radius: 8px;
    color: #185c38;
    margin-bottom: 18px;
    padding: 13px 16px;
}

.availability {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.check {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    margin: 4px 12px 6px 0;
}

.check input {
    width: auto;
}

.ai-banner {
    align-items: center;
    background: #17342e;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 24px;
}

.ai-banner p {
    color: #d7e7df;
    margin-bottom: 0;
}

.ai-banner strong {
    color: #f1c65b;
    font-size: 36px;
    white-space: nowrap;
}

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

.option-head strong {
    color: var(--green);
    font-size: 28px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.score-grid span {
    background: #f2f5f0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #40514a;
    padding: 10px;
}

.status-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.status-pill.good {
    background: #e8f5ec;
    color: #185c38;
}

.status-pill.bad {
    background: #fff3f1;
    color: var(--red);
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap.compact table {
    min-width: 620px;
}

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

th,
td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8faf7;
    position: sticky;
    top: 0;
    z-index: 1;
}

.class-chip {
    background: #eef7f4;
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    margin-bottom: 8px;
    min-width: 150px;
    padding: 9px;
}

.date-focus {
    align-items: center;
    background: #f8faf7;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    padding: 16px;
}

.date-focus h3 {
    margin: 0;
}

.date-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.date-form input {
    min-width: 170px;
}

.focused-schedule {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    max-height: 520px;
    overflow: auto;
}

.weekly-overview {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 14px;
}

.weekly-overview summary {
    background: #f8faf7;
    cursor: pointer;
    font-weight: 800;
    padding: 14px 16px;
}

.weekly-overview[open] summary {
    border-bottom: 1px solid var(--line);
}

.day-schedule-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
}

.day-schedule {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.day-schedule h3 {
    background: #f8faf7;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 12px 14px;
}

.day-schedule .table-wrap {
    max-height: 420px;
}

.class-chip span,
.class-chip small {
    display: block;
}

.warning {
    background: #fff7eb;
    border: 1px solid #f1d2a9;
    border-radius: 8px;
    color: #6a3c12;
    margin-top: 16px;
    padding: 14px;
}

.warning p {
    margin: 8px 0 0;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    .metrics,
    .split,
    .split.wide-left,
    .feature-grid,
    .data-lists,
    .grid.two,
    .day-schedule-grid,
    .filter-panel,
    .form-row,
    .score-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .toolbar,
    .action-panel,
    .date-focus,
    .date-form,
    .ai-banner,
    .option-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
