/* DentalNexa Super Admin (Components/Layout/AdminLayout.razor and every /admin page).
   Everything is scoped under .sa-shell so the practice workspace is untouched. Tokens first; components read only tokens. */

.sa-shell {
  --sa-primary: #2563eb;
  --sa-primary-strong: #1d4ed8;
  --sa-primary-soft: #eff4ff;
  --sa-navy: #0f172a;
  --sa-ink: #0f172a;
  --sa-ink-2: #334155;
  --sa-muted: #64748b;
  --sa-faint: #94a3b8;
  --sa-bg: #f8fafc;
  --sa-surface: #ffffff;
  --sa-line: #e2e8f0;
  --sa-line-soft: #eef2f7;
  --sa-good: #059669;
  --sa-good-soft: #ecfdf5;
  --sa-warn: #b45309;
  --sa-warn-soft: #fffbeb;
  --sa-bad: #dc2626;
  --sa-bad-soft: #fef2f2;
  --sa-radius: 14px;
  --sa-radius-sm: 10px;
  --sa-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --sa-shadow-lg: 0 12px 32px -12px rgba(15, 23, 42, .18);
  /* chart series: the validated categorical order (dataviz reference palette, light mode) */
  --sa-s1: #2a78d6; --sa-s2: #eb6834; --sa-s3: #1baf7a; --sa-s4: #eda100;
  --sa-s5: #e87ba4; --sa-s6: #008300; --sa-s7: #6250d6;
  --sa-sidebar-w: 268px;

  display: flex;
  min-height: 100vh;
  background: var(--sa-bg);
  color: var(--sa-ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}
body:has(.sa-shell) { background: #f8fafc; }

/* ---- sidebar (white, blue accents) ---------------------------------------------------------------------------------------------- */
/* The drawer toggle is the checkbox itself (keyboard: Tab to it, Space). Off the tab order on wide screens, where there is no drawer. */
.sa-shell .sa-nav-toggle { position: absolute; opacity: 0; pointer-events: none; display: none; }
.sa-shell .sa-nav-toggle:focus-visible ~ .sa-body .sa-menu { outline: 2px solid var(--sa-primary); outline-offset: 2px; }
.sa-shell .sa-sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sa-sidebar-w); flex: 0 0 var(--sa-sidebar-w);
  display: flex; flex-direction: column; background: #fff; color: var(--sa-ink-2); border-right: 1px solid var(--sa-line); overflow-y: auto; z-index: 40;
  scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent;
}
.sa-shell .sa-brand { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 18px; }
.sa-shell .sa-brand-link { display: flex; align-items: center; gap: 11px; color: var(--sa-ink); text-decoration: none; }
.sa-shell .sa-brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 6px 16px -8px rgba(37, 99, 235, .7); }
.sa-shell .sa-brand-mark svg { width: 21px; height: 21px; }
.sa-shell .sa-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sa-shell .sa-brand-text strong { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.sa-shell .sa-brand-text strong span { color: var(--sa-primary); }
.sa-shell .sa-brand-text small { font-size: 10.5px; color: var(--sa-faint); letter-spacing: .08em; text-transform: uppercase; font-weight: 650; margin-top: 2px; }
.sa-shell .sa-close { display: none; color: var(--sa-muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.sa-shell .sa-nav { padding: 2px 12px 16px; flex: 1; }
.sa-shell .sa-sections, .sa-shell .sa-sub { list-style: none; margin: 0; padding: 0; }
.sa-shell .sa-sections { display: grid; gap: 2px; }
.sa-shell .sa-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--sa-ink-2); text-decoration: none;
  font-size: 14px; font-weight: 550; transition: background .12s, color .12s; min-width: 0;
}
.sa-shell .sa-link:hover { background: var(--sa-bg); color: var(--sa-ink); }
.sa-shell .sa-link:focus-visible, .sa-shell .sa-sublink:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: -2px; }
.sa-shell .sa-link.active { background: var(--sa-primary-soft); color: var(--sa-primary-strong); }
.sa-shell .sa-link.active .sa-icon { color: var(--sa-primary); }
.sa-shell .sa-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--sa-faint); }
.sa-shell .sa-icon svg { width: 18px; height: 18px; display: block; }
.sa-shell .sa-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-shell .sa-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sa-primary); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* A section with sub-pages: the label is a link, the chevron beside it opens the list. */
.sa-shell .sa-sidebar .sa-sec, .sa-shell .sa-sidebar .sa-sec[open] { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; border-radius: 0 !important; }
.sa-shell .sa-sec > summary { list-style: none; display: flex; align-items: center; gap: 2px; cursor: pointer; background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.sa-shell .sa-sec > summary::-webkit-details-marker { display: none; }
.sa-shell .sa-sec > summary .sa-link { flex: 1; }
.sa-shell .sa-chevron { flex: 0 0 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--sa-faint); }
.sa-shell .sa-chevron::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.sa-shell .sa-sec[open] > summary .sa-chevron::before { transform: rotate(45deg) translate(-2px, -2px); }
.sa-shell .sa-sec > summary:hover .sa-chevron { background: var(--sa-bg); color: var(--sa-ink-2); }
.sa-shell .sa-sec > summary:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: -2px; border-radius: 10px; }
.sa-shell .sa-sub { margin: 2px 0 6px 19px; padding-left: 12px !important; border-left: 1px solid var(--sa-line); display: grid; gap: 1px; }
.sa-shell .sa-sublink { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--sa-muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.sa-shell .sa-sublink:hover { background: var(--sa-bg); color: var(--sa-ink); }
.sa-shell .sa-sublink.active { color: var(--sa-primary-strong); background: var(--sa-primary-soft); font-weight: 600; }
.sa-shell .sa-sidebar-foot { padding: 12px; border-top: 1px solid var(--sa-line-soft); }
.sa-shell .sa-sidebar-foot .sa-link { font-size: 13px; color: var(--sa-muted); }

/* ---- top bar ------------------------------------------------------------------------------------------------------------------- */
.sa-shell .sa-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sa-shell .sa-topbar {
  position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(248, 250, 252, .86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--sa-line);
}
.sa-shell .sa-menu { display: none; flex-direction: column; gap: 4px; padding: 9px; border-radius: 9px; cursor: pointer; border: 1px solid var(--sa-line); background: #fff; }
.sa-shell .sa-menu span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--sa-ink-2); }
.sa-shell .sa-crumb { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.sa-shell .sa-pill { font-size: 11px; font-weight: 700; color: var(--sa-primary); background: var(--sa-primary-soft); border: 1px solid #dbe6fe; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.sa-shell .sa-crumb-page { font-weight: 600; color: var(--sa-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-shell .sa-top-actions { display: flex; align-items: center; gap: 10px; }
.sa-shell .sa-top-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--sa-line); background: #fff; color: var(--sa-ink-2); font-weight: 600; font-size: 13px; text-decoration: none; }
.sa-shell .sa-top-link svg { width: 15px; height: 15px; }
.sa-shell .sa-top-link:hover { border-color: #cbd5e1; color: var(--sa-ink); }
.sa-shell .sa-profile { position: relative; }
.sa-shell .sa-profile summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 12px; }
.sa-shell .sa-profile summary::-webkit-details-marker { display: none; }
.sa-shell .sa-profile summary:hover, .sa-shell .sa-profile[open] summary { background: #fff; box-shadow: var(--sa-shadow); }
.sa-shell .sa-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; font-weight: 700; }
.sa-shell .sa-profile-text { display: flex; flex-direction: column; line-height: 1.2; }
.sa-shell .sa-profile-text strong { font-size: 13px; }
.sa-shell .sa-profile-text small { font-size: 11.5px; color: var(--sa-muted); }
.sa-shell .sa-profile-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff; border: 1px solid var(--sa-line); border-radius: 14px; box-shadow: var(--sa-shadow-lg); padding: 6px; display: grid; }
.sa-shell .sa-profile-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--sa-line-soft); margin-bottom: 4px; display: grid; gap: 2px; }
.sa-shell .sa-profile-head small { color: var(--sa-muted); overflow: hidden; text-overflow: ellipsis; }
.sa-shell .sa-profile-menu a, .sa-shell .sa-profile-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--sa-ink-2); text-decoration: none; font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; }
.sa-shell .sa-profile-menu a:hover, .sa-shell .sa-profile-menu button:hover { background: var(--sa-bg); color: var(--sa-ink); }
.sa-shell .sa-profile-menu form { margin: 4px 0 0; border-top: 1px solid var(--sa-line-soft); padding-top: 4px; }

