
:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --line: #d9e0ea;
    --text: #152033;
    --muted: #64748b;
    --blue: #2563eb;
    --green: #0f9f6e;
    --orange: #d97706;
    --red: #dc2626;
    --violet: #7c3aed;
    --sidebar: #111827;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: var(--sidebar);
    color: #fff;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand.compact { margin-bottom: 24px; }
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
}
.brand strong { display: block; }
.brand span { display: block; color: #a9b4c5; font-size: 13px; margin-top: 2px; }
nav { display: grid; gap: 6px; }
.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #d7deea;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.nav-link:hover, .nav-link.active { background: #1f2937; color: #fff; }
.nav-link.subtle { color: #a9b4c5; }
.logout-form { margin-top: auto; }
.shell {
    margin-left: 260px;
    padding: 28px;
    max-width: 1480px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.eyebrow {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.15; }
h2 { margin-bottom: 14px; font-size: 18px; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
}
.user-chip strong, .user-chip span { display: block; }
.user-chip span { color: var(--muted); font-size: 13px; }
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--avatar, var(--blue));
    color: #fff;
    font-weight: 800;
    font-size: 13px;
}
.notifications { margin-bottom: 18px; }
.notifications details {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
}
.notifications summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}
.notice-list { display: grid; gap: 8px; margin: 12px 0; }
.notice { border-left: 3px solid var(--line); padding: 8px 10px; background: #f8fafc; }
.notice.unread { border-left-color: var(--blue); }
.notice strong, .notice span { display: block; }
.notice span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.metric, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.metric { padding: 18px; display: grid; gap: 6px; min-height: 124px; }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-size: 26px; line-height: 1.1; }
.metric.small { min-height: 0; margin-bottom: 10px; }
.panel { padding: 18px; margin-bottom: 14px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 14px;
}
.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}
.week-day {
    min-height: 110px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    align-content: start;
    gap: 5px;
    background: #f8fafc;
}
.week-day strong { font-size: 13px; }
.week-day span { font-weight: 700; }
.week-day small { color: var(--muted); }
.week-day.work, .cal-cell.work, .today-status.work { border-color: #b9cdfd; background: #eff5ff; }
.week-day.vacation, .cal-cell.vacation, .today-status.vacation { border-color: #a7f3d0; background: #ecfdf5; }
.week-day.absence, .cal-cell.absence, .today-status.absence { border-color: #fed7aa; background: #fff7ed; }
.week-day.day_off, .cal-cell.day_off, .today-status.day_off { border-color: #d9e0ea; background: #f8fafc; color: #64748b; }
.people-list { display: grid; gap: 10px; }
.person-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.person-row strong, .person-row span { display: block; }
.person-row span { color: var(--muted); font-size: 13px; }
.request-list { display: grid; gap: 10px; }
.request-list.compact { gap: 8px; }
.request-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.request-line strong, .request-line span { display: block; }
.request-line span { color: var(--muted); font-size: 13px; }
.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: #eef2ff;
    color: #3730a3;
}
.status.approved { background: #dcfce7; color: #166534; }
.status.rejected, .status.canceled { background: #fee2e2; color: #991b1b; }
.status.pending_peer { background: #f3e8ff; color: #6b21a8; }
.status.pending_lead { background: #ffedd5; color: #9a3412; }
.button {
    min-height: 38px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.danger { background: #fff; border-color: #fecaca; color: var(--red); }
.button.ghost { background: #f8fafc; }
.button.full { width: 100%; }
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.calendar-toolbar h2 { margin: 0; text-align: center; }
.calendar-toolbar span { display: block; color: var(--muted); text-align: center; margin-top: 3px; }
.inline-filter {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.inline-filter label { min-width: 280px; }
.calendar-weekdays, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}
.calendar-weekdays { color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.calendar-weekdays div { padding: 0 8px; }
.cal-cell {
    min-height: 128px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    display: grid;
    align-content: start;
    gap: 5px;
    overflow: hidden;
}
.cal-cell.muted { background: transparent; border-style: dashed; }
.cal-cell.today { outline: 2px solid var(--blue); outline-offset: 1px; }
.cal-date { color: var(--muted); font-weight: 800; }
.cal-cell strong { font-size: 14px; }
.cal-cell span, .cal-cell small { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.request-forms, .admin-grid, .profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.admin-grid { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); }
.profile-grid { grid-template-columns: minmax(280px, 0.5fr) minmax(280px, 0.5fr); }
.stack-form, .form-grid { display: grid; gap: 10px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
}
textarea { resize: vertical; }
.request-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}
.request-main { display: flex; gap: 12px; min-width: 0; }
.request-main p { margin: 8px 0 0; color: var(--muted); }
.request-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.request-main span, .request-main small { display: block; color: var(--muted); }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.member-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    gap: 12px;
}
.member-top { display: flex; gap: 10px; align-items: center; }
.member-top strong, .member-top span { display: block; }
.member-top span { color: var(--muted); font-size: 13px; }
.member-meta, .member-balance {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.member-meta span, .member-balance span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}
.today-status {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}
.today-status strong, .today-status span { display: block; }
.today-status span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.audit-list { display: grid; gap: 8px; }
.audit-line {
    display: grid;
    grid-template-columns: 140px 1fr 220px;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.audit-line small { color: var(--muted); }
.profile-card { text-align: center; }
.profile-card .avatar { width: 72px; height: 72px; margin: 0 auto 12px; font-size: 22px; }
.empty, .empty-mini { color: var(--muted); }
.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: #eef2f7;
}
.login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}
.login-card h1 { margin-bottom: 18px; }
.login-card form { display: grid; gap: 14px; }
.login-error {
    border: 1px solid #fecaca;
    color: #991b1b;
    background: #fef2f2;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
@media (max-width: 1080px) {
    .metric-grid, .team-grid, .request-forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-col, .admin-grid, .profile-grid { grid-template-columns: 1fr; }
    .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 14px;
        gap: 12px;
    }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shell { margin-left: 0; padding: 14px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .user-chip { width: 100%; }
    .metric-grid, .team-grid, .request-forms, .form-grid { grid-template-columns: 1fr; }
    .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-grid, .calendar-weekdays { gap: 4px; }
    .cal-cell { min-height: 104px; padding: 7px; }
    .cal-cell strong { font-size: 12px; }
    .inline-filter, .calendar-toolbar, .request-card { flex-direction: column; align-items: stretch; }
    .inline-filter label { min-width: 0; }
    .audit-line { grid-template-columns: 1fr; }
}

/* Liquid glass refresh */
:root,
html[data-theme="light"] {
    --bg: #f3f7fb;
    --bg-2: #eef6f1;
    --panel: rgba(255, 255, 255, 0.66);
    --panel-strong: rgba(255, 255, 255, 0.82);
    --sidebar-glass: rgba(255, 255, 255, 0.56);
    --line: rgba(123, 141, 166, 0.26);
    --line-strong: rgba(70, 89, 120, 0.3);
    --text: #142034;
    --muted: #66758a;
    --blue: #0a84ff;
    --green: #17a773;
    --orange: #d97706;
    --red: #dc2626;
    --violet: #8b5cf6;
    --shadow: 0 18px 60px rgba(31, 41, 55, 0.12);
    --shadow-soft: 0 8px 30px rgba(31, 41, 55, 0.08);
    --input: rgba(255, 255, 255, 0.72);
    --hover: rgba(255, 255, 255, 0.84);
}

html[data-theme="dark"] {
    --bg: #0e1219;
    --bg-2: #121a24;
    --panel: rgba(25, 31, 42, 0.58);
    --panel-strong: rgba(31, 39, 52, 0.78);
    --sidebar-glass: rgba(20, 26, 36, 0.68);
    --line: rgba(206, 219, 239, 0.15);
    --line-strong: rgba(226, 233, 245, 0.24);
    --text: #eff4fb;
    --muted: #a7b4c8;
    --blue: #5eb1ff;
    --green: #42d39b;
    --orange: #f0a43a;
    --red: #ff6b6b;
    --violet: #b497ff;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 12px 38px rgba(0, 0, 0, 0.24);
    --input: rgba(20, 27, 38, 0.72);
    --hover: rgba(255, 255, 255, 0.08);
}

body {
    background:
        linear-gradient(130deg, var(--bg) 0%, var(--bg-2) 46%, var(--bg) 100%),
        linear-gradient(90deg, rgba(10, 132, 255, 0.08), rgba(23, 167, 115, 0.07));
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent 56%);
}

html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.sidebar {
    inset: 14px auto 14px 14px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--sidebar-glass);
    color: var(--text);
    backdrop-filter: blur(28px) saturate(1.35);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
    box-shadow: var(--shadow);
}

.brand-mark {
    background: linear-gradient(145deg, var(--blue), var(--green));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 26px rgba(10, 132, 255, 0.22);
}

.brand span,
.nav-link.subtle,
.user-chip span,
.person-row span,
.member-top span,
.request-main span,
.request-main small,
.metric span,
.metric small,
.calendar-toolbar span,
.cal-cell span,
.cal-cell small,
.request-line span {
    color: var(--muted);
}

.nav-link {
    color: var(--text);
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: var(--hover);
    border-color: var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.shell {
    margin-left: 274px;
    padding: 28px 28px 40px;
}

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

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    cursor: pointer;
    backdrop-filter: blur(24px) saturate(1.35);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
    box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.theme-icon {
    display: block;
    position: relative;
    width: 13px;
    height: 13px;
}

.theme-icon.sun {
    border-radius: 50%;
    background: #f6b73c;
    box-shadow: 0 0 0 3px rgba(246, 183, 60, 0.18);
}

.theme-icon.moon {
    border-radius: 50%;
    background: var(--text);
}

.theme-icon.moon::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    right: -2px;
    top: -1px;
    border-radius: 50%;
    background: var(--panel-strong);
}

.user-chip,
.notifications details,
.metric,
.panel,
.week-day,
.person-row,
.request-line,
.request-card,
.member-card,
.today-status,
.login-card {
    background: var(--panel);
    border-color: var(--line);
    backdrop-filter: blur(26px) saturate(1.35);
    -webkit-backdrop-filter: blur(26px) saturate(1.35);
    box-shadow: var(--shadow-soft);
}

.panel,
.metric,
.member-card,
.request-card,
.login-card {
    position: relative;
    overflow: hidden;
}

.panel::before,
.metric::before,
.member-card::before,
.request-card::before,
.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255,255,255,0.34), transparent 42%, rgba(255,255,255,0.08));
    mix-blend-mode: screen;
}

html[data-theme="dark"] .panel::before,
html[data-theme="dark"] .metric::before,
html[data-theme="dark"] .member-card::before,
html[data-theme="dark"] .request-card::before,
html[data-theme="dark"] .login-card::before {
    opacity: 0.28;
}

.metric:hover,
.panel:hover,
.request-card:hover,
.member-card:hover {
    border-color: var(--line-strong);
}

.button,
input,
select,
textarea {
    background: var(--input);
    color: var(--text);
    border-color: var(--line);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.button {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
}

.button:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(145deg, var(--blue), #3b82f6);
    border-color: rgba(10, 132, 255, 0.56);
    color: #fff;
}

html[data-theme="dark"] .button.primary {
    color: #06111f;
}

.button.ghost {
    background: var(--hover);
}

.metric strong,
h1,
h2,
.request-title strong,
.member-top strong,
.person-row strong {
    color: var(--text);
}

.eyebrow {
    color: var(--blue);
}

.week-day.work,
.cal-cell.work,
.today-status.work {
    border-color: rgba(10, 132, 255, 0.34);
    background: rgba(10, 132, 255, 0.1);
}

.week-day.vacation,
.cal-cell.vacation,
.today-status.vacation {
    border-color: rgba(23, 167, 115, 0.34);
    background: rgba(23, 167, 115, 0.1);
}

.week-day.absence,
.cal-cell.absence,
.today-status.absence {
    border-color: rgba(217, 119, 6, 0.34);
    background: rgba(217, 119, 6, 0.1);
}

.week-day.day_off,
.cal-cell.day_off,
.today-status.day_off {
    border-color: var(--line);
    background: rgba(127, 140, 165, 0.08);
}

.calendar-grid,
.calendar-weekdays {
    gap: 10px;
}

.cal-cell {
    background: var(--panel);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.cal-cell.has-overlay {
    box-shadow: inset 0 -3px 0 rgba(139, 92, 246, 0.42), var(--shadow-soft);
}

.coverage {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.coverage span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.coverage .support {
    background: rgba(10, 132, 255, 0.14);
    color: var(--blue);
}

.coverage .office {
    background: rgba(139, 92, 246, 0.14);
    color: var(--violet);
}

.schedule-note {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--muted);
}

.schedule-note strong {
    color: var(--text);
}

.role-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.role-card,
.access-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--hover);
    padding: 12px;
}

.role-card strong,
.role-card span,
.access-preview strong,
.access-preview span,
.access-preview code {
    display: block;
}

.role-card span,
.panel-copy {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 0;
}

.account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: end;
}

.access-preview {
    color: var(--muted);
}

.access-preview code {
    margin-top: 8px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.login-page {
    background:
        linear-gradient(135deg, var(--bg), var(--bg-2)),
        linear-gradient(90deg, rgba(10, 132, 255, 0.1), rgba(23, 167, 115, 0.08));
}

.login-card {
    position: relative;
}

.login-theme {
    position: absolute;
    top: 14px;
    right: 14px;
}

.status {
    border: 1px solid rgba(255,255,255,0.22);
}

@media (max-width: 1080px) {
    .role-guide { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .sidebar {
        inset: auto;
        border-radius: 0 0 8px 8px;
    }
    .shell {
        margin-left: 0;
    }
    .top-actions {
        width: 100%;
        justify-content: space-between;
    }
    .account-actions {
        grid-template-columns: 1fr;
    }
}

/* Visual reset v2: lighter macOS-style glass */
:root,
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f9fc;
    --bg-2: #edf4f8;
    --panel: rgba(255, 255, 255, 0.52);
    --panel-strong: rgba(255, 255, 255, 0.72);
    --sidebar-glass: rgba(255, 255, 255, 0.5);
    --input: rgba(255, 255, 255, 0.66);
    --hover: rgba(255, 255, 255, 0.72);
    --line: rgba(62, 76, 98, 0.16);
    --line-strong: rgba(62, 76, 98, 0.28);
    --text: #111827;
    --muted: #647084;
    --blue: #007aff;
    --green: #10a37f;
    --orange: #c77700;
    --red: #d92d20;
    --violet: #7457ff;
    --shadow: 0 28px 80px rgba(35, 48, 70, 0.16);
    --shadow-soft: 0 12px 38px rgba(35, 48, 70, 0.1);
    --inner: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0d10;
    --bg-2: #15181f;
    --panel: rgba(255, 255, 255, 0.07);
    --panel-strong: rgba(255, 255, 255, 0.1);
    --sidebar-glass: rgba(255, 255, 255, 0.07);
    --input: rgba(255, 255, 255, 0.08);
    --hover: rgba(255, 255, 255, 0.11);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #f4f7fb;
    --muted: #aab4c3;
    --blue: #5eb1ff;
    --green: #5ce0b2;
    --orange: #ffb24d;
    --red: #ff7168;
    --violet: #b19cff;
    --shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
    --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.28);
    --inner: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body {
    background:
        linear-gradient(118deg, var(--bg) 0%, var(--bg-2) 52%, var(--bg) 100%),
        linear-gradient(180deg, rgba(0, 122, 255, 0.06), rgba(16, 163, 127, 0.04));
}

body::before {
    background-image:
        linear-gradient(rgba(82, 98, 123, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(82, 98, 123, 0.1) 1px, transparent 1px),
        linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 46%, rgba(255, 255, 255, 0.08));
    background-size: 48px 48px, 48px 48px, 100% 100%;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.42), transparent 72%);
}

html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 48%, rgba(94, 177, 255, 0.05));
}

