/* Paneled — base CSS + design system */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Staff accent — Round G.3.1: emerald primary (reverted from teal) */
  --staff-accent: #047857;       /* emerald-700 — canonical primary brand */
  --staff-accent-700: #047857;   /* pressed / darker */
  --staff-accent-600: #059669;   /* lighter interactive */
  --staff-accent-500: #10b981;   /* hover / lighter */
  --staff-accent-50: #ecfdf5;    /* soft background tint */
  --staff-accent-100: #d1fae5;
  --staff-accent-200: #a7f3d0;   /* borders on primary surfaces */
  /* Generic primary aliases (emerald) */
  --primary: #047857;
  --primary-600: #059669;
  --primary-500: #10b981;
  --primary-700: #047857;
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;

  /* Persona accents — Staff=emerald (G.3.1), Practice admin=amber, Provider=slate */
  --persona-staff: #047857;
  --persona-staff-50: #ecfdf5;
  --persona-client: #d97706;
  --persona-client-50: #fffbeb;
  --persona-provider: #475569;
  --persona-provider-50: #f1f5f9;

  /* Client portal (emerald) accents */
  --client-accent: #047857;
  --client-accent-600: #059669;
  --client-accent-50: #ecfdf5;
  --client-accent-100: #d1fae5;

  /* Neutrals */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-150: #e9eef4;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Stone (client warmer neutrals) */
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  /* Status — Round G.3: softer -50 tinted backgrounds, -600/700 text */
  --status-green: #059669;
  --status-green-bg: #ecfdf5;
  --status-amber: #d97706;
  --status-amber-bg: #fffbeb;
  --status-red: #e11d48;
  --status-red-bg: #fff1f2;
  --status-blue: #0284c7;
  --status-blue-bg: #f0f9ff;
  --status-violet: #7c3aed;
  --status-violet-bg: #f5f3ff;
  --status-indigo: #4338ca;
  --status-indigo-bg: #eef2ff;
  --status-orange: #ea580c;
  --status-orange-bg: #fff7ed;
  --status-slate: #475569;
  --status-slate-bg: #f1f5f9;
  --status-gray: #6b7280;
  --status-gray-bg: #f3f4f6;
  --status-teal: #059669;
  --status-teal-bg: #ecfdf5;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  color: var(--slate-800);
  background: var(--slate-50);
  height: 100%;
}

#root { height: 100vh; overflow: hidden; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-300); border: 2px solid transparent; background-clip: padding-box; }

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
}
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Top nav */
.topnav {
  height: 56px;
  border-bottom: 1px solid var(--slate-200);
  background: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
}
.topnav__org {
  font-weight: 600;
  font-size: 14px;
  color: var(--slate-800);
  display: flex; align-items: center; gap: 8px;
}
.topnav__search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.topnav__search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  background: var(--slate-50);
  font-size: 13px;
  outline: none;
  transition: all 0.15s;
}
.topnav__search input:focus {
  border-color: var(--staff-accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.08);
}
.topnav__search-icon {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}
.topnav__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topnav__icon-btn {
  width: 34px; height: 34px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--slate-500);
  position: relative;
}
.topnav__icon-btn:hover { background: var(--slate-100); color: var(--slate-700); }
.topnav__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--staff-accent);
  color: white;
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.topnav__app-switch {
  height: 30px;
  padding: 0 10px 0 8px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--slate-700);
}
.topnav__app-switch:hover { background: var(--slate-100); }
.topnav__app-switch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--staff-accent); }

/* Prototype-only staff role switcher (top-nav meta control) */
.role-switcher { position: relative; }
.role-switcher__trigger {
  height: 30px;
  padding: 0 8px 0 6px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--slate-700);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.role-switcher__trigger:hover { background: var(--slate-200); border-color: var(--slate-300); }
