/* LabPortal — shared interface tokens and components. */
:root {
  --bg: #f5f7f8; --surface: #ffffff; --surface-soft: #f8fafb; --surface-hover: #f0f4f5;
  --text: #1b2d39; --text-secondary: #536672; --muted: #7a8b95; --border: #e3e9ec;
  --accent: #147b68; --accent-hover: #106653; --accent-soft: #e9f5ef; --accent-text: #176e5b;
  --nav-bg: #ffffff; --nav-text: #586c77; --nav-active: #eaf5f1; --nav-active-text: #116d5a;
  --danger: #b24546; --danger-soft: #fcf0f0; --warning: #966321; --warning-soft: #fff7e9;
  --shadow: 0 4px 20px rgba(27, 45, 57, .035); --shadow-lg: 0 20px 70px rgba(20, 37, 47, .2);
  --radius: 13px; --sidebar-width: 258px; --ring: #45a58c;
}
:root[data-theme="dark"] {
  --bg: #111b24; --surface: #182530; --surface-soft: #1c2c38; --surface-hover: #223541;
  --text: #e6eef2; --text-secondary: #a5b7c2; --muted: #8399a7; --border: #2b3c49;
  --accent: #69cbb0; --accent-hover: #88dbc3; --accent-soft: #1e3935; --accent-text: #82d6bd;
  --nav-bg: #15212b; --nav-text: #a2b6c2; --nav-active: #213c37; --nav-active-text: #8bdcc3;
  --danger: #f09898; --danger-soft: #3d292e; --warning: #e1b879; --warning-soft: #3c3427;
  --shadow: 0 4px 20px rgba(0, 0, 0, .06); --shadow-lg: 0 20px 70px rgba(0, 0, 0, .4);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, .btn:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img, svg { vertical-align: middle; }
svg { flex-shrink: 0; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 30px; font-weight: 650; letter-spacing: -1px; line-height: 1.25; margin-bottom: 0; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.35px; line-height: 1.35; margin-bottom: 8px; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.15px; margin-bottom: 6px; }
p { margin-bottom: 12px; }
small { font-size: 12px; }
strong { font-weight: 600; }
hr { height: 1px; border: 0; background: var(--border); margin: 24px 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--accent-text); }
.skip-link { position: fixed; left: 20px; top: -70px; z-index: 100; background: var(--accent); color: var(--surface); border-radius: 8px; padding: 12px 20px; }
.skip-link:focus { top: 16px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.muted, .text-muted { color: var(--text-secondary); }
.text-small { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack-small { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 30; display: flex; flex-direction: column; background: var(--nav-bg); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); margin: 33px 26px 31px; font-size: 22px; font-weight: 750; letter-spacing: -.75px; line-height: 1.05; }
.brand:hover { color: var(--text); }
.brand-light { font-weight: 450; }
.brand small { display: block; color: var(--muted); font-size: 8px; letter-spacing: 1.55px; font-weight: 600; margin-top: 8px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 12px); gap: 4px; transform: rotate(-4deg); }
.brand-mark i { width: 12px; height: 12px; background: var(--accent); display: block; border-radius: 3px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { opacity: .45; }
.workspace-label { margin: 0 17px 26px; padding: 13px 11px; border: 1px solid var(--border); border-radius: 9px; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 650; }
.workspace-label small { font-size: 9px; display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.workspace-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.online-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #61af90; margin-left: auto; }
.sidebar-nav { padding: 0 16px; overflow-y: auto; }
.nav-section-label { font-size: 9px; color: var(--muted); font-weight: 650; letter-spacing: 1.55px; text-transform: uppercase; padding: 0 13px; margin-bottom: 10px; }
.nav-section-spaced { margin-top: 30px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 13px; margin: 3px 0; border-radius: 8px; color: var(--nav-text); font-size: 12px; font-weight: 500; }
.nav-link .icon { width: 18px; height: 18px; opacity: .85; }
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { color: var(--nav-active-text); background: var(--nav-active); font-weight: 650; }
.nav-link.active::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; right: 14px; background: currentColor; }
.sidebar-bottom { margin-top: auto; padding: 26px 17px 19px; }
.workspace-note { display: flex; align-items: center; gap: 9px; padding: 16px 8px 24px; font-size: 10px; color: var(--text-secondary); }
.workspace-note .icon { width: 18px; height: 18px; color: var(--accent); }
.workspace-note small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.account-card { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 19px 2px 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; flex: 0 0 35px; border-radius: 50%; background: #f0e9dd; color: #876f45; font-size: 12px; font-weight: 650; }
[data-theme="dark"] .avatar { background: #3b352d; color: #d7c09d; }
.avatar-teal { background: var(--accent-soft); color: var(--accent-text); }
.account-details { flex: 1; min-width: 0; }
.account-details strong { display: block; max-width: 137px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.account-details small { display: block; color: var(--muted); font-size: 10px; }
.account-card form { margin: 0; }
.account-card .icon-button { width: 26px; height: 30px; }
.account-card .icon-button .icon { width: 16px; height: 16px; }
.main-shell { margin-left: var(--sidebar-width); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 0 38px; background: var(--surface); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-left { gap: 13px; font-size: 11px; }
.breadcrumb-root { color: var(--muted); }
.breadcrumb-slash { color: var(--border); font-size: 16px; }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }
.today-date { color: var(--muted); font-size: 10px; }
.topbar-divider { height: 18px; width: 1px; background: var(--border); }
.live-indicator { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-text); font-size: 9px; white-space: nowrap; }
.live-indicator i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.live-indicator.is-reconnecting { color: var(--warning); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text-secondary); border: 0; padding: 6px; border-radius: 7px; width: 34px; height: 34px; }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--text-secondary); border: 0; border-radius: 7px; padding: 8px; font-size: 10px; font-weight: 500; }
.theme-toggle:hover { background: var(--surface-hover); }
.theme-toggle .icon { width: 16px; height: 16px; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: inline; }
[data-theme="dark"] .theme-icon-moon { display: none; }
.mobile-menu, .sidebar-scrim { display: none; }
.main-content { max-width: 1540px; margin: 0 auto; padding: 35px 38px 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.7px; text-transform: uppercase; margin-bottom: 8px; }
.page-description { color: var(--text-secondary); font-size: 12px; margin: 10px 0 0; max-width: 700px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 600; line-height: 1.5; min-height: 39px; white-space: nowrap; transition: box-shadow .15s; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 3px #112b2010; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
[data-theme="dark"] .btn-primary { color: #102c24; }
.btn-secondary { border-color: var(--border); color: var(--text-secondary); background: var(--surface); }
.btn-secondary:hover { color: var(--text); background: var(--surface-hover); border-color: var(--muted); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, var(--danger-soft)); color: var(--danger); }
.btn-ghost { color: var(--text-secondary); background: transparent; }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 6px 11px; min-height: 31px; font-size: 10px; }
.btn-wide { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.text-link .icon { width: 14px; height: 14px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.card + .card { margin-top: 22px; }
.stack > .card + .card, .dashboard-grid > .card + .card { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; }
.card-header h2 { font-size: 14px; }
.card-header p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.card-body { padding: 24px; }
.card-footer { padding: 17px 24px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.card form > .page-actions, .card-body > .page-actions { padding-top: 8px; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-heading .icon { color: var(--accent); }
.section-heading h2 { margin: 0; }
.welcome-card { position: relative; overflow: hidden; border-radius: var(--radius); background: #173e43; color: #ecf7f4; padding: 30px 32px; display: flex; align-items: center; justify-content: space-between; min-height: 174px; margin-bottom: 24px; }
.welcome-card::after { content: ""; width: 300px; height: 300px; border: 1px solid #9ad7c31c; border-radius: 50%; position: absolute; right: -70px; top: -70px; box-shadow: 0 0 0 45px #9ad7c309, 0 0 0 90px #9ad7c305; pointer-events: none; }
.welcome-copy { position: relative; z-index: 1; max-width: 620px; }
.welcome-card .eyebrow { color: #94c8b9; font-size: 9px; letter-spacing: 1.9px; margin-bottom: 10px; }
.welcome-card h2 { font-size: 26px; letter-spacing: -.7px; font-weight: 550; margin-bottom: 9px; }
.welcome-card p:not(.eyebrow) { font-size: 12px; color: #b9d0cc; margin-bottom: 0; max-width: 490px; }
.welcome-emblem { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 78px; height: 78px; margin-right: 32px; border: 1px solid #95cbb633; border-radius: 19px; background: #c0f3db0b; transform: rotate(-7deg); }
.welcome-emblem .brand-mark { transform: rotate(7deg); grid-template-columns: repeat(2, 17px); gap: 5px; }
.welcome-emblem .brand-mark i { width: 17px; height: 17px; background: #a6dbc8; border-radius: 5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 27px; }
.stat-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 20px 21px 17px; box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.stat-label { color: var(--text-secondary); font-size: 11px; font-weight: 500; }
.stat-icon { color: var(--muted); width: 28px; height: 28px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; }
.stat-icon .icon { width: 14px; height: 14px; }
.stat-value { font-size: 30px; line-height: 1.1; font-weight: 650; letter-spacing: -.75px; display: block; }
.stat-footnote { display: block; color: var(--muted); font-size: 10px; margin: 9px 0 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; gap: 24px; }
.dashboard-section-label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 30px 0 14px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.module-card { display: flex; flex-direction: column; padding: 23px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; min-height: 177px; transition: transform .15s; }
.module-card:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.module-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.module-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }
.module-icon .icon { width: 18px; height: 18px; }
.module-card-top > .icon { color: var(--muted); width: 15px; height: 15px; }
.module-card h3 { font-size: 12px; }
.module-card p { color: var(--muted); font-size: 11px; margin: 3px 0 0; max-width: 255px; }
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; align-items: flex-start; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.info-row:first-child { padding-top: 0; }.info-row:last-child { padding-bottom: 0; border: 0; }
.info-row-icon { width: 29px; height: 29px; display: inline-flex; justify-content: center; align-items: center; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; color: var(--muted); }
.info-row-icon .icon { width: 15px; height: 15px; }
.info-row h3 { font-size: 11px; margin: 0 0 4px; }
.info-row p { color: var(--muted); font-size: 10px; margin: 0; }
.info-row .badge { margin-top: 7px; }
.table-wrap { overflow-x: auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.data-table th { padding: 12px 22px; background: var(--surface-soft); color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .65px; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 17px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface)); }
.data-table td p { margin: 0; }.data-table td .muted { font-size: 11px; }
.data-table .page-actions { gap: 7px; flex-wrap: nowrap; }
.data-table form { margin: 0; }
.table-primary { font-size: 12px; font-weight: 550; color: var(--text); display: block; }
a.table-primary:hover { color: var(--accent); }
.table-secondary { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.table-person { display: flex; align-items: center; gap: 11px; }
.table-person .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 4px 8px; font-size: 9px; line-height: 1.3; font-weight: 550; white-space: nowrap; background: var(--surface-hover); color: var(--text-secondary); }
.badge::before { content: ""; display: inline-block; width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.badge-requested, .badge-pending, .badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-approved, .badge-delivered, .badge-received, .badge-active, .badge-success, .badge-connected, .badge-completed { background: var(--accent-soft); color: var(--accent-text); }
.badge-ordered, .badge-info { background: #edf2fc; color: #5377ac; }
[data-theme="dark"] .badge-ordered, [data-theme="dark"] .badge-info { background: #27364d; color: #a7c1ea; }
.badge-declined, .badge-failed, .badge-error { background: var(--danger-soft); color: var(--danger); }
.badge-withdrawn, .badge-inactive, .badge-disabled { background: var(--surface-hover); color: var(--muted); }
.empty-state { text-align: center; padding: 48px 24px; max-width: 470px; margin: 0 auto; }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); border-radius: 14px; width: 53px; height: 53px; margin-bottom: 18px; }
.empty-state-icon .icon { width: 24px; height: 24px; }
.empty-state h2, .empty-state h3 { font-size: 14px; margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: 11px; margin: 0 auto 20px; max-width: 300px; line-height: 1.75; }
.empty-state .btn { font-size: 10px; }
.empty-state-compact { padding: 40px 24px; }
.empty-state-compact .empty-state-icon { width: 43px; height: 43px; border-radius: 12px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); border-radius: 14px; width: 53px; height: 53px; margin-bottom: 18px; font-size: 26px; }
.main-content > .page-actions { justify-content: space-between; margin-bottom: 22px; align-items: center; }
.main-content > .page-actions p { margin: 0; font-size: 12px; }
.card-header.filter-bar { margin-bottom: 0; flex-wrap: wrap; }
.card-header .tabs { margin-bottom: 0; border: 0; }
.card-header .tab { padding-left: 0; padding-right: 18px; }
.card-header .search-form { flex: 0 1 340px; }
.card-header .search-form input[type="search"] { flex: 1; min-width: 120px; width: 180px; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dialog-footer #request-total { display: block; margin-top: 3px; font-size: 21px; letter-spacing: -.5px; }
[data-live-region="backup-stats"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-live-region="backup-stats"] .stat-card > strong { font-size: 19px; margin-top: 14px; }
details summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 600; padding: 2px 0; }
details > div { margin-top: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--surface-hover); padding: 2px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 24px; }
.form-grid .full-width, .form-grid .field-wide { grid-column: 1 / -1; }
.form-grid .field-full { grid-column: 1 / -1; }
.btn-small { padding: 6px 11px; min-height: 31px; font-size: 10px; }
.button-group { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr); gap: 24px; align-items: start; }
.detail-layout > .card + .card { margin-top: 0; }
.stat-card > strong { display: block; font-size: 30px; line-height: 1.2; font-weight: 650; letter-spacing: -.75px; margin: 10px 0 6px; }
.stat-card > span { display: block; color: var(--text-secondary); font-size: 11px; }
.stat-card > span:last-child { color: var(--muted); font-size: 10px; }
.order-modal .dialog-footer { justify-content: space-between; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.field > label, label.field-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.required-mark { color: var(--accent); margin-left: 2px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); min-height: 41px; padding: 10px 12px; font-size: 12px; line-height: 1.5; transition: box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
input:disabled, textarea:disabled, select:disabled { opacity: .6; cursor: not-allowed; background: var(--surface-soft); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--accent); vertical-align: middle; }
input[type="file"] { background: var(--surface-soft) !important; padding: 7px !important; font-size: 11px !important; }
input[type="file"]::file-selector-button { border: 0; background: var(--surface); color: var(--text-secondary); border-radius: 4px; padding: 6px 10px; margin-right: 10px; font: inherit; cursor: pointer; }
textarea { min-height: 100px; resize: vertical; }
.field-help, .helptext { display: block; color: var(--muted); font-size: 10px; line-height: 1.65; }
.field-help ul, .helptext ul { padding-left: 17px; margin: 3px 0 0; }
.checkbox-field { border: 1px solid var(--border); border-radius: 8px; padding: 14px 15px; background: var(--surface-soft); }
.checkbox-field > label { display: flex; align-items: center; gap: 10px; font-weight: 550; font-size: 12px; color: var(--text); }
.checkbox-field .field-help { margin-left: 26px; }
.errorlist { list-style: none; padding: 0; margin: 3px 0 0; color: var(--danger); font-size: 11px; }
.errorlist li + li { margin-top: 4px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.form-errors { padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--danger) 20%, var(--border)); background: var(--danger-soft); border-radius: 8px; color: var(--danger); font-size: 12px; margin-bottom: 20px; }
.form-errors .errorlist { margin: 0; }
.form-section { padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--border); }
.form-section h3 { font-size: 13px; margin-bottom: 6px; }
.form-section > p { font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.form-section:last-child { padding: 0; margin: 0; border: 0; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 24px; align-items: start; }
.form-layout > .card + .card { margin: 0; }
.form-aside { padding: 25px; }
.form-aside .module-icon { margin-bottom: 15px; }
.form-aside h3 { font-size: 13px; }
.form-aside p, .form-aside li { font-size: 11px; color: var(--muted); line-height: 1.8; }
.form-aside ul { margin: 14px 0 0; padding-left: 17px; }
.form-aside li + li { margin-top: 10px; }
.room-access-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.room-access-field legend { padding: 0; margin-bottom: 7px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.room-choices > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.room-choices label { display: flex; align-items: center; gap: 10px; height: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); font-size: 11px; cursor: pointer; }
.room-access-field.has-error .room-choices label { border-color: var(--danger); }
.membership-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; margin: 0; }
.membership-details > div { min-width: 0; }
.membership-details dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.membership-details dd { margin: 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.membership-room { display: block; }
.membership-room + .membership-room { margin-top: 4px; }
.badge-locked { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.badge-locked .icon { width: 12px; height: 12px; }
.member-table-actions { justify-content: flex-end; }
.member-table .table-secondary + .table-secondary { margin-top: 3px; }
.account-details { color: var(--text); }
.research-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.research-tags:empty { display: none; }
.research-tag { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 6px 4px 12px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border)); border-radius: 20px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; }
.research-tag > span { min-width: 0; overflow-wrap: anywhere; }
.research-tag button { flex-shrink: 0; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; }
.research-tag button:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.research-entry { display: flex; align-items: start; gap: 8px; }
.research-entry input { min-width: 0; flex: 1; }
.research-entry .btn { flex-shrink: 0; min-height: 41px; }
.research-editor [data-research-enhanced] > .field-help { margin-top: 7px; }
.research-status:empty { display: none; }
.research-status.is-error { color: var(--danger); }
@media (max-width: 600px) { .membership-details, .room-choices > div { grid-template-columns: 1fr; }.membership-details { gap: 18px; } }
.settings-note { border-left: 2px solid var(--accent); background: var(--accent-soft); padding: 13px 16px; font-size: 11px; color: var(--accent-text); border-radius: 0 7px 7px 0; }
.settings-note p { margin-bottom: 0; }
.message-stack { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.alert p:last-child { margin-bottom: 0; }.alert .icon-button { height: 25px; width: 25px; flex-shrink: 0; }
.alert-success { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 20%, var(--border)); }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, var(--border)); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, var(--border)); }
.tabs { display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 17px; color: var(--muted); font-size: 12px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab-active, .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .badge { font-size: 9px; padding: 2px 6px; }.tab .badge::before { display: none; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.filter-bar form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex: 1; }
.filter-bar input { max-width: 320px; }.filter-bar select { max-width: 180px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px; font-size: 11px; color: var(--muted); }
.modal { border: 1px solid var(--border); border-radius: 15px; color: var(--text); background: var(--surface); padding: 0; width: min(860px, calc(100vw - 40px)); max-height: calc(100vh - 60px); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: #0c1c2aba; backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 25px 28px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { font-size: 21px; margin-bottom: 5px; }.dialog-header p { font-size: 12px; color: var(--muted); margin: 0; }
.dialog-body { padding: 25px 28px; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.item-form { padding: 20px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); margin-bottom: 18px; }
.item-form-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.item-form-header h3, .item-form-header h4 { margin: 0; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.detail-label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.detail-value { font-size: 13px; overflow-wrap: anywhere; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; border-left: 1px solid var(--border); margin-left: 5px; padding: 0 0 25px 21px; font-size: 12px; }
.timeline-item::before { content: ""; position: absolute; width: 8px; height: 8px; left: -4.5px; top: 5px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item p { margin-bottom: 5px; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 9px; padding: 30px 0 6px; margin-top: 12px; }
.footer-dot { margin: 0 6px; color: var(--border); }
.simple-card { max-width: 660px; }
/* Sign-in */
.auth-body { min-height: 100vh; background: var(--surface); }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-story { background: #14373d; color: #edf6f2; position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 43px 10.5% 35px; }
.auth-story .brand { color: #edf6f2; margin: 0; }.auth-story .brand small { color: #91b4ab; }.auth-story .brand-mark i { background: #8ed2b8; }
.auth-story-copy { position: relative; z-index: 1; margin-top: auto; padding-top: 66px; }
.auth-story .eyebrow { color: #90c9b4; font-size: 10px; letter-spacing: 2px; margin-bottom: 18px; }
.auth-story h1 { max-width: 480px; font-size: clamp(32px, 3.35vw, 52px); font-weight: 500; letter-spacing: -1.8px; line-height: 1.16; }
.auth-story h1 span { color: #94d1b8; }
.auth-story-description { max-width: 365px; color: #afc8c1; font-size: 13px; line-height: 1.9; margin: 23px 0 0; }
.auth-constellation { position: relative; width: 100%; height: 200px; margin: 24px 0; opacity: .9; }
.auth-constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.auth-feature-list { display: flex; flex-wrap: wrap; gap: 11px 22px; margin-top: auto; padding-top: 30px; border-top: 1px solid #a5d1bc24; color: #bad1c9; font-size: 10px; }
.auth-feature-list span { display: inline-flex; align-items: center; gap: 6px; }.auth-feature-list .icon { width: 13px; height: 13px; color: #83c8ae; }
.auth-form-panel { display: flex; flex-direction: column; padding: 30px 11%; background: var(--surface); }
.auth-topbar { display: flex; justify-content: flex-end; }.auth-topbar .theme-toggle { font-size: 11px; }
.auth-form-container { width: 100%; max-width: 360px; margin: auto; padding: 55px 0; }
.auth-form-container .eyebrow { font-size: 9px; letter-spacing: 1.8px; margin-bottom: 13px; }
.auth-form-container h2 { font-size: 30px; font-weight: 600; letter-spacing: -.9px; margin-bottom: 11px; }
.auth-intro { font-size: 12px; color: var(--muted); margin-bottom: 32px; }
.auth-form .field + .field { margin-top: 20px; }
.auth-form .field > label { font-size: 11px; }
.auth-form input { min-height: 46px !important; font-size: 12px !important; }
.auth-form .btn { margin-top: 26px; min-height: 45px; font-size: 12px; }
.password-wrap { position: relative; }.password-wrap input { padding-right: 58px !important; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: var(--muted); font-size: 10px; padding: 5px; border-radius: 3px; }
.auth-access-note { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; line-height: 1.8; display: flex; align-items: flex-start; gap: 9px; }
.auth-access-note .icon { margin-top: 2px; width: 15px; height: 15px; color: var(--accent); }
.auth-footer { text-align: center; color: var(--muted); font-size: 9px; padding-bottom: 5px; }
.auth-mobile-brand { display: none; }
.error-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 35px; }
.error-topbar .brand { margin: 0; }
.error-page { max-width: 590px; margin: 10vh auto 30px; padding: 30px; text-align: center; }
.error-page h1 { font-size: 31px; margin-bottom: 16px; }.error-page > p.muted { font-size: 13px; line-height: 1.8; margin-bottom: 27px; }.error-page .page-actions { justify-content: center; }.error-page .empty-state-icon { margin-bottom: 22px; }
@media (min-width: 1600px) { .main-content { padding-top: 45px; }.auth-story { padding-left: 14%; padding-right: 14%; }.auth-constellation { height: 260px; } }
@media (max-width: 1200px) { :root { --sidebar-width: 230px; }.topbar { padding: 0 28px; }.main-content { padding: 30px 28px 20px; }.brand { margin-left: 23px; }.dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 18px; }.stat-card { padding: 17px; }.stat-grid { gap: 12px; }.data-table th, .data-table td { padding-left: 17px; padding-right: 17px; }.welcome-emblem { margin-right: 10px; }.auth-story { padding-left: 9%; padding-right: 9%; }.auth-form-panel { padding-left: 10%; padding-right: 10%; } }
@media (max-width: 1050px) { .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }.module-grid { gap: 12px; }.form-layout { grid-template-columns: 1fr; }.form-aside ul { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.form-aside li + li { margin-top: 0; }.today-date { display: none; }.topbar-divider { display: none; }.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.welcome-emblem { display: none; } }
@media (max-width: 800px) {
  :root { --sidebar-width: 258px; }.sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }.main-shell { margin-left: 0; }.nav-open .sidebar { transform: translateX(0); }.nav-open { overflow: hidden; }.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 29; border: 0; background: #0c1c2a99; backdrop-filter: blur(2px); }.mobile-menu { display: inline-flex; margin-left: -5px; }.topbar { height: 66px; padding: 0 23px; }.main-content { padding: 27px 23px 18px; }.page-header { margin-bottom: 24px; }.page-header h1 { font-size: 26px; }.breadcrumb-root, .breadcrumb-slash { display: none; }.topbar-left { gap: 9px; }.topbar-actions { gap: 7px; }.theme-toggle { padding: 8px; }.module-card { padding: 18px; }.page-footer { padding-top: 25px; }.auth-layout { grid-template-columns: .9fr 1fr; }.auth-story { padding: 34px 10% 30px; }.auth-story h1 { font-size: 34px; }.auth-story-description { font-size: 12px; }.auth-story .brand { font-size: 20px; }.auth-story .brand small { font-size: 7px; }.auth-form-panel { padding: 24px 9%; }.auth-constellation { height: 165px; }.auth-feature-list { display: grid; gap: 10px; }.auth-story-copy { padding-top: 60px; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 18px; }.main-content { padding: 25px 18px 15px; }.page-header { align-items: flex-start; flex-wrap: wrap; gap: 17px; }.page-header .page-actions { width: 100%; }.page-header h1 { font-size: 25px; }.page-description { font-size: 11px; }.eyebrow { font-size: 9px; }.topbar .theme-toggle span { display: none; }.topbar .theme-toggle { width: 34px; height: 34px; }.stat-grid { gap: 10px; margin-bottom: 22px; }.stat-card { padding: 15px; }.stat-top { margin-bottom: 11px; gap: 3px; }.stat-label { font-size: 10px; }.stat-icon { width: 25px; height: 25px; }.stat-value { font-size: 27px; }.stat-footnote { font-size: 9px; }.welcome-card { padding: 25px; min-height: 175px; }.welcome-card h2 { font-size: 23px; }.welcome-card p:not(.eyebrow) { font-size: 11px; }.welcome-card .eyebrow { font-size: 8px; }.module-grid { grid-template-columns: 1fr; }.module-card { min-height: 0; padding: 20px; }.module-card-top { margin-bottom: 13px; }.module-card p { max-width: none; }.dashboard-grid { gap: 20px; }.card-header { padding: 18px; }.card-header h2 { font-size: 13px; }.card-body { padding: 20px; }.card-footer { padding: 16px 20px; }.data-table th, .data-table td { padding: 14px 17px; }.form-grid, .detail-grid { grid-template-columns: 1fr; gap: 19px; }.form-aside ul { display: block; }.form-aside li + li { margin-top: 10px; }.page-footer { flex-direction: column; gap: 3px; font-size: 8px; }.page-footer > span:last-child { display: none; }.empty-state { padding: 37px 22px; }.tab { padding: 11px 12px; font-size: 11px; }.modal { width: calc(100vw - 24px); max-height: calc(100dvh - 30px); }.dialog-header, .dialog-body { padding: 20px; }.dialog-footer { padding: 16px 20px; }.dialog-header h2 { font-size: 20px; }.item-form { padding: 16px; }.filter-bar form { align-items: stretch; }.filter-bar input { max-width: none; }.filter-bar select { max-width: none; flex: 1; width: auto; }.auth-layout { display: block; }.auth-story { display: none; }.auth-form-panel { min-height: 100dvh; padding: 23px 28px; }.auth-topbar { justify-content: space-between; align-items: center; }.auth-mobile-brand { display: flex; margin: 0; font-size: 19px; }.auth-mobile-brand .brand-mark { grid-template-columns: repeat(2, 10px); gap: 3px; }.auth-mobile-brand .brand-mark i { width: 10px; height: 10px; }.auth-mobile-brand small { display: none; }.auth-topbar .theme-toggle span { display: none; }.auth-form-container { padding: 50px 0; }.auth-form-container h2 { font-size: 32px; }.auth-footer { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 600px) { [data-live-region="backup-stats"] { grid-template-columns: 1fr; }.card-header .search-form { flex: 1 1 100%; }.card-header .tab { padding-right: 14px; }.main-content > .page-actions > form, .main-content > .page-actions > .btn { margin-top: 5px; } }