.sa-shell .sa-main { padding: 28px 28px 48px; max-width: 1480px; width: 100%; box-sizing: border-box; }
.sa-shell .sa-scrim { display: none; }

/* ---- shared page components restyled (existing admin pages) ---------------------------------------------------------------------- */
.sa-shell .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 22px; padding: 0; background: none; border: 0; box-shadow: none; }
.sa-shell .page-heading h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 2px 0 0; color: var(--sa-ink); font-weight: 700; }
.sa-shell .page-heading p { color: var(--sa-muted); font-size: 14px; max-width: 76ch; line-height: 1.55; margin: 6px 0 0; }
.sa-shell .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--sa-primary); text-transform: uppercase; }
.sa-shell .panel { background: var(--sa-surface); border: 1px solid var(--sa-line); border-radius: var(--sa-radius); box-shadow: var(--sa-shadow); padding: 22px; margin-bottom: 20px; }
.sa-shell .panel h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--sa-ink); margin: 0 0 12px; }
.sa-shell .panel h3 { font-size: 14px; font-weight: 650; color: var(--sa-ink); }
.sa-shell .panel-copy, .sa-shell .panel-lead { color: var(--sa-muted); }
.sa-shell .primary-action, .sa-shell .primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--sa-primary); color: #fff; border: 1px solid var(--sa-primary);
  border-radius: 10px; padding: 9px 15px; font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer; box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.sa-shell .primary-action:hover, .sa-shell .primary-btn:hover { background: var(--sa-primary-strong); }
