:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f6f8;
    color: #1d2433;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f6f8; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid #e3e6eb; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #222a38; color: #fff; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { color: #687184; margin-top: 2px; }
.nav-link { color: #4d586d; text-decoration: none; font-weight: 650; }
.nav-link:hover { text-decoration: underline; }
.account-chip { padding: 7px 10px; border-radius: 999px; background: #edf0f5; font-size: .875rem; }
.page-shell { padding: 40px 0 64px; }
.site-footer { padding: 24px 0 40px; color: #727b8e; font-size: .875rem; }
.card { background: #fff; border: 1px solid #e3e6eb; border-radius: 18px; padding: clamp(24px, 4vw, 44px); box-shadow: 0 16px 40px rgba(29,36,51,.05); }
.hero { max-width: 920px; }
.auth-shell { max-width: 580px; margin: 0 auto; }
h1 { margin: 6px 0 14px; line-height: 1.1; font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { margin: 0 0 12px; }
p { line-height: 1.65; }
.lead { font-size: 1.08rem; color: #596377; max-width: 760px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; color: #677186; }
.notice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 28px; }
.notice-grid > div { padding: 18px; background: #f7f8fa; border: 1px solid #e5e8ed; border-radius: 14px; }
.notice-grid strong, .notice-grid span { display: block; }
.notice-grid span { color: #687184; margin-top: 5px; line-height: 1.45; }
.stack > * + * { margin-top: 28px; }
.stack-sm > * + * { margin-top: 14px; }
.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid transparent; margin-bottom: 18px; }
.alert-success { background: #edf8f1; border-color: #cde9d5; }
.alert-error { background: #fff0f0; border-color: #f0caca; }
.alert-warning { background: #fff8e9; border-color: #f0dfb5; }
.alert-info { background: #eef4fb; border-color: #cfdeee; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: #222a38; color: #fff; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
.button:hover { filter: brightness(.95); }
.button-secondary { background: #e9edf3; color: #222a38; }
.button-sm { min-height: 36px; padding: 0 13px; font-size: .9rem; }
.inline-form { display: inline-flex; margin: 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #9da5b4; }
.status-ok { background: #23864f; }
.status-bad { background: #c34646; }
.muted { color: #727b8e; }
.small-text { font-size: .9rem; }
.error-page { max-width: 720px; }
label { display: grid; gap: 7px; font-weight: 700; color: #30394a; }
label span small { font-weight: 500; color: #7a8395; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cfd5df; border-radius: 10px; padding: 10px 12px; color: #1d2433; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(68, 101, 154, .13); border-color: #6e82a5; }
.otp-input { letter-spacing: .35em; font-size: 1.3rem; font-weight: 800; text-align: center; }
.field-error { color: #b63838; font-weight: 650; line-height: 1.35; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .95rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
@media (max-width: 760px) {
    .header-inner { align-items: flex-start; padding: 14px 0; }
    .header-actions { justify-content: flex-end; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
}
@media (max-width: 600px) {
    .container { width: min(100% - 22px, 1120px); }
    .page-shell { padding-top: 24px; }
    .header-inner { display: grid; }
    .header-actions { justify-content: flex-start; }
}

/* Phase 4 student-management components */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.compact { margin-top: 0; }
.compact-card { padding: 24px; }
.auth-wide { max-width: 860px; margin: 0 auto; }
.filter-grid { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(190px, 1fr) auto; gap: 14px; align-items: end; }
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.report-links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 700; }
.report-links a, .text-action { color: #334f79; text-decoration: none; }
.report-links a:hover, .text-action:hover { text-decoration: underline; }
.table-card { padding: 0; overflow: hidden; }
.table-heading { padding: 18px 22px; border-bottom: 1px solid #e3e6eb; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid #e8ebef; }
th { background: #f8f9fb; color: #596377; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 28px; text-align: center; color: #727b8e; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge-ok { background: #e8f6ed; color: #176a3a; }
.badge-bad { background: #ffe9e9; color: #a12f2f; }
.badge-warning { background: #fff3d6; color: #7d5912; }
.badge-muted { background: #edf0f5; color: #596377; }
.button-danger { background: #a53b3b; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(0, 1.3fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid #edf0f3; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: #727b8e; font-weight: 700; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.inline-action-form { display: flex; gap: 12px; align-items: end; }
.inline-action-form .grow { flex: 1; }
.check-row { display: flex; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 650; }
.check-row input { width: auto; min-height: 0; }
.code-block { display: block; padding: 14px 16px; border-radius: 10px; background: #1f2633; color: #f5f7fa; overflow-x: auto; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.metric-grid > div { border: 1px solid #e3e6eb; background: #f8f9fb; border-radius: 12px; padding: 14px; }
.metric-grid strong, .metric-grid span { display: block; }
.metric-grid strong { font-size: 1.5rem; }
.metric-grid span { color: #727b8e; font-size: .85rem; margin-top: 3px; }
textarea { resize: vertical; }
@media (max-width: 860px) {
    .page-heading { display: grid; }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .inline-action-form { display: grid; }
}


/* Phase 5 mentor-management components */
.clean-list { margin: 0; padding-left: 1.25rem; display: grid; gap: 9px; }
.auth-card { max-width: 620px; margin: 0 auto; }

/* Phase 7 presentation-series components */
.lifecycle-list { margin: 0; padding-left: 1.35rem; display: grid; gap: 7px; color: #727b8e; }
.lifecycle-list li.current { color: #1d2433; font-weight: 800; }
.lifecycle-list li.current::marker { color: #23864f; }

/* Phase 8 schedule-builder components */
.link-button { border: 0; padding: 0; background: transparent; font: inherit; font-weight: 700; color: #334f79; cursor: pointer; text-decoration: none; }
.link-button:hover { text-decoration: underline; }
.danger-text { color: #a12f2f; }
.schedule-grid th:first-child { min-width: 78px; }
.schedule-grid td { min-width: 155px; }
.schedule-event { display: grid; gap: 4px; padding: 9px 10px; margin: 2px 0; border-radius: 9px; background: #eef4fb; border: 1px solid #cfdeee; }
.schedule-event span { font-size: .82rem; color: #596377; }
.schedule-break { background: #fff3d6; border-color: #f0dfb5; }
.schedule-inactive { opacity: .55; background: #edf0f5; border-color: #dfe3e9; }
@media print {
    .site-header, .site-footer, .print-hide, .alert { display: none !important; }
    body { background: #fff; }
    .container { width: 100%; max-width: none; }
    .page-shell { padding: 0; }
    .card { box-shadow: none; border-radius: 0; break-inside: avoid; }
    .print-schedule .card { margin-top: 18px; }
}
.week-heading { padding: 12px 22px; background: #f8f9fb; border-top: 1px solid #e3e6eb; border-bottom: 1px solid #e3e6eb; font-weight: 800; color: #4d586d; }

/* Project Phoenix sidebar navigation */
:root {
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 82px;
    --sidebar-copper: #ff6542;
    --sidebar-copper-dark: #ff6542;
    --sidebar-copper-light: #eac435;
}

.app-layout { min-height: 100vh; }
.site-sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    overflow-x: hidden;
    color: #1d2433;
    background: var(--sidebar-copper);
    box-shadow: 3px 0 8px rgba(29, 36, 51, .12), 10px 0 30px rgba(29, 36, 51, .16);
    transition: width .22s ease, transform .22s ease;
}
.sidebar-top { display: flex; align-items: flex-start; min-height: 122px; padding: 20px 16px 16px; border-bottom: 1px solid rgba(29, 36, 51, .18); }
.sidebar-brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; color: #1d2433; text-decoration: none; }
.sidebar-logo { width: 58px; height: 58px; flex: 0 0 58px; object-fit: contain; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-text strong, .sidebar-brand-text small { display: block; }
.sidebar-brand-text strong { font-size: 1.08rem; line-height: 1.2; }
.sidebar-brand-text small { margin-top: 4px; color: rgba(29, 36, 51, .74); font-size: .76rem; line-height: 1.3; }
.sidebar-collapse-toggle {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    margin: 2px -1px 0 6px;
    border: 1px solid rgba(29, 36, 51, .28);
    border-radius: 8px;
    color: #1d2433;
    background: rgba(245, 245, 245, .32);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.sidebar-collapse-toggle:hover { background: rgba(234, 196, 53, .74); }
.sidebar-navigation { flex: 1; overflow-y: auto; padding: 15px 11px 24px; }
.sidebar-nav-group + .sidebar-nav-group { margin-top: 21px; }
.sidebar-nav-label { display: block; padding: 0 11px 8px; color: rgba(29, 36, 51, .67); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.sidebar-nav-link, .sidebar-signout {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    color: #1d2433;
    background: transparent;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.sidebar-nav-link:hover, .sidebar-nav-link:focus-visible, .sidebar-signout:hover, .sidebar-signout:focus-visible { background: rgba(234, 196, 53, .76); outline: 0; }
.sidebar-footer { padding: 12px 11px 16px; border-top: 1px solid rgba(29, 36, 51, .18); }
.sidebar-footer .account-chip { display: inline-flex; margin: 8px 11px 4px; color: #1d2433; background: #f5f5f5; }
.sidebar-signout-form { margin: 0; }
.site-content { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .22s ease; }
.site-content .page-shell { padding-top: 40px; }
.site-footer { padding-top: 24px; }
.sidebar-mobile-toggle, .sidebar-backdrop { display: none; }

.sidebar-collapsed .site-sidebar { width: var(--sidebar-collapsed-width); }
.sidebar-collapsed .site-content { margin-left: var(--sidebar-collapsed-width); }
.sidebar-collapsed .sidebar-top { min-height: 100px; justify-content: center; padding: 18px 8px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; flex: 0 1 auto; }
.sidebar-collapsed .sidebar-logo { width: 47px; height: 47px; flex-basis: 47px; }
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-nav-label,
.sidebar-collapsed .sidebar-nav-link span,
.sidebar-collapsed .sidebar-signout span,
.sidebar-collapsed .account-chip { display: none; }
.sidebar-collapsed .sidebar-collapse-toggle { position: absolute; right: 8px; bottom: 8px; margin: 0; transform: rotate(180deg); }
.sidebar-collapsed .sidebar-navigation, .sidebar-collapsed .sidebar-footer { padding-right: 8px; padding-left: 8px; }
.sidebar-collapsed .sidebar-nav-group + .sidebar-nav-group { margin-top: 10px; }
.sidebar-collapsed .sidebar-nav-link, .sidebar-collapsed .sidebar-signout { justify-content: center; min-height: 36px; padding: 7px; }

@media (max-width: 860px) {
    .site-sidebar { width: min(280px, calc(100vw - 44px)); transform: translateX(-100%); }
    .site-content, .sidebar-collapsed .site-content { margin-left: 0; }
    .sidebar-collapsed .site-sidebar { width: min(280px, calc(100vw - 44px)); }
    .sidebar-collapsed .sidebar-top { min-height: 122px; justify-content: initial; padding: 20px 16px 16px; }
    .sidebar-collapsed .sidebar-brand { justify-content: initial; flex: 1; }
    .sidebar-collapsed .sidebar-logo { width: 58px; height: 58px; flex-basis: 58px; }
    .sidebar-collapsed .sidebar-brand-text,
    .sidebar-collapsed .sidebar-nav-label,
    .sidebar-collapsed .sidebar-nav-link span,
    .sidebar-collapsed .sidebar-signout span,
    .sidebar-collapsed .account-chip { display: revert; }
    .sidebar-collapsed .sidebar-collapse-toggle { position: static; right: auto; bottom: auto; margin: 2px -1px 0 6px; transform: none; }
    .sidebar-collapsed .sidebar-navigation, .sidebar-collapsed .sidebar-footer { padding-right: 11px; padding-left: 11px; }
    .sidebar-collapsed .sidebar-nav-group + .sidebar-nav-group { margin-top: 21px; }
    .sidebar-collapsed .sidebar-nav-link, .sidebar-collapsed .sidebar-signout { justify-content: initial; min-height: 40px; padding: 9px 11px; }
    .sidebar-mobile-toggle {
        position: fixed;
        z-index: 20;
        top: 12px;
        left: 12px;
        display: grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 0;
        border-radius: 10px;
        color: #1d2433;
        background: var(--sidebar-copper);
        box-shadow: 0 4px 12px rgba(62, 31, 13, .2);
        font-size: 1.35rem;
        cursor: pointer;
    }
    .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(29, 36, 51, .46); }
    .sidebar-mobile-open .site-sidebar { transform: translateX(0); }
    .sidebar-mobile-open .sidebar-backdrop { display: block; }
    .site-content .page-shell { padding-top: 76px; }
}

@media print {
    .site-sidebar, .sidebar-mobile-toggle, .sidebar-backdrop { display: none !important; }
    .site-content { margin-left: 0 !important; }
}

/* Approved Project Phoenix palette */
:root { background: #f5f5f5; }
body { background: #f5f5f5; }
.site-header { background: #f5f5f5; border-color: #d7dbdc; }
.brand-mark, .button { color: #1d2433; background: #ff6542; }
.button-secondary { color: #1d2433; background: #dfe2e3; }
.button-danger { color: #fff; background: #a53b3b; }
.nav-link, .week-heading { color: #596367; }
.brand small, .muted, .site-footer, .detail-list dt, .metric-grid span, .empty-cell { color: #818d92; }
.eyebrow { color: #596367; }
.report-links a, .text-action, .link-button { color: #596367; }
.report-links a:hover, .text-action:hover, .link-button:hover { color: #ff6542; }
.account-chip, .badge-muted { color: #596367; background: #e3e6e7; }
.card, .table-card, .metric-grid > div { border-color: #d7dbdc; }
.table-heading, th, .week-heading { background: #f5f5f5; border-color: #d7dbdc; }
th { color: #596367; }
th, td { border-color: #e0e3e3; }
.notice-grid > div { background: #f5f5f5; border-color: #d7dbdc; }
.notice-grid span, .schedule-event span { color: #818d92; }
.schedule-event { background: #fff9df; border-color: #eac435; }
.schedule-break, .badge-warning { background: #fff3d6; border-color: #eac435; }
input:focus, select:focus, textarea:focus { outline-color: rgba(234, 196, 53, .32); border-color: #eac435; }

/* Booking-window scheduling and historical reconstruction */
.booking-countdown {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid #eac435;
    border-radius: 10px;
    background: #fff9df;
}
.booking-countdown span { color: #596367; font-size: .86rem; }
.booking-countdown strong { color: #1d2433; font-size: 1.05rem; }
.booking-countdown-prominent { padding: 16px 18px; }
.booking-countdown-prominent strong { font-size: 1.2rem; }
.booking-countdown-compact { margin-top: 8px; padding: 8px 10px; }
.booking-countdown-compact span, .booking-countdown-compact strong { font-size: .78rem; }
.historical-team-select { width: 100%; min-width: 160px; }
.historical-team-select-duplicate { border-color: #a53b3b !important; outline-color: rgba(165, 59, 59, .22) !important; }
.historical-assignment-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.historical-assignment-summary strong { font-size: 1.05rem; }
.historical-duplicate-warning { color: #a12f2f; font-weight: 700; }
@media (max-width: 860px) {
    .booking-countdown { min-width: 220px; }
    .historical-team-select { min-width: 150px; }
}