.role-switcher__trigger.is-open { background: white; border-color: var(--slate-300); box-shadow: var(--shadow-sm); }
.role-switcher__trigger svg { color: var(--slate-500); flex-shrink: 0; }
.role-switcher__label { white-space: nowrap; }
.role-switcher__label strong { color: var(--slate-900); font-weight: 600; }
.role-switcher__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 4px;
  background: #fde68a;
  color: #92400e;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  flex-shrink: 0;
}
.role-switcher__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg, 0 12px 32px -8px rgba(15, 23, 42, 0.18));
  z-index: 50;
  overflow: hidden;
  animation: rs-fade 0.12s ease-out;
}
@keyframes rs-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.role-switcher__menu-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--slate-100);
  background: var(--slate-50);
}
.role-switcher__menu-title {
  font-size: 12px; font-weight: 600; color: var(--slate-900);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.role-switcher__menu-sub { font-size: 11.5px; color: var(--slate-500); margin-top: 3px; line-height: 1.4; }
.role-switcher__item {
  width: 100%;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: white;
  border: none;
  border-bottom: 1px solid var(--slate-100);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.role-switcher__item:last-child { border-bottom: none; }
.role-switcher__item:hover { background: var(--slate-50); }
.role-switcher__item.is-active { background: rgba(14, 116, 144, 0.05); }
.role-switcher__item-main { flex: 1; min-width: 0; }
.role-switcher__item-role { font-size: 13.5px; font-weight: 600; color: var(--slate-900); letter-spacing: -0.01em; }
.role-switcher__item-rep { font-size: 12px; color: var(--slate-600); margin-top: 1px; }
.role-switcher__item-note { font-size: 11.5px; color: var(--slate-500); margin-top: 3px; line-height: 1.35; }
.role-switcher__item-check {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--staff-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
}

/* Sidebar */
.sidebar {
  background: white;
  border-right: 1px solid var(--slate-200);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: hidden;
}
.sidebar--labeled { width: 232px; }
.sidebar--collapsible { width: 232px; }
.sidebar--icon { width: 60px; }
.sidebar__brand {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid var(--slate-100);
  flex-shrink: 0;
}
.sidebar__brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--staff-accent-600);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(4, 120, 87, 0.25);
}
.sidebar__brand-name { font-weight: 700; font-size: 15px; color: var(--slate-900); letter-spacing: -0.01em; }
.sidebar__nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar__section-label {
  font-size: 11px; font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 10px 6px;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--slate-600);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar__item:hover { background: var(--slate-100); color: var(--slate-800); }