.sa-shell .secondary-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; color: var(--sa-ink-2); border: 1px solid var(--sa-line);
  border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer;
}
.sa-shell .secondary-action:hover { border-color: #cbd5e1; color: var(--sa-ink); background: #fff; }
.sa-shell :is(.primary-btn, .sa-shell .secondary-action, .sa-shell .primary-action):disabled { opacity: .55; cursor: not-allowed; }
.sa-shell .link-btn { color: var(--sa-primary) !important; font-size: 13px; text-decoration: none; font-weight: 600; }
.sa-shell .link-btn:hover { text-decoration: underline; }
.sa-shell .data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.sa-shell .data-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--sa-muted); padding: 10px 12px; border-bottom: 1px solid var(--sa-line); background: #fbfcfe; }
.sa-shell .data-table td { padding: 12px; border-bottom: 1px solid var(--sa-line-soft); color: var(--sa-ink-2); vertical-align: middle; }
.sa-shell .data-table tbody tr:hover td { background: #fafbfd; }
.sa-shell .data-table tbody tr:last-child td { border-bottom: 0; }
.sa-shell .data-table td b { color: var(--sa-ink); font-weight: 600; }
.sa-shell .metric-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.sa-shell .metric-grid article { background: #fff; border: 1px solid var(--sa-line); border-radius: var(--sa-radius); padding: 16px 18px; box-shadow: var(--sa-shadow); }
.sa-shell .metric-grid article span { color: var(--sa-muted); font-size: 12.5px; font-weight: 500; }
.sa-shell .metric-grid article strong { display: block; font-size: 24px; letter-spacing: -.02em; margin: 6px 0 2px; color: var(--sa-ink); }
.sa-shell .alert { border-radius: 12px; }
.sa-shell input:not([type=checkbox]):not([type=radio]), .sa-shell select, .sa-shell textarea {
  border: 1px solid var(--sa-line); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 13.5px; color: var(--sa-ink); background: #fff;
}
.sa-shell input:focus-visible, .sa-shell select:focus-visible, .sa-shell textarea:focus-visible { outline: 2px solid #bfd3fe; border-color: var(--sa-primary); }
.sa-shell .status { border-radius: 999px; font-size: 12px; font-weight: 600; padding: 3px 9px; }

/* ---- page header (new pages) --------------------------------------------------------------------------------------------------- */
.sa-shell .sa-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.sa-shell .sa-head h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 750; color: var(--sa-ink); }
.sa-shell .sa-head p { margin: 6px 0 0; color: var(--sa-muted); font-size: 14.5px; max-width: 70ch; }
.sa-shell .sa-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-shell .sa-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--sa-line); background: #fff; color: var(--sa-ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sa-shell .sa-btn:hover:not(:disabled) { border-color: #cbd5e1; color: var(--sa-ink); }
.sa-shell .sa-btn:disabled { opacity: .55; cursor: not-allowed; }
.sa-shell .sa-btn svg { width: 15px; height: 15px; }
.sa-shell .sa-btn.primary { background: var(--sa-primary); border-color: var(--sa-primary); color: #fff; }
.sa-shell .sa-btn.primary:hover:not(:disabled) { background: var(--sa-primary-strong); color: #fff; }
.sa-shell .sa-select { height: 38px; border-radius: 10px; border: 1px solid var(--sa-line); background: #fff; padding: 0 30px 0 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--sa-ink-2); }
.sa-shell .sa-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef2f7; gap: 2px; }
.sa-shell .sa-seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--sa-muted); cursor: pointer; }
.sa-shell .sa-seg button[aria-pressed=true] { background: #fff; color: var(--sa-ink); box-shadow: var(--sa-shadow); }

/* ---- cards ---------------------------------------------------------------------------------------------------------------------- */
.sa-shell .sa-card { background: var(--sa-surface); border: 1px solid var(--sa-line); border-radius: var(--sa-radius); box-shadow: var(--sa-shadow); }
.sa-shell .sa-card-pad { padding: 20px 22px; }
.sa-shell .sa-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.sa-shell .sa-card-head h2 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; color: var(--sa-ink); }
.sa-shell .sa-card-head p { margin: 3px 0 0; color: var(--sa-muted); font-size: 12.5px; }
.sa-shell .sa-card-body { padding: 16px 22px 20px; }
.sa-shell .sa-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.sa-shell .sa-section-title h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sa-muted); }