.sidebar {
    width: 232px;
    inset: 18px auto 18px 18px;
    padding: 18px;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 42%),
        var(--sidebar-glass);
    box-shadow: var(--shadow), var(--inner);
}

.brand {
    padding: 4px 4px 18px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(145deg, #58c7ff 0%, #10d4a2 100%);
}

.brand strong {
    font-size: 16px;
}

.brand span {
    font-size: 12px;
}

nav {
    gap: 8px;
}

.nav-link {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 760;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(145deg, rgba(255,255,255,0.34), rgba(255,255,255,0.08)), var(--hover);
    box-shadow: var(--inner), 0 10px 24px rgba(20, 33, 54, 0.08);
}

html[data-theme="dark"] .nav-link.active {
    background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
}

.shell {
    margin-left: 268px;
    padding: 42px 36px 48px;
}

.topbar {
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 42px;
    line-height: 1;
    font-weight: 830;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.theme-toggle,
.user-chip,
.notifications details,
.metric,
.panel,
.week-day,
.person-row,
.request-line,
.request-card,
.member-card,
.today-status,
.login-card,
.cal-cell,
.role-card,
.access-preview,
.schedule-note {
    border-color: var(--line);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.22), transparent 44%),
        var(--panel);
    box-shadow: var(--shadow-soft), var(--inner);
    backdrop-filter: blur(34px) saturate(1.55);
    -webkit-backdrop-filter: blur(34px) saturate(1.55);
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .user-chip,
html[data-theme="dark"] .notifications details,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .week-day,
html[data-theme="dark"] .person-row,
html[data-theme="dark"] .request-line,
html[data-theme="dark"] .request-card,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .today-status,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .cal-cell,
html[data-theme="dark"] .role-card,
html[data-theme="dark"] .access-preview,
html[data-theme="dark"] .schedule-note {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.11), transparent 44%),
        var(--panel);
}

