:root {
  --bg: #edf2f5;
  --surface: #ffffff;
  --surface-soft: #edf5f2;
  --ink: #172536;
  --muted: #607084;
  --line: #d6e0e8;
  --accent: #0c766f;
  --accent-strong: #075e59;
  --danger: #b42318;
  --danger-strong: #8f1c15;
  --success: #147a42;
  --focus: #2c7be5;
  --admin: #6d28d9;
  --admin-strong: #5b21b6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-oms-theme="dark"] {
  --bg: #0a0a0b;
  --surface: #171719;
  --surface-soft: #2a1e20;
  --ink: #f7f1f1;
  --muted: #c2b5b6;
  --line: #4a3a3c;
  --accent: #d8292f;
  --accent-strong: #ff464d;
  --danger: #ff696e;
  --danger-strong: #7a1418;
  --success: #64c49a;
  --focus: #ff777c;
  --admin: #a855f7;
  --admin-strong: #c084fc;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; padding: 0 13px; cursor: pointer; box-shadow: 0 1px 1px rgba(15, 23, 42, .06); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:hover { background: var(--accent-strong); }
button:not(:disabled):hover { box-shadow: 0 4px 10px rgba(9, 67, 63, .14); transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
button.secondary:hover { background: #f5f9fa; border-color: #aabcc7; }
button.active { background: var(--surface-soft); color: var(--accent-strong); border-color: var(--accent); }
button.danger { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
button.danger:hover { filter: brightness(1.15); }
button.admin { background: var(--admin); border-color: var(--admin); color: #fff; }
button.admin:hover { background: var(--admin-strong); border-color: var(--admin-strong); }
button.compact { min-height: 34px; }
button.icon-only { width: 36px; padding: 0; }
.button-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.google-glyph { display: inline-grid; place-items: center; color: #4285f4; font-family: Arial, sans-serif; font-size: 1rem; font-weight: 800; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus), transparent 70%); outline-offset: 1px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 9px 10px; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: .78; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px #fff inset; transition: background-color 9999s ease-out 0s; }
input[data-private-input="true"]:-webkit-autofill { -webkit-text-security: disc; box-shadow: 0 0 0 1000px #fff inset; }
textarea { resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.inline-choice { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.inline-choice input { width: auto; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-panel { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 50px rgba(21, 34, 30, .09); }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { width: 42px; height: 42px; object-fit: contain; }
.provider-button { width: 100%; }
.inline-link { background: none; border: none; padding: 0; color: var(--accent-strong); font: inherit; text-decoration: underline; cursor: pointer; }
.inline-link:hover, .inline-link:focus { background: none; box-shadow: none; color: var(--accent); }
.auth-divider { margin-top: 14px; font-size: .875rem; text-align: center; }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { flex: 1; padding-right: 40px; }
.password-toggle { position: absolute; right: 6px; padding: 4px; background: none; border: none; color: var(--muted); cursor: pointer; }
.password-toggle:hover { color: var(--text); }
.auth-panel h1, .topbar h1 { margin: 4px 0 0; font-size: 1.6rem; line-height: 1.2; }
.eyebrow { margin: 0; color: var(--accent-strong); font-size: .76rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.stack { display: grid; gap: 14px; margin-top: 22px; }
.muted { color: var(--muted); }
.error, .modal-error { color: var(--danger); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.app-shell.sidebar-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.sidebar-hidden .sidebar { min-width: 0; width: 0; padding-left: 0; padding-right: 0; border-right: 0; overflow: hidden; visibility: hidden; }
.sidebar { display: grid; grid-template-rows: auto auto 1fr; gap: 18px; padding: 20px 14px; background: #f8fbfc; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; object-fit: contain; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1rem; }
.brand div span { margin-top: 3px; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.panel-nav { display: grid; gap: 16px; align-content: start; }
.nav-group { display: grid; gap: 5px; }
.nav-group-toggle { min-height: 26px; justify-content: flex-start; gap: 6px; padding: 0 9px; border: 0; background: transparent; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; box-shadow: none; }
.nav-group-toggle:hover { background: transparent; color: var(--accent-strong); box-shadow: none; transform: none; }
.nav-toggle-indicator { display: inline-grid; place-items: center; width: 13px; color: var(--accent-strong); font-family: "SFMono-Regular", Consolas, monospace; font-size: .9rem; line-height: 1; }
.nav-group-items { display: grid; gap: 5px; }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group button { min-height: 34px; justify-content: flex-start; padding-left: 11px; text-align: left; font-size: .86rem; }
.nav-group .nav-group-toggle { min-height: 26px; padding-left: 9px; font-size: .7rem; }
.nav-empty { margin: 0 9px; font-size: .82rem; }
.sidebar-bottom { align-self: end; display: grid; gap: 12px; }
.profile-card, .notifications { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-card strong, .profile-card > span { display: block; }
.profile-card > span { margin: 3px 0 10px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.notifications { display: grid; gap: 8px; }
.notifications div { display: grid; gap: 2px; padding-left: 9px; border-left: 3px solid #3e9f91; }
.notifications strong { font-size: .86rem; }
.notifications span { color: var(--muted); font-size: .73rem; }
.context-title { margin: 0 0 9px; font-weight: 800; font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .76rem; }
.theme-selector { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.theme-selector legend { width: 100%; margin-bottom: 2px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.theme-choice { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: .76rem; font-weight: 700; }
.theme-choice input { width: auto; accent-color: var(--accent); }
.workspace { min-width: 0; padding: 24px 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar-actions { display: flex; align-items: end; gap: 8px; }
.week-label { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: .8rem; }
.fy-control { min-width: 135px; }
.fy-control select { padding-top: 8px; padding-bottom: 8px; }
.notice { padding: 11px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; background: #fff; }
.notice.success { border-left-color: var(--success); }
.notice.error { border-left-color: var(--danger); }
.announcement-strip { display: grid; gap: 8px; margin: 0 0 14px; }
.announcement-strip div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid #bdcfdf; border-left: 4px solid #2c7be5; border-radius: 6px; background: #f7fbff; }
.announcement-strip span { color: var(--muted); font-size: .84rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; margin-bottom: 14px; }
.kpi-card { min-height: 98px; padding: 15px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 8px; background: linear-gradient(135deg, #fff 0%, #f7fbfb 100%); display: grid; align-content: space-between; }
.kpi-card span, .kpi-card small { color: var(--muted); font-size: .8rem; }
.kpi-card strong { font-size: 1.65rem; line-height: 1.15; }
.report-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.report-strip h2 { margin: 4px 0 0; font-size: 1rem; }
.report-list { flex: 1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 15px; }
.report-list div { display: grid; gap: 2px; min-width: 115px; }
.report-list span, .report-list small { color: var(--muted); font-size: .75rem; }
.report-list strong { font-size: 1.05rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
.content-grid.without-detail { grid-template-columns: minmax(0, 1fr); }
.data-panel, .detail-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.detail-panel { max-height: calc(100vh - 48px); overflow-y: auto; padding: 16px; }
.detail-panel h2, .detail-panel h3 { margin: 0 0 12px; font-size: 1rem; }
.detail-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-heading h2 { flex: 1; margin: 0; }
.pii-masked { color: var(--muted); letter-spacing: 0.12em; font-size: 0.82em; user-select: none; }
.form-warning { border: 1px solid var(--danger); border-radius: 6px; padding: 10px 12px; background: color-mix(in srgb, var(--danger) 10%, transparent); }
.form-warning p { margin: 0 0 8px; font-size: .85rem; color: var(--danger-strong); }
select:disabled, input:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
label small.muted { font-weight: 400; font-size: .76rem; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox-inline input { width: auto; }
[data-row-pii-index], [data-row-pii-order] { color: var(--muted); }
[data-row-pii-index]:hover, [data-row-pii-order]:hover { color: var(--accent); }
.action-bar { min-height: 57px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.inline-control { width: auto; min-width: 230px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 6px 8px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.inline-control select { width: auto; min-width: 140px; padding: 6px 8px; }
.filter-bar { display: flex; align-items: end; gap: 12px; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.filter-bar label { flex: 1; max-width: 330px; }
.filter-bar .poc-filter { flex: 0 0 190px; }
.filter-bar .sort-control { flex: 0 1 156px; min-width: 130px; }
.result-count { color: var(--muted); font-size: .82rem; }
.pagination { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: .82rem; }
.table-wrap { max-height: max(520px, calc(100vh - 300px)); min-height: 300px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; background: #f8faf9; color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.table-wrap td .preserve-text { display: -webkit-box; max-width: 320px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.column-heading { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 96px; }
.column-heading span { white-space: nowrap; }
.column-heading .icon-only { width: 28px; min-height: 28px; flex: 0 0 auto; }
.column-filter-menu { position: absolute; z-index: 4; min-width: 190px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 10px 26px rgba(15, 23, 42, .14); text-transform: none; }
.column-filter-menu select { min-width: 170px; padding: 7px 8px; font-size: .82rem; }
.filter-sort-options { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.filter-sort-option { display: block; width: 100%; min-height: 30px; background: none; border: none; box-shadow: none; padding: 5px 6px; font-size: .82rem; font-weight: 400; text-transform: none; color: var(--ink); text-align: left; justify-content: flex-start; border-radius: 4px; }
.filter-sort-option:hover { background: var(--surface-soft); box-shadow: none; transform: none; }
.filter-sort-option.active { color: var(--accent-strong); font-weight: 600; background: var(--surface-soft); }
.filter-menu-divider { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.filter-checkbox-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; padding-right: 2px; }
.filter-checkbox-option { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: .82rem; white-space: nowrap; }
.filter-select-all { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 2px; font-weight: 600; }
/* Checkboxes here would otherwise inherit the generic
   `input, select, textarea { width: 100%; padding: 9px 10px; border: 1px
   solid var(--line); }` form-field rule meant for text-style inputs --
   that stretched each checkbox's own box to the full row width, so the
   tiny checkbox glyph rendered on the left with a large gap before the
   label text after it. Mirrors the existing .bulk-check pattern. */
.filter-checkbox-option input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; min-height: 16px; flex: 0 0 auto; padding: 0; border: 2px solid var(--line); border-radius: 4px; background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.filter-checkbox-option input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.filter-checkbox-option input[type="checkbox"]:checked::after { content: ""; display: block; width: 4px; height: 8px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(42deg) translateY(-1px); }
.filter-checkbox-option input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.filter-menu-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.filter-menu-actions button { min-height: 30px; padding: 4px 10px; font-size: .8rem; }
.date-range-menu { display: grid; gap: 8px; min-width: 225px; }
.date-range-menu label { font-size: .75rem; }
.date-range-menu input { min-width: 0; padding: 7px 8px; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: var(--surface-soft); }
.status { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding: 3px 6px; border-radius: 4px; background: var(--surface-soft); color: var(--accent-strong); font-size: .75rem; white-space: nowrap; }
.plus-button { width: 30px; min-height: 30px; padding: 0; border-radius: 50%; line-height: 1; }
.plus-button .button-icon { width: 15px; height: 15px; }
td .icon-only + .icon-only { margin-left: 4px; }
.bulk-select-col, .bulk-select-cell { width: 44px; min-width: 44px; text-align: center; padding: 0 10px; }
.bulk-select-col { position: sticky; left: 0; z-index: 6; background: var(--surface); }
.bulk-select-cell { position: sticky; left: 0; z-index: 3; background: var(--surface); }
tbody tr:hover .bulk-select-cell, tbody tr.selected .bulk-select-cell { background: var(--surface-soft); }
input[type="checkbox"].bulk-check { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 4px; background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .14s ease, border-color .14s ease; flex-shrink: 0; vertical-align: middle; }
input[type="checkbox"].bulk-check:hover { border-color: var(--accent); }
input[type="checkbox"].bulk-check:checked, input[type="checkbox"].bulk-check:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"].bulk-check:checked::after { content: ""; display: block; width: 5px; height: 9px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(42deg) translateY(-1px); }
input[type="checkbox"].bulk-check:indeterminate::after { content: ""; display: block; width: 8px; height: 2px; background: #fff; border-radius: 1px; }
input[type="checkbox"].bulk-check:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.actions-col, .actions-cell { position: sticky; left: 44px; z-index: 3; min-width: 166px; background: var(--surface); }
.actions-col { z-index: 5; }
table:not(:has(.bulk-select-col)) .actions-col, table:not(:has(.bulk-select-col)) .actions-cell { left: 0; }
tbody tr:hover .actions-cell, tbody tr.selected .actions-cell { background: var(--surface-soft); }
.row-actions { display: flex; align-items: center; gap: 4px; min-width: max-content; white-space: nowrap; }
.row-actions .icon-only { position: relative; flex: 0 0 32px; width: 32px; min-height: 32px; }
#oms-tooltip { position: fixed; z-index: 9999; padding: 4px 8px; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: .72rem; font-weight: 700; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s ease; }
.detail-list { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 8px 11px; margin: 0; font-size: .84rem; }
.detail-list dt { color: var(--muted); font-weight: 800; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.preserve-text { white-space: pre-wrap; }
.master-detail-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.master-detail-section h3 { margin: 0 0 7px; font-size: .9rem; }
.master-detail-section p { margin: 0; line-height: 1.45; }
.health-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.health-panel p { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; font-size: .82rem; }
.documents-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.documents-panel h3 { margin-bottom: 8px; }
.documents-panel p { margin: 0; font-size: .8rem; }
.document-list { display: grid; gap: 8px; }
.document-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf1f3; }
.document-list span { display: grid; min-width: 0; gap: 2px; }
.document-list strong, .document-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list small { color: var(--muted); font-size: .72rem; }
.empty-state { padding: 24px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }
.error-state { border-left: 3px solid var(--danger); }
.error-cell { color: var(--danger); font-size: .85rem; }
.loading-indicator { display: inline-block; width: 18px; height: 18px; margin-right: 8px; border: 2px solid #c7d4dc; border-top-color: var(--accent); border-radius: 50%; vertical-align: middle; animation: spin .8s linear infinite; }
.empty-state .loading-indicator + p { display: inline; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

:root[data-oms-theme="dark"] body { background: var(--bg); }
:root[data-oms-theme="dark"] .sidebar { background: #111113; }
:root[data-oms-theme="dark"] button.secondary, :root[data-oms-theme="dark"] input, :root[data-oms-theme="dark"] select, :root[data-oms-theme="dark"] textarea, :root[data-oms-theme="dark"] .profile-card, :root[data-oms-theme="dark"] .notifications, :root[data-oms-theme="dark"] .notice, :root[data-oms-theme="dark"] .report-strip, :root[data-oms-theme="dark"] .data-panel, :root[data-oms-theme="dark"] .detail-panel, :root[data-oms-theme="dark"] .modal, :root[data-oms-theme="dark"] .column-filter-menu { background: var(--surface); }
:root[data-oms-theme="dark"] button.secondary:hover { background: #242225; border-color: #745356; }
:root[data-oms-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator, :root[data-oms-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .9; }
:root[data-oms-theme="dark"] th { background: #141416; }
:root[data-oms-theme="dark"] .action-bar { background: #151517; }
:root[data-oms-theme="dark"] .kpi-card { background: #18181a; }
:root[data-oms-theme="dark"] .announcement-strip div { background: #25191b; border-color: #714047; border-left-color: var(--accent); }
:root[data-oms-theme="dark"] .status { background: #392226; color: #ffb0b3; }
:root[data-oms-theme="dark"] input:-webkit-autofill, :root[data-oms-theme="dark"] input:-webkit-autofill:hover, :root[data-oms-theme="dark"] input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px var(--surface) inset; }
:root[data-oms-theme="dark"] .week-label, :root[data-oms-theme="dark"] .calendar-day, :root[data-oms-theme="dark"] .schedule-list p, :root[data-oms-theme="dark"] .support-list p, :root[data-oms-theme="dark"] .access-review-form, :root[data-oms-theme="dark"] .group-list article { background: var(--surface); }
:root[data-oms-theme="dark"] .calendar-day.has-orders { border-color: var(--accent); background: var(--surface-soft); }
:root[data-oms-theme="dark"] .document-list > div { border-bottom-color: var(--line); }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(21, 34, 30, .45); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 22px 60px rgba(0, 0, 0, .18); }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal h2 { margin: 0; font-size: 1.1rem; }
.icon-button { width: 34px; min-height: 34px; padding: 0; font-size: 1.25rem; }
.modal-error { min-height: 20px; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.phone-inputs { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.span-2 { grid-column: span 2; }
.form-context { font-size: 0.85em; color: var(--muted); padding: 4px 0 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.modal-submit-error { flex: 1; color: var(--danger); font-weight: 700; }
.button-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.calendar-widget { margin-top: 16px; }
.calendar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-heading span { color: var(--muted); font-size: .78rem; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays { margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; text-align: center; }
.calendar-day { min-height: 54px; display: grid; align-content: space-between; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; }
.calendar-day.has-orders { border-color: #8fc2bb; background: #f0f8f6; }
.calendar-day strong { font-size: .82rem; }
.calendar-day small { justify-self: end; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .68rem; }
.calendar-day.empty { border-color: transparent; background: transparent; }
.schedule-list, .support-list, .request-list { display: grid; gap: 9px; margin-top: 16px; }
.schedule-list p, .support-list p, .access-review-form { display: grid; gap: 4px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.schedule-list span, .support-list span, .access-review-form span { color: var(--muted); font-size: .82rem; }
.groups-panel { padding: 18px; }
.groups-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.groups-heading h2 { margin: 3px 0 0; font-size: 1.05rem; }
.groups-heading > span { color: var(--muted); font-size: .8rem; }
.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.group-list article { display: grid; gap: 4px; min-height: 90px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.group-list span, .group-list small { color: var(--muted); }
.group-list span { font-size: .76rem; font-family: "SFMono-Regular", Consolas, monospace; }
.group-list small { font-size: .76rem; }
@media (max-width: 980px) { .app-shell { grid-template-columns: 1fr; } .app-shell.sidebar-hidden { grid-template-columns: 1fr; } .app-shell.sidebar-hidden .sidebar { display: none; } .sidebar { grid-template-rows: auto auto; border-right: 0; border-bottom: 1px solid var(--line); } .user-context { display: none; } .content-grid { grid-template-columns: 1fr; } .table-wrap { max-height: none; } .detail-panel { order: 3; } }
@media (max-width: 640px) { .workspace, .sidebar { padding: 16px; } .topbar, .report-strip, .filter-bar { display: grid; } .topbar-actions { justify-content: space-between; } .report-list { justify-content: flex-start; } .filter-bar label, .filter-bar .sort-control { max-width: none; min-width: 0; } .pagination { margin-left: 0; } .action-bar button { flex: 1 1 140px; } .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } .detail-list { grid-template-columns: 1fr; } .modal-backdrop { align-items: start; padding: 12px; overflow-y: auto; } .modal { max-height: calc(100vh - 24px); padding: 16px; } .modal-actions button { width: 100%; } }
@media (max-width: 420px) { .workspace, .sidebar { padding: 12px; } .topbar-actions { align-items: stretch; } .week-label { display: none; } .kpi-grid { grid-template-columns: 1fr; } th, td { padding: 9px 10px; } .modal header h2 { font-size: 1rem; } }
