:root {
  --ink: #172421;
  --muted: #687571;
  --line: #d8dfdc;
  --line-strong: #b9c6c1;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --brand: #163c3a;
  --brand-2: #255a54;
  --accent: #d86a3b;
  --warn: #a66716;
  --bad: #a33c35;
  --good: #246548;
  --sidebar: 176px;
  --topbar: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); z-index: 20; }
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.presence-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.brand-lockup strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand-lockup span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.top-actions, .heading-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button, .primary-button { border-radius: 7px; padding: 8px 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 12px; font-weight: 650; }
.primary-button { background: var(--brand); color: #fff; border-color: var(--brand); }
.quiet-button:hover { border-color: var(--brand-2); }
.primary-button:hover { background: var(--brand-2); }
.sidebar { position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); padding: 18px 10px; background: #eff2ef; border-right: 1px solid var(--line); z-index: 10; }
.nav-item { width: 100%; border: 0; background: transparent; color: #42504c; text-align: left; padding: 9px 12px; border-radius: 6px; margin: 1px 0; font-size: 13px; font-weight: 600; }
.nav-item:hover { background: #e1e7e3; }
.nav-item.active { background: var(--brand); color: #fff; }
.sidebar-foot { position: absolute; left: 16px; bottom: 18px; color: #7b8682; font-size: 10px; line-height: 1.55; }
.workspace { margin-left: var(--sidebar); padding: calc(var(--topbar) + 28px) 30px 42px; min-height: 100vh; }
.view { display: none; max-width: 1500px; margin: 0 auto; }
.view.active { display: block; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.page-heading h1 { margin: 2px 0 0; font-size: 25px; line-height: 1.15; letter-spacing: -.03em; font-weight: 740; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: .11em; font-weight: 800; font-size: 10px; }
.summary-strip { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; margin-bottom: 18px; }
.summary-cell { padding: 13px 14px 12px; border-right: 1px solid var(--line); min-width: 0; }
.summary-cell:last-child { border-right: 0; }
.summary-cell span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .055em; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-cell strong { display: block; margin-top: 5px; font-size: 20px; letter-spacing: -.03em; }
.summary-cell em { display: block; margin-top: 3px; font-size: 10px; color: var(--good); font-style: normal; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.wide-panel { margin-top: 18px; }
.panel-head { min-height: 48px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 760; letter-spacing: -.01em; }
.panel-head span { color: var(--muted); font-size: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { text-align: left; color: #6d7975; background: #fafbf9; padding: 9px 12px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; font-size: 9px; font-weight: 800; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-employee] { cursor: pointer; }
tbody tr[data-employee]:hover { background: #f5f8f6; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.avatar { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #dbe6e1; color: var(--brand); font-weight: 800; font-size: 10px; }
.person-cell strong { display: block; font-size: 11px; }
.person-cell span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 7px; background: #eef3f0; color: #50605a; font-size: 9px; font-weight: 750; white-space: nowrap; }
.badge.good { background: #e7f2ec; color: var(--good); }
.badge.warn { background: #f7efdf; color: var(--warn); }
.badge.bad { background: #f6e8e6; color: var(--bad); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; color: #52605c; }
.bar-list { padding: 10px 14px 14px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr 42px; align-items: center; gap: 10px; padding: 8px 0; }
.bar-row span { font-size: 10px; color: #4f5d58; }
.bar-progress { width: 100%; height: 7px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #edf0ee; }
.bar-progress::-webkit-progress-bar { background: #edf0ee; }
.bar-progress::-webkit-progress-value { background: var(--brand-2); border-radius: 999px; }
.bar-progress::-moz-progress-bar { background: var(--brand-2); border-radius: 999px; }
.bar-value { text-align: right; font-size: 10px; font-weight: 760; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 18px; }
.key-values { margin: 0; padding: 5px 14px 12px; }
.key-values div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid #edf0ee; }
.key-values div:last-child { border-bottom: 0; }
.key-values dt { color: var(--muted); font-size: 10px; }
.key-values dd { margin: 0; font-size: 10px; font-weight: 700; text-align: right; }
.chip-list { padding: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.chip-list span { border: 1px solid var(--line); background: #f8faf8; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 650; }
.doctor-list { padding: 8px 14px 13px; }
.doctor-list p { margin: 0; padding: 7px 0; font-size: 10px; border-bottom: 1px solid #edf0ee; }
.doctor-list p:last-child { border-bottom: 0; }
.doctor-list b { display: inline-block; width: 42px; color: var(--good); font-size: 9px; }
.doctor-list p:last-child b { color: var(--warn); }
.role-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.role-tabs button { border: 1px solid var(--line); background: #fff; padding: 6px 9px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.role-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.insight-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.insight-stat { padding: 16px; border-bottom: 1px solid var(--line); }
.insight-stat:last-child { border-bottom: 0; }
.insight-stat strong { font-size: 24px; letter-spacing: -.03em; }
.insight-stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.employee-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0; box-shadow: 0 24px 80px rgba(18, 37, 31, .24); color: var(--ink); }
.employee-dialog::backdrop { background: rgba(18, 31, 28, .45); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 22px; line-height: 1; }
.employee-profile { display: grid; grid-template-columns: 220px 1fr; min-height: 480px; }
.profile-rail { padding: 28px 22px; background: var(--brand); color: #fff; }
.profile-avatar { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: #e4eee9; color: var(--brand); font-size: 28px; font-weight: 800; border: 4px solid rgba(255,255,255,.2); }
.profile-rail h2 { margin: 16px 0 3px; font-size: 22px; letter-spacing: -.03em; }
.profile-rail p { margin: 0; color: #d8e5e1; font-size: 11px; line-height: 1.5; }
.profile-main { padding: 28px; }
.profile-main h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 16px 0 22px; }
.profile-actions a, .social-link { text-decoration: none; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; color: var(--brand); background: #fff; font-size: 10px; font-weight: 720; }
.profile-socials { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.profile-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.surface-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; background: #fafbf9; }
.surface-card strong { font-size: 11px; }
.surface-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
@media (max-width: 980px) {
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-cell:nth-child(3n) { border-right: 0; }
  .two-column, .insight-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --sidebar: 0px; --topbar: 58px; }
  .topbar { padding: 0 12px; }
  .brand-lockup { min-width: 0; }
  .brand-lockup span { display: none; }
  #roleButton { display: none; }
  .sidebar { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 56px; padding: 5px 6px; display: flex; align-items: center; gap: 2px; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); }
  .nav-item { min-width: 76px; text-align: center; padding: 8px 7px; font-size: 10px; }
  .sidebar-foot { display: none; }
  .workspace { margin-left: 0; padding: calc(var(--topbar) + 20px) 12px 78px; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; }
  .page-heading h1 { font-size: 22px; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-cell, .summary-cell:nth-child(3n) { border-right: 1px solid var(--line); }
  .summary-cell:nth-child(2n) { border-right: 0; }
  .summary-cell strong { font-size: 18px; }
  .panel { border-radius: 7px; }
  .employee-profile { grid-template-columns: 1fr; }
  .profile-rail { padding: 22px; }
  .profile-main { padding: 22px; }
  .profile-avatar { width: 76px; height: 76px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; max-width: min(360px, calc(100vw - 36px)); padding: 11px 14px; border-radius: 8px; background: #172421; color: #fff; font-size: 11px; line-height: 1.45; box-shadow: 0 14px 40px rgba(18,37,31,.24); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast strong { display: block; margin-bottom: 2px; }
@media (max-width: 720px) { .toast { bottom: 70px; left: 12px; right: 12px; max-width: none; } }