.panel::before,
.metric::before,
.member-card::before,
.request-card::before,
.login-card::before {
    background: linear-gradient(115deg, rgba(255,255,255,0.28), transparent 32%, rgba(255,255,255,0.08));
    opacity: 0.75;
}

html[data-theme="dark"] .panel::before,
html[data-theme="dark"] .metric::before,
html[data-theme="dark"] .member-card::before,
html[data-theme="dark"] .request-card::before,
html[data-theme="dark"] .login-card::before {
    opacity: 0.22;
}

.user-chip {
    min-width: 260px;
    padding: 8px 10px;
}

.theme-toggle {
    width: 48px;
    height: 48px;
}

.theme-toggle:active,
.button:active {
    transform: translateY(0) scale(0.98);
}

.panel {
    padding: 22px;
}

.notifications details {
    padding: 12px 16px;
}

.metric {
    min-height: 118px;
    padding: 18px;
}

.metric strong {
    font-weight: 820;
}

.button {
    min-height: 42px;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255,255,255,0.2), transparent), var(--input);
    box-shadow: var(--inner), 0 10px 24px rgba(20, 33, 54, 0.08);
}

.button.primary {
    background: linear-gradient(145deg, #66c2ff, #007aff 58%, #5b6cff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.44), 0 14px 32px rgba(0,122,255,0.22);
}

input,
select,
textarea {
    min-height: 42px;
    background: var(--input);
    border-color: var(--line);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(0, 122, 255, 0.28);
    border-color: rgba(0, 122, 255, 0.5);
}

.calendar-toolbar {
    margin-bottom: 18px;
}

.calendar-toolbar h2 {
    font-size: 24px;
    font-weight: 820;
}

.inline-filter {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
}

html[data-theme="dark"] .inline-filter {
    background: rgba(255,255,255,0.04);
}

.schedule-note {
    margin: 12px 0 18px;
}

.calendar-weekdays {
    padding: 0 4px;
    font-size: 13px;
}

.calendar-grid {
    gap: 10px;
}

.cal-cell {
    position: relative;
    min-height: 116px;
    padding: 12px;
    border-style: solid;
}

.cal-cell.muted {
    opacity: 0.54;
    background: rgba(255,255,255,0.16);
}

html[data-theme="dark"] .cal-cell.muted {
    background: rgba(255,255,255,0.035);
}

.cal-cell.work,
.cal-cell.day_off,
.cal-cell.vacation,
.cal-cell.absence,
.today-status.work,
.today-status.day_off,
.today-status.vacation,
.today-status.absence,
.week-day.work,
.week-day.day_off,
.week-day.vacation,
.week-day.absence {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.18), transparent 42%),
        var(--panel);
}