.sidebar__item--active {
  background: var(--staff-accent-50);
  color: var(--staff-accent-700);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--staff-accent-600);
}
.sidebar__item--active:hover { background: var(--staff-accent-50); color: var(--staff-accent-700); }
.sidebar__item--active .sidebar__item-icon { color: var(--staff-accent-600); }
.sidebar__item-icon { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar__item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__item-badge {
  background: var(--slate-150);
  color: var(--slate-600);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
}
.sidebar__item--active .sidebar__item-badge { background: var(--staff-accent-100); color: var(--staff-accent-700); }
.sidebar__footer {
  border-top: 1px solid var(--slate-100);
  padding: 10px 8px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__user-info { font-size: 12px; min-width: 0; }
.sidebar__user-name { font-weight: 600; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { color: var(--slate-500); font-size: 11px; }

/* icon-only mode */
.sidebar--icon .sidebar__brand-name,
.sidebar--icon .sidebar__item-label,
.sidebar--icon .sidebar__item-badge,
.sidebar--icon .sidebar__section-label,
.sidebar--icon .sidebar__user-info { display: none; }
.sidebar--icon .sidebar__brand { justify-content: center; padding: 0; }
.sidebar--icon .sidebar__item { justify-content: center; padding: 9px; }
.sidebar--icon .sidebar__footer { justify-content: center; }

/* Page content area */
.page {
  flex: 1;
  overflow-y: auto;
  background: var(--slate-50);
}
.page__header {
  padding: 20px 28px 12px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
}
.page__header-info { min-width: 0; }
.page__title {
  margin: 0;
  font-size: 22px; font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}
.page__subtitle {
  margin: 4px 0 0;
  color: var(--slate-500);
  font-size: 13px;
}
.page__breadcrumb {
  font-size: 12px;
  color: var(--slate-500);
  margin-bottom: 4px;
}
.page__breadcrumb a { color: var(--slate-500); text-decoration: none; cursor: pointer; }
.page__breadcrumb a:hover { color: var(--staff-accent); }
.page__body { padding: 12px 28px 32px; }

/* Buttons */
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--staff-accent);
  color: white;
  box-shadow: 0 1px 2px rgba(4, 120, 87, 0.2);
}
.btn--primary:hover { background: var(--staff-accent-700); }
.btn--secondary {
  background: white;
  color: var(--slate-700);
  border-color: var(--slate-200);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover { background: var(--slate-50); border-color: var(--slate-300); }
.btn--ghost {
  background: transparent;
  color: var(--slate-600);
}
.btn--ghost:hover { background: var(--slate-100); color: var(--slate-800); }
.btn--danger {
  background: white;
  color: var(--status-red);
  border-color: var(--slate-200);
}
.btn--danger:hover { background: var(--status-red-bg); border-color: #fca5a5; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--icon { padding: 0; width: 34px; justify-content: center; }

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 18px;
  white-space: nowrap;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge--green { background: var(--status-green-bg); color: #047857; }
.badge--amber { background: var(--status-amber-bg); color: #b45309; }
.badge--red { background: var(--status-red-bg); color: #be123c; }
.badge--blue { background: var(--status-blue-bg); color: #0369a1; }
.badge--violet { background: var(--status-violet-bg); color: #6b21a8; }
/* Round G Item 3 — clickable Dashboard summary segments */
.seg-link { border-bottom: 1px dashed transparent; transition: border-color 0.12s; }
.seg-link:hover { border-bottom-color: var(--slate-400); }
.badge--indigo { background: var(--status-indigo-bg); color: #3730a3; }
.badge--orange { background: var(--status-orange-bg); color: #9a3412; }
.badge--slate { background: var(--status-slate-bg); color: #334155; }
.badge--gray { background: var(--status-gray-bg); color: #374151; }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.card__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  display: flex; align-items: center; gap: 8px;
}
.card__body { padding: 16px 18px; }
.card__footer { padding: 12px 18px; border-top: 1px solid var(--slate-100); font-size: 12px; color: var(--slate-500); }

/* KPI card */
.kpi {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}
.kpi.row-hover:hover { box-shadow: var(--shadow-md); border-color: var(--slate-300); }
/* Round G.3 — KPI icon badge top-left */
.kpi__badge {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-bottom: 2px;
}
.kpi__badge svg { width: 19px; height: 19px; }
.kpi__badge--teal { background: var(--status-teal-bg); color: var(--status-teal); }
.kpi__badge--amber { background: var(--status-amber-bg); color: var(--status-amber); }
.kpi__badge--slate { background: var(--slate-100); color: var(--slate-600); }
.kpi__badge--emerald { background: var(--status-green-bg); color: var(--status-green); }
.kpi__badge--rose { background: var(--status-red-bg); color: var(--status-red); }
.kpi__badge--sky { background: var(--status-blue-bg); color: var(--status-blue); }
.kpi__label {
  font-size: 12px; font-weight: 500;
  color: var(--slate-500);
  display: flex; align-items: center; gap: 6px;
}
.kpi__value {
  font-size: 32px; font-weight: 600;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi__sub {
  font-size: 12px;
  color: var(--slate-500);
  display: flex; align-items: center; gap: 4px;
}
.kpi__delta--up { color: var(--status-green); }
.kpi__delta--down { color: var(--status-red); }
.kpi--warn .kpi__value { color: var(--status-amber); }

/* Tables */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl thead th {
  position: sticky; top: 0;
  background: var(--slate-50);
  text-align: left;
  font-weight: 600;
  color: var(--slate-500);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: var(--slate-700); }
.tbl tbody td {
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
  color: var(--slate-700);
}
.tbl tbody tr { transition: background 0.08s; }
.tbl tbody tr:hover { background: var(--slate-50); cursor: pointer; }
.tbl tbody tr.selected { background: var(--staff-accent-50); }
.tbl tbody tr.selected:hover { background: var(--staff-accent-50); }
.tbl__id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--slate-600); }
.tbl__primary { font-weight: 600; color: var(--slate-900); }
.tbl__muted { color: var(--slate-500); }
.tbl__num { font-variant-numeric: tabular-nums; }
.tbl__check {
  width: 14px; height: 14px;
  border: 1.5px solid var(--slate-300);
  border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
}
.tbl__check.checked {
  background: var(--staff-accent);
  border-color: var(--staff-accent);
  color: white;
}
.tbl__check.partial {
  background: var(--staff-accent-50);
  border-color: var(--staff-accent);
  color: var(--staff-accent);
}

/* Filter bar */
.filters {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--slate-100);
  flex-wrap: wrap;
}
.filter-pill {
  height: 30px;
  padding: 0 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--slate-700);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.filters select,
.filters .na-input {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 32px;
  background-position: right 10px center;
}
/* Reset control in filter rows — push it away from the chip cluster
   so long chip labels never visually collide with the × Reset. */
.filters .btn--reset {
  margin-left: 24px !important;
  border-left: 1px solid var(--slate-200) !important;
  padding-left: 16px !important;
  border-radius: 0 !important;
}
.filter-pill:hover { background: var(--slate-50); border-color: var(--slate-300); }
.filter-pill--active { background: var(--staff-accent-50); border-color: var(--staff-accent-100); color: var(--staff-accent-700); }

/* Selects styled as filter pills — strip the native chevron and add our
   own so padding works consistently and text doesn't crush against the
   built-in dropdown arrow. */
select.filter-pill {
  height: 32px;
  padding: 0 34px 0 14px;
  min-width: 240px;
  max-width: 340px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  font-weight: 500;
  color: var(--slate-700);
}
select.filter-pill:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-300);
}
select.filter-pill:focus {
  outline: none;
  border-color: var(--staff-accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}
select.filter-pill optgroup {
  font-weight: 600;
  color: var(--slate-500);
}
select.filter-pill option {
  font-weight: 500;
  color: var(--slate-800);
  padding: 8px 16px;
}
/* (single .filters .btn--reset rule lives above) */
.filters > select { max-width: 220px; }
.filter-search {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 200px;
}
.filter-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  font-size: 12.5px;
  background: white;
  outline: none;
}
.filter-search input:focus { border-color: var(--staff-accent); box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.08); }
.filter-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }

.saved-views {
  display: flex; gap: 2px;
  padding: 4px 18px 0;
  border-bottom: 1px solid var(--slate-100);
}
.saved-view-tab {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.saved-view-tab:hover { color: var(--slate-700); }
.saved-view-tab.active { color: var(--staff-accent); border-bottom-color: var(--staff-accent); font-weight: 600; }
.saved-view-tab .count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 500;
}
.saved-view-tab.active .count { color: var(--staff-accent); }

/* Tabs */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--slate-200);
  padding: 0 28px;
  background: white;
}
.tab {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--slate-700); }
.tab.active { color: var(--staff-accent); border-bottom-color: var(--staff-accent); font-weight: 600; }
.tab .count { font-size: 11px; color: var(--slate-400); font-weight: 500; }
.tab.active .count { color: var(--staff-accent); }

/* Avatar */
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--slate-700);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--xl { width: 56px; height: 56px; font-size: 18px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 0;
  width: 1.5px;
  background: var(--slate-200);
}
.timeline__item {
  position: relative;
  padding-bottom: 18px;
}
.timeline__dot {
  position: absolute;
  left: -22px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--staff-accent);
  z-index: 1;
}
.timeline__item--system .timeline__dot { border-color: var(--slate-400); }
.timeline__meta { font-size: 11.5px; color: var(--slate-500); margin-bottom: 2px; }
.timeline__title { font-size: 13px; color: var(--slate-800); font-weight: 500; }
.timeline__note { font-size: 12.5px; color: var(--slate-600); margin-top: 4px; padding: 8px 10px; background: var(--slate-50); border-radius: 6px; border-left: 2px solid var(--slate-200); }

