:root {
  color-scheme: light;
  --ink: #12233f;
  --ink-soft: #52627a;
  --navy: #12233f;
  --navy-2: #1c3153;
  --paper: #ffffff;
  --canvas: #f3f6fa;
  --line: #dbe3ed;
  --line-strong: #c6d1df;
  --teal: #1b8f73;
  --teal-dark: #126e59;
  --amber: #e7a52e;
  --red: #d95955;
  --shadow: 0 14px 40px rgba(25, 43, 70, 0.09);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(27,143,115,.25); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
@media (min-width: 761px) {
  .app-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .app-shell.sidebar-collapsed .sidebar { display: none; }
}
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 24px 16px 16px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: #aebbd0; margin-top: 1px; }
.brand-mark { width: 58px; height: 58px; border-radius: 17px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 13px; background: var(--navy); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 11px; padding: 9px; background: var(--navy-2); }
.brand-mark span { width: 8px; border-radius: 4px 4px 2px 2px; background: #fff; }
.brand-mark span:nth-child(1) { height: 14px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 27px; background: var(--amber); }
.brand-mark span:nth-child(3) { height: 20px; background: #58c7a9; }
.brand-mark.small span { width: 5px; }
.brand-mark.small span:nth-child(1) { height: 10px; }
.brand-mark.small span:nth-child(2) { height: 19px; }
.brand-mark.small span:nth-child(3) { height: 14px; }

.main-nav { display: grid; gap: 6px; }
.nav-item { width: 100%; border: 0; border-radius: 11px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 7px; padding: 11px 12px; color: #c8d3e3; background: transparent; text-align: left; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: #fff; color: var(--navy); }
.nav-icon { font-size: 1.15rem; opacity: .9; }
.count-badge { min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; display: grid; place-items: center; background: var(--amber); color: #35250a; font-size: .75rem; }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; gap: 9px; align-items: center; border-top: 1px solid rgba(255,255,255,.1); padding: 16px 5px 2px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #d6f4ea; color: var(--teal-dark); font-weight: 800; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.user-copy strong { font-size: .88rem; }
.user-copy small { color: #9eacc2; font-size: .75rem; }
.sidebar-footer .icon-button { color: #bdc9d9; }

.workspace { min-width: 0; padding: 0 28px 40px; }
.topbar { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.topbar-heading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { flex: none; border: 1px solid var(--line); background: var(--paper); font-size: 1.1rem; }
.topbar h1 { margin: 2px 0 0; font-size: 1.6rem; letter-spacing: -.025em; }
.eyebrow { margin: 0; color: var(--teal-dark); text-transform: uppercase; font-size: .72rem; font-weight: 800; letter-spacing: .11em; }
.topbar-actions, .view-heading { display: flex; align-items: center; gap: 10px; }

.view { display: none; padding-top: 24px; }
.view.active-view { display: block; }
.control-bar { display: flex; gap: 18px; align-items: center; min-height: 55px; margin-bottom: 18px; }
.month-switcher { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 4px; }
.month-label { display: grid; padding: 0 5px; }
.month-label span { color: var(--ink-soft); font-size: .68rem; font-weight: 700; }
.month-label input { min-width: 145px; border: 0; background: transparent; font-weight: 750; }
.legend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); font-size: .78rem; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(18,35,63,.12); }
.quiet-button { margin-left: auto; border: 0; background: transparent; color: var(--teal-dark); font-weight: 750; text-decoration: none; padding: 9px 10px; border-radius: 9px; }
.quiet-button:hover { background: #e6f5f1; }
.primary-button, .secondary-button { border-radius: 10px; padding: 10px 15px; font-weight: 750; border: 1px solid transparent; }
.primary-button { color: #fff; background: var(--teal); box-shadow: 0 5px 12px rgba(27,143,115,.17); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.secondary-button:hover { border-color: var(--teal); }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 9px; display: grid; place-items: center; background: transparent; font-size: 1.25rem; }
.icon-button:hover { background: rgba(91,111,137,.12); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card { min-height: 114px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 4px 18px rgba(25,43,70,.035); }
.summary-card span, .summary-card small { display: block; color: var(--ink-soft); }
.summary-card span { font-size: .82rem; font-weight: 650; }
.summary-card strong { display: block; margin: 7px 0 1px; font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.summary-card small { font-size: .72rem; }
.summary-card.accent-card { color: #fff; border-color: var(--navy); background: linear-gradient(135deg, var(--navy), #26466f); }
.summary-card.accent-card span, .summary-card.accent-card small { color: #c7d3e4; }
.summary-card.warning-card { background: #fffaf0; border-color: #efd59c; }
.summary-card.warning-card strong { color: #a66b00; }
.actionable-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.actionable-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(25,43,70,.1); }
.summary-card.critical-card { background: #fff0ef; border-color: #e8a09c; }
.summary-card.critical-card strong { color: #b33d38; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { min-height: 76px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .view-heading h2 { margin: 0; font-size: 1.15rem; }
.panel-heading p, .view-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: .8rem; }
.filter-group { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.filter-group label { display: grid; color: var(--ink-soft); font-size: .7rem; font-weight: 650; }
.filter-group select, .filter-group input { min-height: 32px; min-width: 145px; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; }
.compact-button { min-height: 34px; padding: 7px 11px; white-space: nowrap; }

.schedule-scroller { max-height: calc(100vh - 380px); min-height: 300px; overflow: auto; scrollbar-color: #aebccc #edf1f6; }
.schedule-table { border-collapse: separate; border-spacing: 0; min-width: 100%; width: max-content; font-size: .78rem; }
.schedule-table th, .schedule-table td { height: 42px; min-width: 44px; padding: 0; border-right: 1px solid #e8edf3; border-bottom: 1px solid #e8edf3; text-align: center; background: #fff; }
.schedule-table thead th { position: sticky; top: 0; z-index: 6; height: 51px; color: var(--ink-soft); background: #f8fafc; font-weight: 750; }
.schedule-table thead th.weekend { color: #bd514c; background: #fff5f4; }
.schedule-table thead th.calendar-off { color: #a64a46; }
.schedule-table th.coverage-warning, .schedule-table .coverage-row td.coverage-warning { background: #fff1c9; color: #8b5900; }
.schedule-table th.coverage-critical, .schedule-table .coverage-row td.coverage-critical { background: #fbdad8; color: #a5332e; box-shadow: inset 0 -3px 0 #d95955; }
.schedule-table .employee-column { position: sticky; left: 0; z-index: 8; width: 230px; min-width: 230px; max-width: 230px; padding: 0 14px; text-align: left; background: #fff; box-shadow: 8px 0 16px -14px rgba(18,35,63,.7); }
.schedule-table thead .employee-column { z-index: 10; background: #f8fafc; }
.schedule-table .coverage-row td { position: sticky; top: 51px; z-index: 5; height: 33px; color: var(--ink-soft); background: #eef7f5; font-size: .68rem; font-weight: 800; }
.schedule-table .coverage-row .employee-column { z-index: 9; color: var(--teal-dark); }
.schedule-table .schedule-group-row th,
.schedule-table .schedule-group-row td { height: 34px; color: #29415f; background: #eaf0f7; border-bottom-color: #ced8e5; }
.schedule-table .schedule-group-row .employee-column { z-index: 4; background: #dde7f2; font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .035em; }
.schedule-table .schedule-group-row td { padding: 0 13px; text-align: left; }
.schedule-table .schedule-group-row td strong { margin-right: 12px; font-size: .72rem; }
.schedule-table .schedule-group-row td span { color: #61748d; font-size: .7rem; }
.employee-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.employee-meta { display: block; color: #7d8ba0; font-size: .67rem; margin-top: 1px; }
.leader-badge { display: inline-flex; margin-left: 7px; padding: 2px 6px; border-radius: 10px; color: #0d6855; background: #d8f2ea; font-size: .58rem; font-weight: 850; line-height: 1.2; text-transform: uppercase; letter-spacing: .035em; vertical-align: 1px; }
.shift-chip.maternity { background: #eee8f4; color: #715b85; }
.shift-cell { width: 100%; height: 100%; border: 0; padding: 2px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: transparent; }
.shift-cell:disabled { cursor: default; }
.shift-chip { width: 32px; min-height: 25px; margin: 0 auto; border-radius: 7px; display: grid; place-items: center; color: #1e385a; font-size: .69rem; font-weight: 800; border: 1px solid rgba(18,35,63,.08); }
.shift-chip.night { color: #fff; }
.shift-chip.event-code { color: #fff; }
.shift-empty { color: #bac4d0; font-size: 1rem; }
.extra-work-badge { display: block; max-width: 42px; overflow: hidden; color: #11715b; font-size: .55rem; font-weight: 850; line-height: 1; white-space: nowrap; }
.extra-work-badge.money { color: #a05d00; }
.extra-work-badge.time-off { color: #9a3412; font-weight: 900; }
.schedule-table tbody tr:hover td { background-image: linear-gradient(rgba(27,143,115,.035), rgba(27,143,115,.035)); }
.empty-state { text-align: center; padding: 65px 20px; color: var(--ink-soft); }
.empty-state strong { display: block; color: var(--ink); font-size: 1.05rem; }
.empty-state p { margin: 6px 0 0; }

.view-heading { justify-content: space-between; margin-bottom: 19px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#vacationPayAllField[hidden] { display: none !important; }
.balance-controls { flex-wrap: wrap; }
.balance-as-of { margin: 0; color: var(--ink-soft); font-size: .82rem; font-weight: 650; }
.filter-tabs { display: inline-flex; max-width: 100%; overflow-x: auto; gap: 4px; margin-bottom: 15px; padding: 4px; background: #e8edf3; border-radius: 11px; }
.filter-tabs button { flex: none; border: 0; border-radius: 8px; padding: 8px 13px; color: var(--ink-soft); background: transparent; font-weight: 700; }
.filter-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(18,35,63,.08); }
.event-list { display: grid; gap: 10px; }
.event-card { display: grid; grid-template-columns: 48px minmax(160px,1fr) minmax(240px,1.4fr) minmax(110px,.6fr) auto; grid-template-areas: "symbol person requested detail actions"; gap: 14px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.event-symbol { grid-area: symbol; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--teal); font-weight: 850; }
.event-person { grid-area: person; }
.event-requested { grid-area: requested; display: grid; gap: 2px; }
.event-card .event-requested small { color: var(--ink-soft); font-size: .7rem; font-weight: 750; }
.event-requested strong { font-size: .95rem; line-height: 1.25; }
.event-requested span { color: var(--teal-dark); font-size: .8rem; font-weight: 750; }
.event-detail { grid-area: detail; display: grid; justify-items: start; gap: 5px; }
.event-card h3 { margin: 0; font-size: .95rem; }
.event-card p, .event-card small { margin: 2px 0 0; color: var(--ink-soft); font-size: .78rem; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: 15px; padding: 5px 9px; font-size: .72rem; font-weight: 800; background: #eef2f7; }
.status-pill.pending { color: #8c5a00; background: #fff1cb; }
.status-pill.approved { color: #11715b; background: #dff6ee; }
.status-pill.rejected, .status-pill.cancelled { color: #aa3935; background: #fde7e6; }
.event-actions { grid-area: actions; display: flex; gap: 6px; }
.mini-button { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff; font-size: .72rem; font-weight: 750; }
.mini-button.approve { color: var(--teal-dark); border-color: #8bc7b8; }
.mini-button.reject { color: #a3403d; border-color: #e9aaa7; }
.employee-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.order-buttons { display: inline-flex; gap: 3px; }
.icon-mini { width: 29px; padding-left: 0; padding-right: 0; font-size: .88rem; }
.mini-button:disabled { opacity: .35; cursor: default; }

.table-panel { overflow: hidden; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th { color: var(--ink-soft); background: #f8fafc; font-size: .72rem; text-align: left; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { font-size: .85rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .number { font-variant-numeric: tabular-nums; font-weight: 800; }
.data-table .negative { color: var(--red); }
.data-table .muted-row { color: var(--ink-soft); background: #f8fafc; }
.missing-value { color: var(--red); font-weight: 750; }

.settings-panel { padding: 22px; }
.settings-form { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(170px, .7fr)); gap: 18px; align-items: end; }
.settings-form h3 { margin: 0 0 4px; font-size: 1rem; }
.settings-form p { margin: 0; max-width: 620px; color: var(--ink-soft); font-size: .8rem; }
.settings-form label, .grant-box label { display: grid; gap: 6px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.settings-form input:not([type="checkbox"]), .grant-box input { min-height: 42px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; background: #fff; }
.check-field { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 9px !important; }
.check-field input { width: 19px; height: 19px; accent-color: var(--teal); }
.settings-actions { display: flex; justify-content: flex-end; }
.settings-divider { padding-top: 18px; border-top: 1px solid var(--line); }
.calendar-status { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.calendar-status small { grid-column: 1 / -1; color: var(--ink-soft); }
.grant-box { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 150px auto; gap: 14px; align-items: end; }
.grant-box strong, .grant-box small { display: block; }
.grant-box small { margin-top: 3px; color: var(--ink-soft); }
.access-panel { margin-top: 16px; }
.night-payroll-panel { margin-top: 16px; }
.access-panel h3 { margin: 0 0 4px; font-size: 1rem; }
.access-panel p { margin: 0 0 16px; color: var(--ink-soft); font-size: .8rem; }
.access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.access-grid label { display: grid; gap: 6px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.access-grid input:not([type="checkbox"]), .access-grid select { min-height: 42px; width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; background: #fff; }
.access-grid .check-field { display: flex; align-items: center; min-height: 42px; }
.password-form { padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.access-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.access-list span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .76rem; }
.user-account-list { display: grid; gap: 9px; margin-top: 15px; }
.user-account { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.user-account.disabled { background: #f8fafc; }
.user-account-details { display: grid; gap: 3px; }
.user-account-details strong { font-size: .85rem; }
.user-account-details small { color: var(--ink-soft); font-size: .75rem; }
.user-account-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; }
.user-account-actions label { display: grid; gap: 3px; color: var(--ink-soft); font-size: .7rem; font-weight: 700; }
.user-account-actions select { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 7px; background: #fff; }
.viewer-options { display: flex; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.viewer-options label { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.coverage-results { max-height: min(62vh, 650px); overflow: auto; display: grid; gap: 8px; padding: 18px 20px; }
.coverage-issue { display: grid; grid-template-columns: 120px 150px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: 10px; background: #fffaf0; }
.coverage-issue.critical { border-left-color: var(--red); background: #fff1f0; }
.coverage-issue span { color: var(--ink-soft); font-size: .78rem; }
.coverage-issue p, .coverage-ok p { margin: 0; color: var(--ink-soft); font-size: .82rem; }
.coverage-ok { padding: 44px 20px; text-align: center; }
.coverage-ok strong { color: var(--teal-dark); font-size: 1.1rem; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 20% 10%, #274b75, transparent 33%), linear-gradient(145deg, #0d1b31, #152b4d); }
.login-card { width: min(430px, 100%); padding: 38px; border-radius: 24px; background: #fff; box-shadow: 0 32px 80px rgba(0,0,0,.32); }
.login-card .brand-mark { margin-bottom: 26px; }
.login-card h1 { margin: 5px 0 5px; font-size: 2rem; letter-spacing: -.04em; }
.login-copy { margin: 0 0 24px; color: var(--ink-soft); }
.stack-form { display: grid; gap: 14px; }
.stack-form label, .modal label { display: grid; gap: 6px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.stack-form input, .modal input, .modal select, .modal textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; background: #fff; }
.modal textarea { resize: vertical; }
.form-error { min-height: 1.2em; margin: -5px 0; color: var(--red); font-size: .8rem; }
.form-hint { margin: 2px 0 0; color: var(--ink-soft); font-size: .75rem; }

.modal { width: min(580px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 75px rgba(18,35,63,.25); }
.modal::backdrop { background: rgba(10,24,44,.58); backdrop-filter: blur(3px); }
.modal-card { padding: 0; }
.modal-card > header, .modal-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.modal-card > header { border-bottom: 1px solid var(--line); }
.modal-card > footer { border-top: 1px solid var(--line); }
.modal-card > header h2 { margin: 2px 0 0; font-size: 1.2rem; }
.modal-card > label, .modal-card > fieldset, .modal-card > .form-grid, .modal-card > .form-hint { margin-left: 20px; margin-right: 20px; }
.modal-card > label, .modal-card > fieldset { margin-top: 17px; }
.modal-card > .form-grid { margin-top: 19px; margin-bottom: 10px; }
.modal-card > .form-hint { margin-bottom: 17px; }
.modal-card fieldset { border: 0; padding: 0; }
.modal-card legend { margin-bottom: 8px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.shift-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.shift-radio { position: relative; }
.shift-radio input { position: absolute; opacity: 0; pointer-events: none; }
.shift-radio span { min-height: 51px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; text-align: center; font-size: .72rem; font-weight: 800; }
.shift-radio input:checked + span { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal), 0 0 0 2px rgba(27,143,115,.12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.three-columns { grid-template-columns: repeat(3, 1fr); }
.full-field { grid-column: 1 / -1; }
.wide-dialog { width: min(780px, calc(100vw - 24px)); }
.wide-modal { width: 100%; }
.people-picker-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 16px 20px 10px; }
.people-picker-toolbar label { flex: 1; }
.people-picker-toolbar .secondary-button { align-self: end; }
.people-picker-toolbar span { padding-bottom: 10px; color: var(--teal-dark); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.people-options { max-height: min(56vh, 560px); overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 20px 18px; }
.people-option { min-width: 0; display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 10px !important; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.people-option:has(input:checked) { border-color: #7cc8b6; background: #eef9f6; }
.people-option input { width: 18px !important; min-height: 18px !important; accent-color: var(--teal); }
.people-option span { min-width: 0; }
.people-option strong, .people-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-option strong { color: var(--ink); }
.people-option small { margin-top: 2px; color: var(--ink-soft); font-weight: 500; }
.footer-spacer { flex: 1; }
.balance-rule { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #b9dfd5; border-radius: 10px; color: #176e5b; background: #eef9f6; }
.balance-rule strong, .balance-rule span { display: block; }
.balance-rule span { color: var(--ink-soft); font-size: .78rem; }
.balance-rule.negative { border-color: #efc071; color: #8b5900; background: #fff8e8; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 360px; padding: 12px 16px; border-radius: 11px; color: #fff; background: var(--navy); box-shadow: 0 12px 35px rgba(18,35,63,.25); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #a53c38; }

@media (max-width: 1050px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 12px 0; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .control-bar { flex-wrap: wrap; }
  .quiet-button { margin-left: 0; }
  .legend { order: 3; width: 100%; }
  .event-card { grid-template-columns: 44px minmax(0,1fr) auto; grid-template-areas: "symbol person detail" ". requested actions"; }
}

@media (max-width: 760px) {
  body { padding-bottom: 68px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; width: 100%; height: 68px; padding: 7px 10px; z-index: 40; }
  .brand, .sidebar-footer { display: none; }
  .main-nav { height: 100%; display: flex; justify-content: space-around; }
  .nav-item { width: auto; min-width: 64px; grid-template-columns: 1fr; gap: 1px; justify-items: center; padding: 5px 8px; border-radius: 9px; font-size: .68rem; }
  .nav-item .count-badge { position: absolute; margin: -23px 0 0 28px; }
  .workspace { padding: 0 13px 22px; }
  .topbar { min-height: 78px; }
  .sidebar-toggle { display: none; }
  .topbar h1 { font-size: 1.25rem; }
  .topbar .eyebrow { display: none; }
  .topbar-actions .secondary-button { display: none; }
  .topbar-actions .primary-button { padding: 9px 11px; }
  .view { padding-top: 15px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { min-height: 100px; padding: 13px; }
  .summary-card strong { font-size: 1.65rem; }
  .summary-card small { line-height: 1.2; }
  .control-bar { gap: 10px; }
  .legend { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-group label { flex: 1; }
  .filter-group select, .filter-group input { min-width: 0; width: 100%; }
  .schedule-scroller { max-height: calc(100vh - 455px); }
  .schedule-table .employee-column { width: 168px; min-width: 168px; max-width: 168px; padding: 0 9px; }
  .event-card { grid-template-columns: 42px minmax(0,1fr); grid-template-areas: "symbol person" ". requested" ". detail" ". actions"; }
  .view-heading { align-items: flex-start; }
  .view-heading p { max-width: 240px; }
  .settings-form, .grant-box { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
  .user-account { align-items: stretch; flex-direction: column; }
  .user-account-actions label { width: 100%; }
  .user-account-actions select { width: 100%; }
  .calendar-status, .coverage-issue { grid-template-columns: 1fr; }
  .calendar-status small { grid-column: auto; }
  .settings-actions { justify-content: stretch; }
  .settings-actions .primary-button, .grant-box .secondary-button { width: 100%; }
  .form-grid, .form-grid.three-columns { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .shift-options { grid-template-columns: repeat(3, 1fr); }
  .people-options { grid-template-columns: 1fr; }
  .people-picker-toolbar { align-items: stretch; flex-direction: column; }
  .people-picker-toolbar .secondary-button { align-self: stretch; }
  .people-picker-toolbar span { padding-bottom: 0; }
  .login-card { padding: 29px 24px; }
}