.cal-cell.work {
    border-color: rgba(0, 122, 255, 0.32);
}

.cal-cell.work::after {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(var(--blue), var(--green));
}

.cal-cell.day_off {
    opacity: 0.82;
}

.cal-cell.has-overlay {
    box-shadow: inset 0 -2px 0 rgba(116, 87, 255, 0.58), var(--shadow-soft), var(--inner);
}

.cal-date {
    font-size: 19px;
    line-height: 1;
    color: var(--muted);
}

.cal-cell strong {
    font-size: 14px;
    font-weight: 820;
}

.coverage {
    margin-top: auto;
}

.coverage span {
    min-height: 22px;
    padding: 0 8px;
    font-size: 11px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.coverage .support {
    background: rgba(0, 122, 255, 0.14);
}

.coverage .office {
    background: rgba(116, 87, 255, 0.14);
}

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

.role-card {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.2), transparent 46%),
        var(--panel-strong);
}

.account-actions {
    grid-template-columns: 1fr 1fr;
}

.access-preview {
    display: grid;
    gap: 4px;
    min-height: 88px;
    background: var(--panel-strong);
}

.access-preview code {
    font-size: 13px;
}

.login-page {
    background:
        linear-gradient(118deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%),
        linear-gradient(180deg, rgba(0, 122, 255, 0.08), rgba(16, 163, 127, 0.06));
}