/* Empty state */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--slate-500);
}
.empty__icon { color: var(--slate-300); margin-bottom: 12px; }
.empty__title { font-size: 14px; font-weight: 600; color: var(--slate-700); margin-bottom: 4px; }
.empty__msg { font-size: 13px; }

/* Skeleton */
@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes caqhScan { 0% { transform: translateX(-100%); } 100% { transform: translateX(266%); } }
.skel { background: var(--slate-150); border-radius: 4px; animation: pulse 1.6s ease-in-out infinite; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--slate-900);
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.18s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  max-width: 480px; width: 90%;
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1); }
}
.modal__header { padding: 18px 22px 6px; }
.modal__title { margin: 0; font-size: 16px; font-weight: 600; color: var(--slate-900); }
.modal__body { padding: 8px 22px 16px; font-size: 13.5px; color: var(--slate-600); line-height: 1.5; }
.modal__footer { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }

/* Status pill (kanban / inline edit) */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
  background: white;
  cursor: pointer;
  transition: border-color 0.1s;
}
.status-pill:hover { border-color: var(--slate-300); }
.status-pill__dot { width: 7px; height: 7px; border-radius: 50%; }

/* Kanban */
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban__col {
  flex: 0 0 280px;
  background: var(--slate-100);
  border-radius: 9px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 230px);
}
.kanban__col-header {
  padding: 10px 12px 8px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  color: var(--slate-700);
}
.kanban__count {
  background: white;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
}
.kanban__list { padding: 0 8px 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.kanban__card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  padding: 10px 11px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  font-size: 12.5px;
}
.kanban__card-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--slate-500); }
.kanban__card-title { font-weight: 600; color: var(--slate-800); margin: 4px 0 2px; line-height: 1.3; }
.kanban__card-meta { font-size: 11.5px; color: var(--slate-500); display: flex; justify-content: space-between; margin-top: 6px; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.muted { color: var(--slate-500); }
.tiny { font-size: 11.5px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.spacer { flex: 1; }

/* Application detail layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  height: 100%;
}
.detail-aside {
  border-left: 1px solid var(--slate-200);
  background: white;
  overflow-y: auto;
  padding: 18px 20px;
}
.detail-aside h4 {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 13px; align-items: baseline; }
.kv__k { color: var(--slate-500); font-size: 12px; }
.kv__v { color: var(--slate-800); font-weight: 500; }

/* Compact aside party chips (clickable provider/practice/payer rows) */
.aside-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--slate-100); }
.aside-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.aside-section--tight { padding-bottom: 14px; margin-bottom: 14px; }
.party-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 0 -10px;
  border-radius: 8px; cursor: pointer;
  transition: background 0.1s;
  color: var(--slate-800); text-decoration: none;
}
.party-row:hover { background: var(--slate-50); }
.party-row__main { flex: 1; min-width: 0; }
.party-row__name { font-weight: 600; font-size: 13.5px; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-row__meta { font-size: 11.5px; color: var(--slate-500); margin-top: 1px; }
.party-row__chev { color: var(--slate-300); flex-shrink: 0; }
.party-row:hover .party-row__chev { color: var(--slate-500); }
.aside-ids { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; font-size: 11.5px; color: var(--slate-500); }
.aside-ids span { white-space: nowrap; }
.aside-ids strong { color: var(--slate-700); font-weight: 500; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Status hero card at top of aside */
.status-hero {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  background: var(--slate-50);
}
.status-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--status-band, var(--slate-400));
}
.status-hero__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--status-band, var(--slate-700));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.status-hero__title { font-size: 17px; font-weight: 700; color: var(--slate-900); margin-bottom: 6px; }
.status-hero__meta { font-size: 12px; color: var(--slate-600); }