.sa-shell .sa-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sa-shell .sa-kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 16px; text-decoration: none; color: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.sa-shell a.sa-kpi:hover { border-color: #c7d6f7; box-shadow: var(--sa-shadow-lg); transform: translateY(-1px); }
.sa-shell a.sa-kpi:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: 2px; }
.sa-shell .sa-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sa-shell .sa-kpi-label { font-size: 13px; font-weight: 600; color: var(--sa-ink-2); }
.sa-shell .sa-kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sa-primary-soft); color: var(--sa-primary); flex: 0 0 34px; }
.sa-shell .sa-kpi-icon svg { width: 18px; height: 18px; }
.sa-shell .sa-kpi-icon.green { background: var(--sa-good-soft); color: var(--sa-good); }
.sa-shell .sa-kpi-icon.amber { background: var(--sa-warn-soft); color: var(--sa-warn); }
.sa-shell .sa-kpi-icon.violet { background: #f3f0ff; color: #6250d6; }
.sa-shell .sa-kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; color: var(--sa-ink); font-variant-numeric: tabular-nums; }
.sa-shell .sa-kpi-value.negative { color: var(--sa-bad); }
.sa-shell .sa-kpi-value.muted { color: var(--sa-faint); }
.sa-shell .sa-kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.sa-shell .sa-kpi-sub { font-size: 12px; color: var(--sa-muted); line-height: 1.4; }
.sa-shell .sa-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: var(--sa-muted); }
.sa-shell .sa-delta.up { background: var(--sa-good-soft); color: var(--sa-good); }
.sa-shell .sa-delta.down { background: var(--sa-bad-soft); color: var(--sa-bad); }
.sa-shell .sa-delta.up.cost { background: var(--sa-bad-soft); color: var(--sa-bad); }
.sa-shell .sa-delta.down.cost { background: var(--sa-good-soft); color: var(--sa-good); }
.sa-shell .sa-spark { width: 96px; height: 30px; flex: 0 0 96px; }
.sa-shell .sa-spark path.line { fill: none; stroke: var(--sa-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sa-shell .sa-spark path.area { fill: url(#sa-spark-fill); stroke: none; }
.sa-shell .sa-quality { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sa-shell .sa-quality::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sa-shell .sa-quality.actual { background: var(--sa-good-soft); color: var(--sa-good); }
.sa-shell .sa-quality.estimated { background: var(--sa-primary-soft); color: var(--sa-primary); }
.sa-shell .sa-quality.projected { background: #f3f0ff; color: #5b45d0; }
.sa-shell .sa-quality.incomplete { background: var(--sa-warn-soft); color: var(--sa-warn); }
.sa-shell .sa-quality.unavailable { background: #f1f5f9; color: var(--sa-muted); }

.sa-shell .sa-mini-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.sa-shell .sa-mini { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.sa-shell a.sa-mini:hover { border-color: #c7d6f7; box-shadow: var(--sa-shadow-lg); }
.sa-shell a.sa-mini:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: 2px; }
.sa-shell .sa-mini .sa-kpi-icon { width: 36px; height: 36px; }
.sa-shell .sa-mini-text { min-width: 0; display: grid; gap: 1px; }
.sa-shell .sa-mini-text span { font-size: 12px; color: var(--sa-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-shell .sa-mini-text strong { font-size: 20px; font-weight: 750; letter-spacing: -.02em; color: var(--sa-ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sa-shell .sa-mini-text small { font-size: 11.5px; color: var(--sa-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sa-shell .sa-grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.sa-shell .sa-grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

/* ---- data quality button + panel -------------------------------------------------------------------------------------------------- */
.sa-shell .sa-dq { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid #fde4b8; background: var(--sa-warn-soft); color: #92400e; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.sa-shell .sa-dq.ok { border-color: #bbf0d6; background: var(--sa-good-soft); color: #047857; }
.sa-shell .sa-dq-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.sa-shell .sa-dq.ok .sa-dq-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.sa-shell .sa-drawer-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 90; border: 0; }
.sa-shell .sa-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 91; box-shadow: -20px 0 40px -20px rgba(15, 23, 42, .35); display: flex; flex-direction: column; animation: sa-slide .18s ease-out; }
@keyframes sa-slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sa-shell .sa-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 14px; border-bottom: 1px solid var(--sa-line); }
.sa-shell .sa-drawer-head h2 { margin: 0; font-size: 18px; }
.sa-shell .sa-drawer-head p { margin: 4px 0 0; color: var(--sa-muted); font-size: 13px; }
.sa-shell .sa-drawer-close { border: 1px solid var(--sa-line); background: #fff; width: 34px; height: 34px; border-radius: 9px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--sa-ink-2); }
.sa-shell .sa-drawer-body { padding: 16px 22px 24px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.sa-shell .sa-dq-item { border: 1px solid var(--sa-line); border-radius: 12px; padding: 13px 14px; display: grid; gap: 4px; }
.sa-shell .sa-dq-item.blocking { border-left: 3px solid #f59e0b; }
.sa-shell .sa-dq-item small { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sa-faint); }
.sa-shell .sa-dq-item strong { font-size: 13.5px; color: var(--sa-ink); }
.sa-shell .sa-dq-item p { margin: 0; font-size: 12.5px; color: var(--sa-muted); line-height: 1.5; }
.sa-shell .sa-dq-item a { font-size: 12.5px; font-weight: 650; color: var(--sa-primary); text-decoration: none; justify-self: start; margin-top: 2px; }
.sa-shell .sa-dq-legend { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--sa-bg); font-size: 12.5px; color: var(--sa-ink-2); }
.sa-shell .sa-dq-legend div { display: flex; gap: 8px; align-items: baseline; }

/* ---- charts --------------------------------------------------------------------------------------------------------------------- */
.sa-shell .sa-chart { position: relative; }
.sa-shell .sa-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.sa-shell .sa-chart .grid line { stroke: #eef2f7; stroke-width: 1; }
.sa-shell .sa-chart .axis text { fill: #64748b; font-size: 11px; font-family: inherit; }
.sa-shell .sa-chart .axis .baseline { stroke: #cbd5e1; }
.sa-shell .sa-chart .bar { transition: opacity .12s; }
.sa-shell .sa-chart .hit { fill: transparent; cursor: default; outline: none; }
.sa-shell .sa-chart .hit:focus-visible { stroke: var(--sa-primary); stroke-width: 1.5; fill: rgba(37, 99, 235, .04); }
.sa-shell .sa-chart .hit.is-hot { fill: rgba(15, 23, 42, .035); }
.sa-shell .sa-chart .nodata text { fill: #94a3b8; font-size: 10.5px; }
.sa-shell .sa-chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sa-shell .sa-chart .dot { stroke: #fff; stroke-width: 2; }
.sa-shell .sa-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 12.5px; color: var(--sa-ink-2); }
.sa-shell .sa-legend li { display: inline-flex; align-items: center; gap: 7px; }
.sa-shell .sa-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 10px; }
.sa-shell .sa-key.line { height: 3px; border-radius: 2px; width: 14px; }
.sa-shell .sa-tip { position: absolute; display: none; transform: translateX(-50%); background: #0f172a; color: #e2e8f0; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 9px; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: var(--sa-shadow-lg); }
.sa-shell .sa-tip-title { color: #fff; font-weight: 650; margin-bottom: 2px; }
.sa-shell .sa-chart-empty { display: grid; place-items: center; text-align: center; gap: 6px; min-height: 220px; color: var(--sa-muted); padding: 20px; border: 1px dashed var(--sa-line); border-radius: 12px; background: #fcfdfe; }
.sa-shell .sa-chart-empty strong { color: var(--sa-ink-2); font-size: 14px; }
.sa-shell .sa-chart-empty p { margin: 0; font-size: 12.5px; max-width: 42ch; line-height: 1.5; }
.sa-shell .sa-chart-table summary { cursor: pointer; font-size: 12.5px; color: var(--sa-primary); font-weight: 600; margin-top: 10px; }
.sa-shell .sa-chart-table table { margin-top: 8px; }
.sa-shell .sa-donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; }
.sa-shell .sa-donut { position: relative; }
.sa-shell .sa-donut-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; pointer-events: none; }
.sa-shell .sa-donut-center strong { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.sa-shell .sa-donut-center small { font-size: 11px; color: var(--sa-muted); }
.sa-shell .sa-donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sa-shell .sa-donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 12.5px; }
.sa-shell .sa-donut-legend .name { color: var(--sa-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-shell .sa-donut-legend .amt { font-weight: 650; color: var(--sa-ink); font-variant-numeric: tabular-nums; }
.sa-shell .sa-donut-legend .pct { color: var(--sa-faint); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.sa-shell .sa-donut-legend .zero { color: var(--sa-faint); }

/* ---- tables (new pages) ----------------------------------------------------------------------------------------------------------- */
.sa-shell .sa-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sa-shell .sa-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.sa-shell .sa-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--sa-muted); padding: 10px 14px; border-bottom: 1px solid var(--sa-line); white-space: nowrap; background: #fbfcfe; }
.sa-shell .sa-table th.num, .sa-shell .sa-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sa-shell .sa-table td { padding: 13px 14px; border-bottom: 1px solid var(--sa-line-soft); color: var(--sa-ink-2); vertical-align: middle; }
.sa-shell .sa-table tbody tr:last-child td { border-bottom: 0; }
.sa-shell .sa-table tbody tr:hover td { background: #fafbfd; }
.sa-shell .sa-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sa-shell .sa-table th button:focus-visible { outline: 2px solid var(--sa-primary); border-radius: 4px; }
.sa-shell .sa-practice { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sa-shell .sa-practice-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--sa-primary); background: var(--sa-primary-soft); flex: 0 0 34px; }
.sa-shell .sa-practice b { display: block; color: var(--sa-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.sa-shell .sa-practice small { color: var(--sa-faint); font-size: 12px; }
.sa-shell .sa-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #f1f5f9; color: var(--sa-ink-2); }
.sa-shell .sa-chip.good { background: var(--sa-good-soft); color: #047857; }
.sa-shell .sa-chip.info { background: var(--sa-primary-soft); color: var(--sa-primary-strong); }
.sa-shell .sa-chip.warn { background: var(--sa-warn-soft); color: var(--sa-warn); }
.sa-shell .sa-chip.bad { background: var(--sa-bad-soft); color: var(--sa-bad); }
.sa-shell .sa-chip.muted { background: #f1f5f9; color: var(--sa-muted); }
.sa-shell .sa-neg { color: var(--sa-bad); }
.sa-shell .sa-est { color: var(--sa-faint); font-size: 11.5px; margin-left: 3px; }
.sa-shell .sa-row-link { color: var(--sa-primary); font-weight: 650; text-decoration: none; font-size: 13px; white-space: nowrap; }
.sa-shell .sa-row-link:hover { text-decoration: underline; }
.sa-shell .sa-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--sa-line-soft); font-size: 12.5px; color: var(--sa-muted); flex-wrap: wrap; }
.sa-shell .sa-pager { display: flex; align-items: center; gap: 6px; }
.sa-shell .sa-pager button { min-width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--sa-line); background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--sa-ink-2); cursor: pointer; }
.sa-shell .sa-pager button[aria-current=page] { background: var(--sa-primary); border-color: var(--sa-primary); color: #fff; }
.sa-shell .sa-pager button:disabled { opacity: .45; cursor: not-allowed; }
.sa-shell .sa-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--sa-line-soft); }
.sa-shell .sa-filter-chip { border: 1px solid var(--sa-line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--sa-ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sa-shell .sa-filter-chip b { color: var(--sa-faint); font-weight: 650; }
.sa-shell .sa-filter-chip[aria-pressed=true] { background: var(--sa-navy); border-color: var(--sa-navy); color: #fff; }
.sa-shell .sa-filter-chip[aria-pressed=true] b { color: #93c5fd; }
.sa-shell .sa-search { margin-left: auto; position: relative; }
.sa-shell .sa-search input { height: 36px; width: 260px; padding-left: 34px !important; }
.sa-shell .sa-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--sa-faint); }
.sa-shell .sa-empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--sa-muted); }
.sa-shell .sa-empty strong { color: var(--sa-ink); font-size: 15px; }
.sa-shell .sa-empty p { margin: 0; max-width: 46ch; font-size: 13px; line-height: 1.5; }
.sa-shell .sa-skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%); background-size: 400% 100%; animation: sa-shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes sa-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sa-shell .sa-skel-card { height: 136px; border-radius: var(--sa-radius); }
.sa-shell .sa-skel-mini { height: 70px; border-radius: var(--sa-radius); }
.sa-shell .sa-skel-chart { height: 320px; border-radius: var(--sa-radius); }
.sa-shell .sa-error { display: grid; gap: 10px; justify-items: start; padding: 22px; border: 1px solid #fecaca; background: var(--sa-bad-soft); border-radius: var(--sa-radius); color: #7f1d1d; }
.sa-shell .sa-error strong { font-size: 15px; }
.sa-shell .sa-note { font-size: 12.5px; color: var(--sa-muted); line-height: 1.55; }
.sa-shell .sa-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.sa-shell .sa-kv div { background: var(--sa-bg); border-radius: 12px; padding: 12px 14px; }
.sa-shell .sa-kv dt { font-size: 12px; color: var(--sa-muted); margin: 0 0 3px; }
.sa-shell .sa-kv dd { margin: 0; font-weight: 650; color: var(--sa-ink); font-size: 14.5px; overflow-wrap: anywhere; }
.sa-shell .sa-check { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 22px; border-bottom: 1px solid var(--sa-line-soft); }
.sa-shell .sa-check:last-child { border-bottom: 0; }
.sa-shell .sa-check-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.sa-shell .sa-check-icon.warning { background: var(--sa-warn-soft); color: var(--sa-warn); }
.sa-shell .sa-check-icon.critical { background: var(--sa-bad-soft); color: var(--sa-bad); }
.sa-shell .sa-check strong { display: block; font-size: 13.5px; color: var(--sa-ink); }
.sa-shell .sa-check p { margin: 2px 0 0; font-size: 12.5px; color: var(--sa-muted); line-height: 1.5; }
.sa-shell .sa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sa-shell .sa-tile { display: grid; gap: 6px; padding: 18px; text-decoration: none; color: inherit; }
.sa-shell a.sa-tile:hover { border-color: #c7d6f7; box-shadow: var(--sa-shadow-lg); }
.sa-shell .sa-tile strong { font-size: 14.5px; color: var(--sa-ink); }
.sa-shell .sa-tile p { margin: 0; font-size: 12.5px; color: var(--sa-muted); line-height: 1.5; }

/* ---- responsive ----------------------------------------------------------------------------------------------------------------- */
@media (max-width: 1360px) {
  .sa-shell .sa-mini-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sa-shell .sa-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-shell .sa-grid-2, .sa-shell .sa-grid-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .sa-shell .sa-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 40px -20px rgba(15, 23, 42, .5); }
  .sa-shell .sa-nav-toggle:checked ~ .sa-sidebar { transform: none; }
  .sa-shell .sa-nav-toggle:checked ~ .sa-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; cursor: pointer; }
  .sa-shell .sa-close { display: block; }
  .sa-shell .sa-menu { display: flex; }
  .sa-shell .sa-nav-toggle { display: block; top: 0; left: 0; width: 1px; height: 1px; }
  .sa-shell .sa-topbar { padding: 0 18px; }
  .sa-shell .sa-main { padding: 22px 18px 40px; }
}
@media (max-width: 720px) {
  .sa-shell .sa-kpis, .sa-shell .sa-mini-kpis { grid-template-columns: minmax(0, 1fr); }
  .sa-shell .sa-mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-shell .sa-head h1 { font-size: 23px; }
  .sa-shell .sa-top-link span, .sa-shell .sa-profile-text { display: none; }
  .sa-shell .sa-topbar { padding: 0 16px; gap: 10px; }
  .sa-shell .sa-main { padding: 18px 16px 36px; }
  .sa-shell .sa-donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .sa-shell .sa-donut-legend { width: 100%; }
  .sa-shell .sa-search { margin-left: 0; width: 100%; }
  .sa-shell .sa-search input { width: 100%; box-sizing: border-box; }
  .sa-shell .sa-card-head, .sa-shell .sa-card-body { padding-left: 16px; padding-right: 16px; }
  .sa-shell .sa-filters { padding: 14px 16px; }
  .sa-shell .page-heading { flex-direction: column; align-items: stretch; }
  .sa-shell .panel { padding: 16px; }
  .sa-shell .sa-toolbar { width: 100%; }
  .sa-shell .sa-toolbar > * { flex: 1 1 auto; justify-content: center; }
  .sa-shell .sa-check { padding: 14px 16px; grid-template-columns: 32px minmax(0, 1fr); }
  .sa-shell .sa-check > a { grid-column: 2; }
}
@media (max-width: 420px) {
  .sa-shell .sa-mini-kpis { grid-template-columns: minmax(0, 1fr); }
  .sa-shell .sa-kpi-value { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-shell .sa-sidebar, .sa-shell .sa-drawer, .sa-shell a.sa-kpi { transition: none; animation: none; }
  .sa-shell .sa-skeleton { animation: none; }
}

.sa-shell .sa-mini-text span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.sa-shell .sa-pr-plan { display: block; font-size: 12.5px; color: var(--sa-muted); margin-bottom: 4px; }
.sa-shell .sa-pr-notes { display: block; font-size: 11.5px; color: var(--sa-faint); margin-top: 3px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-shell .sa-pr-usage { font-size: 12.5px; color: var(--sa-ink-2); }
.sa-shell .sa-pr-usage span { display: inline-block; margin-right: 10px; white-space: nowrap; }
.sa-shell .sa-practice .pr-id { display: block; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Older admin pages: tab strips and toolbars stay inside the screen. */
.sa-shell .tab-strip { display: flex; gap: 4px; padding: 4px; background: #eef2f7; border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 0; }
.sa-shell .tab-strip::-webkit-scrollbar { display: none; }
.sa-shell .tab-strip button { flex: 0 0 auto; border: 0; background: none; padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--sa-muted); cursor: pointer; white-space: nowrap; }
.sa-shell .tab-strip button.active, .sa-shell .tab-strip button[aria-selected=true] { background: #fff; color: var(--sa-ink); box-shadow: var(--sa-shadow); }
.sa-shell .toolbar > label, .sa-shell .toolbar select, .sa-shell .toolbar input { max-width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 720px) {
  .sa-shell .toolbar > label { flex: 1 1 100%; display: grid; gap: 4px; }
  .sa-shell .toolbar select, .sa-shell .toolbar input { width: 100%; }
}
/* SVG charts scale with their width; on a phone (~0.45×) the axis text needs a larger size in chart units to read at ~10px. */
@media (max-width: 720px) {
  .sa-shell .sa-chart .axis text { font-size: 22px; }
  .sa-shell .sa-chart .nodata text { font-size: 18px; }
  .sa-shell .sa-chart .series-line { stroke-width: 4; }
  .sa-shell .sa-chart .dot { r: 7; stroke-width: 3; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .sa-shell .sa-chart .axis text { font-size: 14px; }
}

/* ---- simplified dashboard (2026-11-09) ------------------------------------------------------------------------------------------- */
.sa-shell .sa-crumb-sub { color: var(--sa-muted); font-weight: 500; }
.sa-shell .sa-dash-kpis .sa-kpi { padding: 20px 22px; gap: 8px; }
.sa-shell .sa-dash-kpis .sa-kpi-value { font-size: 32px; }
.sa-shell .sa-dash-kpis .sa-kpi-value.muted { font-size: 26px; color: var(--sa-warn); }
.sa-shell .sa-dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.sa-shell .sa-flush { padding-left: 0 !important; padding-right: 0 !important; padding-bottom: 6px !important; }
.sa-shell .sa-chart-note { margin: 8px 0 0; }
.sa-shell .sa-notes { list-style: none; margin: 10px 0 0; padding: 0 10px 12px; display: grid; gap: 2px; }
.sa-shell .sa-note-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; color: var(--sa-ink-2); text-decoration: none; font-size: 13.5px; line-height: 1.4; }
.sa-shell .sa-note-link:hover { background: var(--sa-bg); color: var(--sa-ink); }
.sa-shell .sa-note-link:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: -2px; }
.sa-shell .sa-note-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--sa-primary); }
.sa-shell .sa-note-dot.warning { background: #f59e0b; }
.sa-shell .sa-note-dot.critical { background: var(--sa-bad); }
.sa-shell .sa-note-text { flex: 1; min-width: 0; }
.sa-shell .sa-note-go { color: var(--sa-faint); font-size: 18px; line-height: 1; }
.sa-shell .sa-notes-empty { display: flex; align-items: center; gap: 10px; padding: 22px; color: var(--sa-muted); font-size: 13.5px; }
.sa-shell .sa-notes-empty span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--sa-good-soft); color: var(--sa-good); font-weight: 700; }

/* ---- section tabs (Revenue & Costs) ----------------------------------------------------------------------------------------------- */
.sa-shell .sa-tabs-wrap { margin: -6px 0 22px; display: grid; gap: 10px; }
.sa-shell .sa-tabs-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sa-primary); }
.sa-shell .sa-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sa-line); overflow-x: auto; scrollbar-width: none; }
.sa-shell .sa-tabs::-webkit-scrollbar { display: none; }
.sa-shell .sa-tab { flex: 0 0 auto; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--sa-muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.sa-shell .sa-tab:hover { color: var(--sa-ink); }
.sa-shell .sa-tab.active { color: var(--sa-primary-strong); border-bottom-color: var(--sa-primary); }
.sa-shell .sa-tab:focus-visible { outline: 2px solid var(--sa-primary); outline-offset: -2px; border-radius: 6px; }
.sa-shell .sa-subtabs { display: inline-flex; gap: 2px; padding: 3px; background: #eef2f7; border-radius: 10px; justify-self: start; }
.sa-shell .sa-subtabs a { padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--sa-muted); text-decoration: none; }
.sa-shell .sa-subtabs a.active { background: #fff; color: var(--sa-ink); box-shadow: var(--sa-shadow); }
.sa-shell .fo-setup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sa-shell .fo-legend { justify-content: flex-start; gap: 14px; }
.sa-shell .fo-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Dental Practices -------------------------------------------------------------------------------------------------------------- */
.sa-shell .dp-filters .dp-search { margin-left: 0; margin-right: auto; }
.sa-shell .sa-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.sa-shell .dp-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sa-shell .dp-kv dd { font-size: 13.5px; }
.sa-shell .dp-id { font-family: ui-monospace, Consolas, monospace; font-size: 12px !important; font-weight: 500 !important; }
.sa-shell .dp-sub { margin: 10px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sa-muted); }
.sa-shell .dp-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-shell .dp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sa-shell .dp-danger { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--sa-line-soft); display: grid; gap: 8px; justify-items: start; }
.sa-shell .dp-danger .sa-note { margin: 0; }
.sa-shell .dp-reason { display: grid; gap: 6px; width: 100%; font-size: 13px; font-weight: 600; color: var(--sa-ink-2); }
.sa-shell .dp-reason input { width: 100%; box-sizing: border-box; }

@media (max-width: 1180px) {
  .sa-shell .sa-dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .sa-shell .sa-dash-kpis .sa-kpi-value { font-size: 28px; }
  .sa-shell .dp-filters label:not(.dp-search) { flex: 1 1 45%; }
  .sa-shell .dp-filters select { width: 100%; }
  .sa-shell .dp-kv { grid-template-columns: minmax(0, 1fr); }
  .sa-shell .sa-tabs-wrap { margin-top: 0; }
}

/* Absolutely positioned children (screen-reader labels) must stay inside the scroll box, or WebKit widens the page. */
.sa-shell .sa-table-wrap { position: relative; }
.sa-shell .sa-practice.sa-name-link, .sa-shell .sa-practice.sa-name-link * { color: inherit; text-decoration: none !important; }
.sa-shell .sa-practice.sa-name-link:hover b { color: var(--sa-primary); }
@media (max-width: 720px) {
  .sa-shell .sa-hide-sm { display: none; }
  .sa-shell .sa-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sa-shell .sa-dash-kpis .sa-kpi { padding: 14px; }
  .sa-shell .sa-dash-kpis .sa-kpi-icon { display: none; }
  .sa-shell .sa-dash-kpis .sa-kpi-label { font-size: 12px; }
  .sa-shell .sa-dash-kpis .sa-kpi-value { font-size: 22px; }
  .sa-shell .sa-dash-kpis .sa-kpi-value.muted { font-size: 18px; }
  .sa-shell .sa-dash-kpis .sa-kpi-sub { font-size: 11.5px; }
  .sa-shell .sa-practice b { max-width: 170px; }
  .sa-shell .sa-main .data-table { display: block; max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sa-shell .sa-crumb-sub { display: none; }
}
.sa-shell .dp-name { all: unset; cursor: pointer; display: block; max-width: 100%; }
.sa-shell .dp-name:hover b { color: var(--sa-primary); }
.sa-shell .dp-name:focus-visible { outline: 2px solid var(--sa-primary); border-radius: 4px; }
@media (min-width: 721px) { .sa-shell .sa-practice small .dp-sm-only { display: none; } }
/* The closed phone drawer sits just off-screen: no shadow until it is open, or a grey edge shows on the left. */
@media (max-width: 1100px) {
  .sa-shell .sa-sidebar { box-shadow: none; }
  .sa-shell .sa-nav-toggle:checked ~ .sa-sidebar { box-shadow: 20px 0 40px -20px rgba(15, 23, 42, .5); }
}
/* Older admin forms: long select options must not widen the page on a phone. */
@media (max-width: 720px) {
  .sa-shell .form-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .sa-shell .form-grid label { min-width: 0 !important; max-width: 100% !important; display: grid !important; grid-template-columns: minmax(0, 1fr); overflow-x: clip; overflow-clip-margin: 4px; }
  .sa-shell .form-grid select, .sa-shell .form-grid input, .sa-shell .form-grid textarea { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
}

/* Retell voice agent page (/admin/retell) */
.sa-shell #retell-summary code { font-size: 13px; overflow-wrap: anywhere; }
.sa-shell .check-list { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 6px; }
.sa-shell .check-list li { padding: 8px 12px; border-radius: 10px; border-left: 4px solid #cfd8e6; background: #f8fafc; font-size: 14px; color: #1e293b; overflow-wrap: anywhere; }
.sa-shell .check-list li.good { border-left-color: #15803d; }
.sa-shell .check-list li.warn { border-left-color: #b45309; background: #fffbeb; }
.sa-shell .check-list li.bad { border-left-color: #b91c1c; background: #fef2f2; }
.sa-shell .check-list li.muted { color: #5f6f86; }
.sa-shell td.good { color: #15803d; }
.sa-shell td.warn { color: #b45309; }
.sa-shell td.bad { color: #b91c1c; }
.sa-shell td.muted { color: #5f6f86; }
.sa-shell code.bad { color: #b91c1c; font-weight: 600; }
.sa-shell .kv-list { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: 6px 16px; margin: 8px 0 0; font-size: 14px; }
.sa-shell .kv-list dt { color: #5f6f86; }
.sa-shell .kv-list dd { margin: 0; overflow-wrap: anywhere; }
.sa-shell .code-block { max-height: 360px; overflow: auto; background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 12px; white-space: pre; }
.sa-shell .ptc-table-wrap { overflow-x: auto; max-width: 100%; }
.sa-shell #preview-result td, .sa-shell #retell-config p, .sa-shell #retell-config code, .sa-shell .check-list code { overflow-wrap: anywhere; }
@media (max-width: 720px) { .sa-shell .kv-list { grid-template-columns: minmax(0, 1fr); } }
.sa-shell #retell-webhooks dd small { display: block; color: #5f6f86; margin-top: 4px; }
.sa-shell #retell-webhooks dd .secondary-action { margin-left: 8px; }