.login-card {
    width: min(440px, 100%);
    padding: 32px;
}

.status {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
}

@media (max-width: 1080px) {
    .role-guide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: auto;
        inset: auto;
        border-radius: 0 0 8px 8px;
        box-shadow: var(--shadow-soft);
    }
    .shell {
        margin-left: 0;
        padding: 18px;
    }
    .topbar h1 {
        font-size: 32px;
    }
    .user-chip {
        min-width: 0;
    }
    .inline-filter {
        padding: 10px;
    }
    .cal-cell {
        min-height: 104px;
    }
}

.view-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
}

.view-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 820;
}

.view-tabs a.active {
    color: var(--text);
    background: var(--hover);
    box-shadow: var(--inner), 0 8px 18px rgba(20, 33, 54, 0.08);
}

.team-calendar-grid {
    align-items: stretch;
}

.team-day {
    min-height: 232px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.team-day-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
}

.team-shift {
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.22);
}

html[data-theme="dark"] .team-shift {
    background: rgba(255,255,255,0.045);
}

.team-shift.shift-five {
    border-left-color: var(--green);
}

.team-shift.shift-one {
    border-left-color: var(--blue);
}

.team-shift.shift-two {
    border-left-color: var(--violet);
}

.team-shift-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.team-shift-head strong {
    font-size: 12px;
    color: var(--text);
}