/* Callout for next action / urgent info */
.aside-callout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  margin-bottom: 18px;
  background: var(--status-amber-bg);
  border: 1px solid #fde68a;
}
.aside-callout__icon { color: var(--status-amber); flex-shrink: 0; }
.aside-callout__main { flex: 1; min-width: 0; }
.aside-callout__label { font-size: 11px; font-weight: 600; color: var(--status-amber); text-transform: uppercase; letter-spacing: 0.05em; }
.aside-callout__value { font-size: 14px; font-weight: 600; color: var(--slate-900); margin-top: 2px; }

/* Compact label-value list with icon prefixes */
.prop-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.prop {
  display: grid;
  grid-template-columns: 18px 100px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--slate-100);
}
.prop:last-child { border-bottom: none; }
.prop__icon { color: var(--slate-400); display: flex; }
.prop__label { color: var(--slate-500); font-size: 12px; }
.prop__value { color: var(--slate-800); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prop__value--link { color: var(--staff-accent); cursor: pointer; }
.prop__value--link:hover { text-decoration: underline; }
.prop__chev { color: var(--slate-300); }
.prop--approval { color: #166534; }
.prop--approval .prop__icon { color: var(--status-green); }

/* Payer rep contact footer card */
.rep-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 14px;
}
.rep-card__name { font-weight: 700; font-size: 13.5px; color: var(--slate-900); }
.rep-card__title { font-size: 12px; color: var(--slate-500); margin-top: 2px; margin-bottom: 10px; }
.rep-card__row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin: 0 -8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--staff-accent);
  text-decoration: none;
}
.rep-card__row:hover { background: white; }
.rep-card__row svg { color: var(--slate-500); }

/* New application form styles */
.na-field { display: flex; flex-direction: column; }
.na-label { font-size: 12px; font-weight: 600; color: var(--slate-600); margin-bottom: 6px; }
.na-input {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid var(--slate-200); border-radius: 7px;
  font-size: 13.5px; outline: none; background: white; color: var(--slate-800);
  font-family: inherit;
}
.na-input:focus { border-color: var(--staff-accent); box-shadow: 0 0 0 3px var(--staff-accent-50); }
.na-input:disabled { background: var(--slate-50); color: var(--slate-400); cursor: not-allowed; }

/* Round E5p — required-field markers + intake/setup form refresh */
.req-star { color: #dc2626; margin-left: 3px; font-weight: 700; }
.fld-input:focus { border-color: var(--slate-400); box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06); }
.client .fld-input:focus { border-color: var(--client-accent); box-shadow: 0 0 0 3px var(--client-accent-50, rgba(5, 150, 105, 0.12)); }
.field-missing, .field-missing:focus { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important; background: #fef2f2 !important; }

/* Intake + setup form surfaces — more breathing room, clearer hierarchy.
   Scoped to .intake-form / .setup-form wrappers so the rest of the app's
   cards are untouched. */
.intake-form { display: flex; flex-direction: column; gap: 18px; }
.intake-form .card__body { padding: 22px 24px; }
.intake-form .card__header { padding: 16px 24px; }
.intake-form .card__title { font-size: 15.5px; }
.intake-section-desc { font-size: 12.5px; color: var(--stone-500); line-height: 1.55; margin-bottom: 16px; }
/* Collapsible section header (provider intake) */
.intake-sec-toggle {
  width: 100%; background: none; border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 0;
}
.intake-sec-toggle .chev { transition: transform 0.15s; color: var(--stone-400); flex-shrink: 0; display: inline-flex; }
.intake-sec-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.intake-sec-title { font-size: 15.5px; font-weight: 700; color: var(--stone-900); flex: 1; min-width: 0; }
/* Sub-section grouping inside a section card */
.intake-subgroup {
  border-top: 1px solid var(--stone-100); margin-top: 4px; padding-top: 14px;
}
/* Multi-row entry card treatment */
.intake-rowcard {
  border: 1px solid var(--stone-200); border-radius: 10px; padding: 14px 16px;
  background: var(--stone-50); margin-bottom: 10px;
}
/* Round E5q Item 2 — reopen bar shown atop a completed (read-only) section */
.reopen-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin: 14px 0 4px;
  background: var(--status-green-bg); border: 1px solid rgba(22,163,74,0.22);
  border-radius: 9px; font-size: 12.5px; color: var(--slate-700);
}
.reopen-bar > span { display: inline-flex; align-items: center; gap: 7px; color: var(--status-green); font-weight: 600; }
select.na-input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* Radio cards */
.na-radio-group { display: flex; flex-direction: column; gap: 8px; }
.na-radio-group--inline { flex-direction: row; }
.na-radio {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 8px;
  cursor: pointer; transition: background 0.1s, border-color 0.1s;
}
.na-radio:hover { background: var(--slate-50); }
.na-radio.active { border-color: var(--staff-accent); background: var(--staff-accent-50); }
.na-radio input { margin: 3px 0 0; accent-color: var(--staff-accent); }
.na-radio__title { font-size: 13.5px; font-weight: 600; color: var(--slate-800); }
.na-radio__desc { font-size: 12px; color: var(--slate-500); margin-top: 1px; }

