/* theme.css — presentation styles only. Application decisions and data operations belong in C# code-behind/services. */
/* Vitaloop: the supplied navy, sage and white identity, in two complete themes. */
:root,html[data-theme="light"] {
  color-scheme:light;
  --theme-page:#f3f6f5;--theme-glow:#e4eeea;--theme-surface:#ffffff;--theme-raised:#f6f9f7;
  --theme-text:#17324d;--theme-muted:#526777;--theme-accent:#326540;--theme-accent-hover:#214b30;
  --theme-border:#c8d8d0;--theme-input:#ffffff;--theme-input-border:#8fa99d;--theme-soft:#e5efe7;
  --theme-selected:#dcebdd;--theme-hover:#edf4ef;--theme-nav:#ffffff;--theme-nav-text:#17324d;
  --theme-nav-muted:#526777;--theme-button:#326540;--theme-button-text:#ffffff;--theme-focus:#326540;
  --theme-info:#edf4f8;--theme-info-text:#284d68;--theme-info-border:#9ab8c9;
  --theme-warning:#fff3db;--theme-warning-text:#755015;--theme-warning-border:#c7a15a;
  --theme-error:#fff0ef;--theme-error-text:#8d313e;--theme-error-border:#d39aa1;
  --theme-shadow:0 4px 18px #17324d09;
}
html[data-theme="dark"] {
  color-scheme:dark;
  --theme-page:#091726;--theme-glow:#14324b;--theme-surface:#10283c;--theme-raised:#153249;
  --theme-text:#edf4f9;--theme-muted:#b6c8d5;--theme-accent:#acd7b5;--theme-accent-hover:#e3f2e6;
  --theme-border:#36556a;--theme-input:#0a1e30;--theme-input-border:#648095;--theme-soft:#213f35;
  --theme-selected:#294f3e;--theme-hover:#1a3a48;--theme-nav:#0b2032;--theme-nav-text:#e3edf5;
  --theme-nav-muted:#b3c8d7;--theme-button:#326b46;--theme-button-text:#ffffff;--theme-focus:#b2dcbb;
  --theme-info:#193a50;--theme-info-text:#d3e7f4;--theme-info-border:#4e7b98;
  --theme-warning:#44351d;--theme-warning-text:#ffdc9c;--theme-warning-border:#a58345;
  --theme-error:#442633;--theme-error-text:#ffd1d9;--theme-error-border:#a86978;
  --theme-shadow:0 5px 22px #0003;
}
:root[data-theme] body {
  --ink:var(--theme-text);--muted:var(--theme-muted);--teal:var(--theme-accent);--deep:#17324d;
  --lime:#84b98f;--bg:var(--theme-page);--line:var(--theme-border);--white:var(--theme-surface);
  --danger:var(--theme-error-text);--amber:var(--theme-warning-text);--shadow:var(--theme-shadow);
  color-scheme:inherit;background:var(--theme-page);color:var(--theme-text);
}
:root[data-theme] body.tech-dashboard {background:radial-gradient(ellipse at 65% 0,var(--theme-glow),transparent 65%),var(--theme-page)}
:root[data-theme] a {color:var(--theme-accent)}
:root[data-theme] a:hover {color:var(--theme-accent-hover)}
:root[data-theme] :focus-visible {outline:3px solid var(--theme-focus);outline-offset:3px}
:root[data-theme] .sidebar {background:var(--theme-nav);color:var(--theme-nav-text);border-right:1px solid var(--theme-border)}
:root[data-theme] .sidebar .brand,:root[data-theme] .sidebar .nav-close {color:var(--theme-nav-text)}
:root[data-theme] .brand small,:root[data-theme] .network-label,:root[data-theme] .nav-group summary,:root[data-theme] .sidebar-bottom {color:var(--theme-nav-muted)}
:root[data-theme] .sidebar-bottom {border-color:var(--theme-border)}
:root[data-theme] .nav-link {color:var(--theme-nav-text)}
:root[data-theme] .nav-link:hover {background:var(--theme-hover)}
:root[data-theme] .nav-link.active {background:var(--theme-selected);color:var(--theme-text);box-shadow:inset 3px 0 #84b98f}
:root[data-theme] .topbar {background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text)}
:root[data-theme] .profile-chip,:root[data-theme] .icon-button {color:var(--theme-text)}
:root[data-theme] .avatar {background:var(--theme-soft);color:var(--theme-accent);border-color:var(--theme-border)}
:root[data-theme] .panel,:root[data-theme] .filter-bar,:root[data-theme] .kpi,:root[data-theme] button.kpi-link,
:root[data-theme] .patient-metric,:root[data-theme] .patient-workspace-nav,:root[data-theme] .patient-health-strip {
  background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text);box-shadow:var(--theme-shadow)
}
:root[data-theme] .patient-health-strip {border-left-color:#84b98f}
:root[data-theme] .panel-head p,:root[data-theme] .field label,:root[data-theme] .filter-field label,
:root[data-theme] .patient-identity p,:root[data-theme] .patient-banner p,:root[data-theme] .subtext,
:root[data-theme] .footer,:root[data-theme] .muted,:root[data-theme] .help,:root[data-theme] .auth-note {color:var(--theme-muted)}
:root[data-theme] .field label,:root[data-theme] .filter-field label {font-size:14px}
:root[data-theme] .field .help {font-size:13px;color:var(--theme-muted)}
:root[data-theme] .field input,:root[data-theme] .field select,:root[data-theme] .field textarea,
:root[data-theme] .filter-field input,:root[data-theme] .filter-field select,:root[data-theme] .search-input {
  background:var(--theme-input);color:var(--theme-text);border-color:var(--theme-input-border);color-scheme:inherit
}
:root[data-theme] input[type=checkbox],:root[data-theme] input[type=radio] {accent-color:var(--theme-button);color-scheme:inherit}
:root[data-theme] option {background:var(--theme-input);color:var(--theme-text)}
:root[data-theme] input::placeholder,:root[data-theme] textarea::placeholder {color:var(--theme-muted);opacity:1}
:root[data-theme] .field input[readonly],:root[data-theme] .field textarea[readonly],:root[data-theme] select:disabled {background:var(--theme-raised);color:var(--theme-muted)}
:root[data-theme] input:autofill {box-shadow:0 0 0 1000px var(--theme-input) inset;-webkit-text-fill-color:var(--theme-text)}
:root[data-theme] body .btn,:root[data-theme] body button.btn {background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
:root[data-theme] body .btn:hover {background:var(--theme-hover);color:var(--theme-text)}
:root[data-theme] body .btn.primary,:root[data-theme] body .btn-primary {background:var(--theme-button)!important;color:var(--theme-button-text)!important;border-color:var(--theme-button)!important}
:root[data-theme] body .btn.primary:hover,:root[data-theme] body .btn-primary:hover {filter:brightness(1.1)}
:root[data-theme] body .btn.danger {color:var(--theme-error-text);border-color:var(--theme-error-border)}
:root[data-theme] .notice,:root[data-theme] .notice:not(:empty) {background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-text)}
:root[data-theme] .notice.info {background:var(--theme-info);color:var(--theme-info-text);border-color:var(--theme-info-border)}
:root[data-theme] .notice.error {background:var(--theme-error);color:var(--theme-error-text);border-color:var(--theme-error-border)}
:root[data-theme] .badge,:root[data-theme] .badge.neutral,:root[data-theme] .chip,:root[data-theme] .patient-condition {background:var(--theme-soft);color:var(--theme-accent);border-color:var(--theme-border)}
:root[data-theme] .badge.warn {background:var(--theme-warning);color:var(--theme-warning-text);border-color:var(--theme-warning-border)}
:root[data-theme] .badge.danger {background:var(--theme-error);color:var(--theme-error-text);border-color:var(--theme-error-border)}
:root[data-theme] .data-table {background:transparent;color:var(--theme-text)}
:root[data-theme] .data-table th {background:var(--theme-raised);color:var(--theme-muted);border-color:var(--theme-border)}
:root[data-theme] .data-table td {border-color:var(--theme-border)}
:root[data-theme] .data-table tr:hover td {background:var(--theme-hover)}
:root[data-theme] .data-table .name {color:var(--theme-text)}
:root[data-theme] .data-table .secondary {color:var(--theme-muted)}
:root[data-theme] .patient-banner,:root[data-theme] .patient-workspace-hero {background:linear-gradient(115deg,var(--theme-soft),var(--theme-surface));color:var(--theme-text);border-color:var(--theme-border)}
:root[data-theme] .patient-avatar {background:#17324d;color:#e4f1e6;border-color:#84b98f}
:root[data-theme] .patient-section-link {color:var(--theme-text)}
:root[data-theme] .patient-section-link.active,:root[data-theme] .tabs a.active {background:var(--theme-selected);color:var(--theme-text)}
:root[data-theme] .patient-section-link:hover {background:var(--theme-hover)}
:root[data-theme] .patient-nav-group,:root[data-theme] .patient-fact,:root[data-theme] .patient-activity-row,
:root[data-theme] .quality-metric,:root[data-theme] .advanced,:root[data-theme] .timeline {border-color:var(--theme-border)}
:root[data-theme] .patient-nav-group summary,:root[data-theme] .patient-metric small,:root[data-theme] .health-measurement small {color:var(--theme-muted)}
:root[data-theme] .patient-metric strong {color:var(--theme-text)}
:root[data-theme] .health-note,:root[data-theme] .health-measurement,:root[data-theme] .measurement-card,:root[data-theme] .health-factors>div {background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
:root[data-theme] .health-measurement .measurement-change,:root[data-theme] .health-subheading {color:var(--theme-accent)}
:root[data-theme] .patient-focus-row.needs-attention,:root[data-theme] .focus-item.immediate {background:var(--theme-warning);border-color:var(--theme-warning-border)}
:root[data-theme] .focus-item {background:var(--theme-raised);border-color:var(--theme-border)}
:root[data-theme] .trend-card .label,:root[data-theme] .trend-card .detail,:root[data-theme] .month-values small {color:var(--theme-muted)}
:root[data-theme] .trend-card .value,:root[data-theme] .comparison-table .numeric,:root[data-theme] .network-months .numeric {color:var(--theme-text)}
:root[data-theme] .kpi-action,:root[data-theme] .cohort-row-button,:root[data-theme] .comparison-method summary,
:root[data-theme] .outcome-comparison summary,:root[data-theme] .eyebrow {color:var(--theme-accent)}
:root[data-theme] .cohort-row-button.selected {color:var(--theme-text)}
:root[data-theme] button.kpi-link:hover,:root[data-theme] button.kpi-link.selected {background:var(--theme-selected);border-color:#84b98f;box-shadow:var(--theme-shadow)}
:root[data-theme] .history-note,:root[data-theme] .chart-footnote,:root[data-theme] .trend-delta,
:root[data-theme] .comparison-table .missing,:root[data-theme] .comparison-table .change-cell,:root[data-theme] .network-change,
:root[data-theme] .network-months .missing,:root[data-theme] .dashboard-stamp {color:var(--theme-muted)}
:root[data-theme] .history-note strong,:root[data-theme] .comparison-table tbody th,:root[data-theme] .network-matrix tbody th {color:var(--theme-text)}
:root[data-theme] .comparison-table caption,:root[data-theme] .comparison-table thead th,:root[data-theme] .network-matrix thead th,
:root[data-theme] .network-matrix thead .network-months {color:var(--theme-muted)}
:root[data-theme] .comparison-table th,:root[data-theme] .comparison-table td,:root[data-theme] .network-matrix th,
:root[data-theme] .network-matrix td,:root[data-theme] .month-values,:root[data-theme] details.filter-bar[open] .dashboard-filter-summary {border-color:var(--theme-border)}
:root[data-theme] .dashboard-filter-summary,:root[data-theme] .advanced summary {color:var(--theme-accent)}
:root[data-theme] .sparkline .spark-axis {stroke:var(--theme-border)}
:root[data-theme] .sparkline .spark-path {stroke:var(--theme-accent)}
:root[data-theme] .sparkline circle {fill:var(--theme-accent)}
:root[data-theme] .spark-empty {color:var(--theme-muted)}
:root[data-theme] .bar-track {background:var(--theme-soft)}
:root[data-theme] .bar-fill {background:#326540}:root[data-theme] .bar-row:nth-child(2n) .bar-fill {background:#84b98f}
:root[data-theme] .status-dot {background:#84b98f}
:root[data-theme] .auth-story {background:var(--theme-soft);color:var(--theme-text)}
:root[data-theme] .auth-story .brand,:root[data-theme] .auth-mobile-brand {color:var(--theme-text)}
:root[data-theme] .auth-story p,:root[data-theme] .auth-story small {color:var(--theme-muted)}
:root[data-theme] .auth-story .eyebrow {color:var(--theme-accent)}
:root[data-theme] .auth-orbit span {border-color:var(--theme-input-border)}
:root[data-theme] .auth-secret,:root[data-theme] .code-grid {background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
.theme-toggle {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:7px 11px;border:1px solid var(--theme-border);border-radius:22px;background:var(--theme-raised);color:var(--theme-text);font:600 13px/1.3 Segoe UI,Arial,sans-serif;cursor:pointer;white-space:nowrap;flex-shrink:0}
.theme-toggle:hover {background:var(--theme-hover)}.theme-icon {font-size:19px;line-height:1;color:var(--theme-accent)}
.theme-toggle:focus-visible {outline:3px solid var(--theme-focus);outline-offset:3px}
.auth-appearance {display:flex;justify-content:flex-end;margin-bottom:24px}.auth-card {padding:32px 0}
.error-body {min-height:100vh;display:grid;place-items:center;padding:24px}.error-panel {max-width:680px;width:100%}
@media(max-width:900px){.topbar-right{gap:12px}.profile-chip{max-width:230px;overflow-wrap:anywhere}.theme-toggle{font-size:12px;padding:7px 9px}}
@media(max-width:540px){.topbar{height:auto;min-height:68px;padding:12px 14px;align-items:flex-start}.topbar-right{gap:10px;flex-wrap:wrap;justify-content:flex-end}.profile-chip{max-width:180px}.auth-appearance{margin-bottom:16px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media print {
  :root[data-theme],:root[data-theme] body {color-scheme:light;--theme-page:#fff;--theme-surface:#fff;--theme-raised:#f4f4f4;--theme-text:#17324d;--theme-muted:#405566;--theme-accent:#326540;--theme-border:#becac4;--theme-soft:#eef3ed;background:#fff!important;color:#17324d!important}
  .theme-toggle,.auth-appearance {display:none!important}
  :root[data-theme] .panel,:root[data-theme] .kpi,:root[data-theme] .patient-health-strip,:root[data-theme] .patient-workspace-hero,:root[data-theme] .patient-metric {background:white!important;box-shadow:none!important;color:#17324d!important}
}

:root[data-theme] .network-area h3 {color:var(--theme-text)}

/* Summary cards are also used by ordinary operational pages. */
:root[data-theme] .kpi .label,:root[data-theme] .kpi .detail {color:var(--theme-muted)}
:root[data-theme] .kpi .value {color:var(--theme-text)}
:root[data-theme] .kpi.urgent .value {color:var(--theme-warning-text)}
:root[data-theme] .kpi-icon {background:var(--theme-soft);color:var(--theme-accent)}
:root[data-theme] .auth-story-footer {color:var(--theme-muted)}

/* Light-mode navigation matches the primary green buttons. Dark mode is unchanged. */
@media screen {
  :root[data-theme="light"] .sidebar,
  :root[data-theme="light"] .patient-workspace-nav {
    background:var(--theme-button);color:#fff;border-color:#2a5737;
    scrollbar-color:#a7c9b0 #2b5939;
  }
  :root[data-theme="light"] .sidebar .brand,
  :root[data-theme="light"] .sidebar .brand small,
  :root[data-theme="light"] .sidebar .network-label,
  :root[data-theme="light"] .sidebar .nav-group summary,
  :root[data-theme="light"] .sidebar .nav-link,
  :root[data-theme="light"] .sidebar .nav-close,
  :root[data-theme="light"] .sidebar .sidebar-bottom,
  :root[data-theme="light"] .patient-workspace-nav .patient-section-link,
  :root[data-theme="light"] .patient-workspace-nav .patient-nav-group summary {
    color:#fff;text-shadow:0 1px 1px #24462c66;
  }
  :root[data-theme="light"] .sidebar .nav-link:hover,
  :root[data-theme="light"] .patient-workspace-nav .patient-section-link:hover {
    background:#3d704b;color:#fff;
  }
  :root[data-theme="light"] .sidebar .nav-link.active,
  :root[data-theme="light"] .patient-workspace-nav .patient-section-link.active {
    background:#4b7c58;color:#fff;box-shadow:inset 3px 0 #eef7f0;
  }
  :root[data-theme="light"] .sidebar .sidebar-bottom,
  :root[data-theme="light"] .patient-workspace-nav .patient-nav-group {border-color:#77a283}
  :root[data-theme="light"] .sidebar .status-dot {background:#fff}
  :root[data-theme="light"] .sidebar :focus-visible,
  :root[data-theme="light"] .patient-workspace-nav :focus-visible {outline-color:#fff}
}

/* Give sign-in navigation its own balanced utility row. */
.auth-card .auth-appearance{width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:20px;margin-bottom:28px;border-bottom:1px solid var(--theme-border)}
:root[data-theme] .auth-card .auth-home-link,
.auth-card .auth-appearance .theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid var(--theme-border);border-radius:8px;background:var(--theme-surface);color:var(--theme-text);font:600 13px/1.3 Segoe UI,Arial,sans-serif;white-space:nowrap;text-decoration:none;flex-shrink:0}
.auth-card .auth-home-link{margin-right:auto}
.auth-card .auth-appearance .theme-toggle{margin-left:auto}
:root[data-theme] .auth-card .auth-home-link:hover,
.auth-card .auth-appearance .theme-toggle:hover{background:var(--theme-hover);border-color:var(--theme-input-border);text-decoration:none}
.auth-back-icon{font-size:20px;font-weight:400;line-height:1;color:var(--theme-accent)}
@media(max-width:540px){.auth-card .auth-appearance{gap:12px;margin-bottom:24px;padding-bottom:18px}}
@media(max-width:360px){:root[data-theme] .auth-card .auth-home-link,.auth-card .auth-appearance .theme-toggle{font-size:12px;padding:10px;gap:6px}.auth-card .auth-appearance{gap:8px}}