.team-shift-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    white-space: nowrap;
}

.team-people {
    display: grid;
    gap: 6px;
}

.team-person {
    position: relative;
    min-height: 42px;
    padding: 6px 6px 6px 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.22);
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 6px;
    align-items: center;
}

html[data-theme="dark"] .team-person {
    background: rgba(255,255,255,0.055);
}

.team-person::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--avatar, var(--blue));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
}

.team-person strong {
    color: var(--text);
    font-size: 12px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-person span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-person small {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 820;
}

.team-empty {
    margin-top: auto;
    color: var(--muted);
    font-size: 12px;
}

.roster-list {
    display: grid;
    gap: 12px;
}

.roster-day {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.28), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow-soft), var(--inner);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
}

html[data-theme="dark"] .roster-day {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.1), transparent 42%),
        var(--panel);
}

.roster-day.today {
    border-color: rgba(0, 122, 255, 0.44);
    box-shadow: 0 0 0 2px rgba(0,122,255,0.12), var(--shadow-soft), var(--inner);
}

.roster-date {
    min-height: 100%;
    border-radius: 8px;
    padding: 12px;
    background: var(--panel-strong);
    display: grid;
    align-content: start;
    gap: 4px;
}

.roster-date strong {
    font-size: 34px;
    line-height: 1;
    color: var(--text);
}

.roster-date span {
    color: var(--text);
    font-weight: 820;
}

.roster-date small {
    color: var(--muted);
    font-weight: 780;
}

.roster-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.roster-shift {
    min-width: 0;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.24);
}