/* Pill radio (priority) */
.na-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--slate-200); border-radius: 999px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--slate-600);
  background: white;
}
.na-pill:hover { border-color: var(--slate-300); }
.na-pill input { display: none; }
.na-pill.active { font-weight: 600; background: var(--slate-50); }

/* Hint banner */
.na-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
}
.na-hint--warn { background: var(--status-amber-bg); color: #92400e; border: 1px solid #fde68a; }
.na-hint svg { color: var(--status-amber); flex-shrink: 0; margin-top: 1px; }

/* Summary blocks (right column) */
.na-summary-block { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--slate-100); }
.na-summary-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.na-summary-label { font-size: 11px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.na-summary-empty { font-size: 13px; color: var(--slate-400); font-style: italic; }

.btn--disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Client portal overrides (larger, warmer) */
.client { font-size: 14.5px; }
.client .topnav { height: 64px; padding: 0 24px; background: var(--stone-50); border-bottom-color: var(--stone-200); }
.client .topnav__search input { font-size: 14px; height: 38px; padding: 0 12px 0 36px; background: white; border-color: var(--stone-200); border-radius: 8px; }
.client .topnav__search input:focus { border-color: var(--client-accent); box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1); }
.client .sidebar { background: var(--stone-50); border-right-color: var(--stone-200); }
.client .sidebar__brand-mark { background: linear-gradient(135deg, var(--client-accent-600), var(--client-accent)); box-shadow: 0 1px 2px rgba(4, 120, 87, 0.25); }
.client .sidebar__item { font-size: 14px; padding: 9px 11px; }
.client .sidebar__item--active { background: var(--client-accent-50); color: var(--client-accent); }
.client .sidebar__item--active .sidebar__item-badge { background: var(--client-accent-100); color: var(--client-accent); }
.client .page { background: var(--stone-50); }
.client .page__header { padding: 28px 32px 14px; }
.client .page__title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.client .page__subtitle { font-size: 14.5px; margin-top: 6px; }
.client .page__body { padding: 18px 32px 40px; }
.client .topnav__avatar { background: var(--client-accent); }
.client .btn--primary { background: var(--client-accent); box-shadow: 0 1px 2px rgba(4, 120, 87, 0.2); }
.client .btn--primary:hover { background: #036046; }
.client .card { border-radius: 12px; border-color: var(--stone-200); }
.client .card__header { padding: 16px 20px; }
.client .card__title { font-size: 15px; }
.client .card__body { padding: 18px 20px; }
.client .tbl tbody td { height: 56px; font-size: 14px; }
.client .kpi { border-color: var(--stone-200); border-radius: 12px; }
.client .kpi__value { font-size: 32px; }
.client .filter-pill--active { background: var(--client-accent-50); border-color: var(--client-accent-100); color: var(--client-accent); }
.client .saved-view-tab.active { color: var(--client-accent); border-bottom-color: var(--client-accent); }
.client .tab.active { color: var(--client-accent); border-bottom-color: var(--client-accent); }
.client .tab.active .count { color: var(--client-accent); }
.client .timeline__dot { border-color: var(--client-accent); }
.client .sidebar__item--active .sidebar__item-icon { color: var(--client-accent); }
.client .topnav__app-switch-dot { background: var(--client-accent); }

/* Status board (client portal hero) */
.status-board {
  background: white;
  border: 1px solid var(--stone-200);
  border-radius: 12px;
  overflow: hidden;
}
.status-board__head, .status-board__row {
  display: grid;
  grid-template-columns: 200px repeat(var(--payer-count, 6), minmax(110px, 1fr));
  align-items: center;
}
.status-board__head {
  background: var(--stone-50);
  border-bottom: 1px solid var(--stone-200);
  font-size: 12px;
  font-weight: 600;
  color: var(--stone-600);
}
.status-board__head > div {
  padding: 10px 12px;
  text-align: center;
}
.status-board__head > div:first-child { text-align: left; }
.status-board__row { border-bottom: 1px solid var(--stone-100); }
.status-board__row:last-child { border-bottom: none; }
.status-board__provider {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.status-board__cell {
  padding: 10px;
  display: flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--stone-100);
  min-height: 64px;
  cursor: pointer;
  transition: background 0.1s;
}
.status-board__cell:hover { background: var(--stone-50); }
.status-board__cell-empty { color: var(--stone-300); font-size: 18px; }

/* Color-only swatches inside status board cells */
.status-board__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch-bg, var(--stone-100));
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  margin: 0 auto;
}
.status-board__swatch--green  { --swatch-bg: var(--status-green);  --swatch-fg: #166534; }
.status-board__swatch--amber  { --swatch-bg: var(--status-amber);  --swatch-fg: #92400e; }
.status-board__swatch--red    { --swatch-bg: var(--status-red);    --swatch-fg: #991b1b; }
.status-board__swatch--blue   { --swatch-bg: var(--status-blue);   --swatch-fg: #1e40af; }
.status-board__swatch--violet { --swatch-bg: var(--status-violet); --swatch-fg: #5b21b6; }
.status-board__swatch--indigo { --swatch-bg: var(--status-indigo); --swatch-fg: #3730a3; }
.status-board__swatch--orange { --swatch-bg: var(--status-orange); --swatch-fg: #9a3412; }
.status-board__swatch--slate  { --swatch-bg: var(--stone-400);     --swatch-fg: var(--stone-600); }
.status-board__swatch--gray   { --swatch-bg: var(--stone-300);     --swatch-fg: var(--stone-500); }

/* Contact rows (Paneled team contact details) */
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--stone-700);
  text-decoration: none;
  transition: background 0.1s;
}
.contact-row:hover { background: var(--stone-50); color: var(--stone-900); }
.contact-row svg { color: var(--stone-500); flex-shrink: 0; }


/* ===== Practice Detail redesign ===== */

/* Two-section property list on the Practice info card */
.practice-info { display: grid; grid-template-columns: 1fr; gap: 18px; }
.practice-info__section { min-width: 0; }
.practice-info .kv { grid-template-columns: 90px 1fr; }
.practice-info__heading {
  font-size: 11px; font-weight: 700; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--slate-100);
}
/* Two-column layout only on wide screens where the card has enough room */
@media (min-width: 1280px) {
  .practice-info { grid-template-columns: 1fr 1fr; gap: 20px 28px; }
}

/* Practice contact rows in the Contacts card */
.practice-contact {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
}
.practice-contact .badge { font-size: 10px; padding: 1px 6px; }

/* Hierarchical Documents tab */
.docs-section {
  border: 1px solid var(--slate-100);
  border-radius: 8px;
  margin: 0 8px 8px;
  overflow: hidden;
  background: white;
}
.docs-section__header {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--slate-50);
  border: none;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}
.docs-section__header:hover { background: var(--slate-100); }
.docs-section__chev {
  display: inline-flex;
  color: var(--slate-500);
  transition: transform 0.15s;
}
.docs-section__title { font-size: 13.5px; font-weight: 600; color: var(--slate-900); }
.docs-section__count {
  font-size: 11.5px; font-weight: 600; color: var(--slate-600);
  background: white; border: 1px solid var(--slate-200);
  border-radius: 10px; padding: 1px 7px;
}
.docs-section__sub { font-size: 12px; margin-left: 4px; }

/* Doc row */
.doc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: white;
}
.doc-row__icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--slate-50);
  color: var(--slate-500);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-row__main { flex: 1; min-width: 0; }

/* ===== Provider Notes tab ===== */
.note-row {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
  background: white;
}
.note-row:last-child { border-bottom: none; }
.note-row.is-pinned { background: linear-gradient(0deg, white, #fefce8); }
.note-row__main { flex: 1; min-width: 0; }
.note-row__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--slate-500); margin-bottom: 6px; }
.note-row__meta-actor { font-weight: 600; color: var(--slate-700); }
.note-row__body {
  font-size: 13.5px;
  color: var(--slate-800);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.note-row__pinned-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 7px 2px 5px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.note-row__pinned-tag svg { width: 10px; height: 10px; }
.note-row__actions { display: flex; gap: 2px; flex-shrink: 0; }


/* ===== Operations Status (Round B) ===== */

.ops-status-card .card__body { padding-top: 12px; }
.ops-status-card__hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ops-status-card__time {
  font-size: 12px;
  color: var(--slate-700);
  text-align: right;
  line-height: 1.4;
}
.ops-status-card__time .muted { color: var(--slate-400); }
.ops-status-card__reason {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px;
  color: var(--slate-700);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.ops-status-card__reason svg { color: var(--status-amber); flex-shrink: 0; margin-top: 1px; width: 14px; height: 14px; }
.ops-status-card__reason--paused   { background: var(--status-amber-bg); border-color: #fde68a; }
.ops-status-card__reason--paused   svg { color: var(--status-amber); }
.ops-status-card__reason--churned,
.ops-status-card__reason--archived { background: var(--slate-100); border-color: var(--slate-200); color: var(--slate-700); }
.ops-status-card__reason--churned svg,
.ops-status-card__reason--archived svg { color: var(--slate-500); }
.ops-status-card__reason--onboarding { background: var(--status-blue-bg); border-color: #bfdbfe; color: var(--slate-800); }
.ops-status-card__reason--onboarding svg { color: var(--status-blue); }

/* Status history list */
.ops-history { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--slate-100); }
.ops-history__heading {
  font-size: 11px; font-weight: 700; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.ops-history__list { display: flex; flex-direction: column; gap: 12px; }
.ops-history__row { display: flex; gap: 10px; align-items: flex-start; }
.ops-history__dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.ops-history__line { font-size: 12.5px; color: var(--slate-800); }
.ops-history__states { font-weight: 600; }
.ops-history__meta { font-size: 11.5px; color: var(--slate-500); margin-top: 1px; }
.ops-history__reason { font-size: 12px; color: var(--slate-600); margin-top: 4px; line-height: 1.45; }
.ops-history__cascade { margin-top: 4px; padding-left: 4px; border-left: 2px solid var(--slate-200); }

/* Prototype hint disclosure */
.proto-hint {
  margin-top: 14px;
  border-top: 1px dashed var(--slate-200);
  padding-top: 10px;
}
.proto-hint__trigger {
  background: transparent; border: none; padding: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  font-family: inherit;
}
.proto-hint__trigger:hover { color: var(--slate-700); }
.proto-hint__icon { font-size: 12px; }
.proto-hint__chev { display: inline-flex; transition: transform 0.15s; }
.proto-hint__chev svg { width: 10px; height: 10px; }
.proto-hint__body {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--slate-600);
  line-height: 1.5;
  background: var(--slate-50);
  border-radius: 6px;
  padding: 8px 10px;
}

/* Inline status badge on page headers — sits next to title */
.page__title-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Banner for non-active provider on Application Detail */
.ops-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: 9px;
  border: 1px solid;
  margin-bottom: 16px;
}
.ops-banner--paused { background: var(--status-amber-bg); border-color: rgba(217, 119, 6, 0.25); color: var(--slate-800); }
.ops-banner--archived { background: var(--slate-100); border-color: var(--slate-200); color: var(--slate-700); }
.ops-banner__icon { flex-shrink: 0; }
.ops-banner__main { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }
.ops-banner__main strong { font-weight: 600; }

/* Client portal paused banner */
.client-paused-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--status-amber-bg);
  border: 1px solid rgba(217, 119, 6, 0.3);
  margin-bottom: 22px;
}
.client-paused-banner__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--status-amber);
  flex-shrink: 0;
}
.client-paused-banner__main { flex: 1; min-width: 0; }
.client-paused-banner__title { font-size: 15px; font-weight: 700; color: var(--slate-900); margin-bottom: 4px; }
.client-paused-banner__body { font-size: 13px; color: var(--slate-700); line-height: 1.5; }