html[data-theme="dark"] .roster-shift {
    background: rgba(255,255,255,0.05);
}

.roster-shift.shift-five { border-left-color: var(--green); }
.roster-shift.shift-one { border-left-color: var(--blue); }
.roster-shift.shift-two { border-left-color: var(--violet); }

.roster-shift-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.roster-shift-head strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.15;
}

.roster-shift-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
    text-align: right;
}

.roster-people {
    display: grid;
    gap: 7px;
}

.roster-person {
    min-width: 0;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,0.28);
}

html[data-theme="dark"] .roster-person {
    background: rgba(255,255,255,0.055);
}

.roster-person i {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--avatar, var(--blue));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
}

.roster-person div {
    min-width: 0;
}

.roster-person strong,
.roster-person small {
    display: block;
    min-width: 0;
}

.roster-person strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.roster-person small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.roster-person time,
.roster-person b {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
    white-space: nowrap;
}

.roster-empty {
    min-height: 42px;
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    padding: 0 8px;
}

@media (max-width: 1260px) {
    .team-calendar-grid {
        grid-template-columns: repeat(4, minmax(210px, 1fr));
    }
    .calendar-weekdays {
        display: none;
    }
}

@media (max-width: 760px) {
    .view-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
    .team-calendar-grid {
        grid-template-columns: 1fr;
    }
    .roster-day {
        grid-template-columns: 1fr;
    }
    .roster-date {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }
    .roster-columns {
        grid-template-columns: 1fr;
    }
    .roster-person {
        grid-template-columns: 18px minmax(0, 1fr);
    }
    .roster-person time,
    .roster-person b {
        grid-column: 2;
    }
}

/* Team list + roomy grid calendar */
.button.slim {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.team-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.team-list th,
.team-list td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.team-list thead th {
    position: sticky;
    top: 0;
    background: var(--panel-strong);
    z-index: 1;
}

.team-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-name-cell strong,
.team-name-cell span {
    display: block;
}

.team-name-cell span {
    color: var(--muted);
    font-size: 13px;
}

.team-edit-row td {
    padding: 12px;
    background: rgba(255,255,255,0.24);
}

html[data-theme="dark"] .team-edit-row td {
    background: rgba(255,255,255,0.05);
}

.team-edit-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.team-edit-form label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.team-edit-form label.checkbox input {
    width: 18px;
    min-height: 18px;
}

.team-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
}

.team-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.26), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow-soft), var(--inner);
    padding: 12px;
    display: grid;
    gap: 10px;
}

html[data-theme="dark"] .team-card {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.1), transparent 42%),
        var(--panel);
}

.team-card.today {
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(0,122,255,0.1), var(--shadow-soft), var(--inner);
}

.team-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team-card-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.team-card-date strong {
    font-size: 28px;
    line-height: 1;
    color: var(--text);
}

.team-card-date span,
.team-card-head small {
    color: var(--muted);
    font-weight: 800;
}

.team-card-sections {
    display: grid;
    gap: 8px;
}

.team-shift {
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.24);
}

html[data-theme="dark"] .team-shift {
    background: rgba(255,255,255,0.05);
}

.team-shift.shift-five { border-left-color: var(--green); }
.team-shift.shift-one { border-left-color: var(--blue); }
.team-shift.shift-two { border-left-color: var(--violet); }

.team-shift-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.team-shift-head strong {
    font-size: 13px;
    line-height: 1.2;
}

.team-shift-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
}

.team-people {
    display: grid;
    gap: 6px;
}

.team-person {
    position: relative;
    min-height: 40px;
    padding: 6px 6px 6px 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,0.22);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
}

html[data-theme="dark"] .team-person {
    background: rgba(255,255,255,0.06);
}

.team-person::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--avatar, var(--blue));
}

.team-person strong,
.team-person span,
.team-person small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.team-person strong {
    color: var(--text);
    font-size: 13px;
}

.team-person span {
    color: var(--muted);
    font-size: 11px;
}

.team-person small {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--muted);
    font-weight: 820;
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .team-edit-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .team-edit-form {
        grid-template-columns: 1fr;
    }
    .team-card-grid {
        grid-template-columns: 1fr;
    }
    .team-list-wrap {
        overflow-x: auto;
    }
}