/* Round E5o — global portal read-only banner (paused/churned) */
.portal-readonly-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 32px;
  border-bottom: 1px solid transparent;
}
.portal-readonly-banner--paused { background: var(--status-amber-bg); border-bottom-color: rgba(217, 119, 6, 0.28); }
.portal-readonly-banner--churned { background: var(--slate-100); border-bottom-color: var(--slate-300); }
.portal-readonly-banner__icon { flex-shrink: 0; margin-top: 1px; }
.portal-readonly-banner--paused .portal-readonly-banner__icon { color: var(--status-amber); }
.portal-readonly-banner--churned .portal-readonly-banner__icon { color: var(--slate-500); }
.portal-readonly-banner__main { flex: 1; min-width: 0; }
.portal-readonly-banner__title { font-size: 14px; font-weight: 700; color: var(--slate-900); margin-bottom: 2px; }
.portal-readonly-banner__body { font-size: 12.5px; color: var(--slate-700); line-height: 1.5; }
.portal-readonly-banner__body a { color: inherit; }
.portal-readonly-banner__pill {
  flex-shrink: 0; align-self: center;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(255,255,255,0.7); color: var(--slate-600);
  border: 1px solid var(--slate-200);
}
.portal-readonly-banner--paused .portal-readonly-banner__pill { color: var(--status-amber); border-color: rgba(217, 119, 6, 0.3); }


/* Global search dropdown (top-nav) */
.topnav__search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 400px;
  background: white; border: 1px solid var(--slate-200); border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.22); z-index: 200;
  overflow: hidden; max-height: 480px; overflow-y: auto;
}
.topnav__search-section {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--slate-500); padding: 10px 14px 6px; background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}
.topnav__search-section:first-child { border-top: none; }
.topnav__search-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; border-top: 1px solid var(--slate-100);
}
.topnav__search-row:hover, .topnav__search-row.is-active { background: var(--slate-50); }

/* =====================================================================
   Round E5d — Document row three-dot action menu
   ===================================================================== */
.doc-action-menu-wrap { position: relative; display: inline-block; }
.doc-action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 4px;
  min-width: 152px;
  display: flex;
  flex-direction: column;
}
.doc-action-menu__item {
  all: unset;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--slate-800);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.doc-action-menu__item:hover { background: var(--slate-100); }
.doc-action-menu__item--danger { color: var(--status-red); }
.doc-action-menu__item--danger:hover { background: var(--status-red-bg); }
.doc-action-menu__item--disabled { color: var(--slate-400); cursor: not-allowed; }
.doc-action-menu__item--disabled:hover { background: transparent; }
