/* ═══════════════════════════════════════════════════════════════
   MODERN REFERENCE-STYLE DASHBOARD COMPONENTS
   Shared across every dashboard page (platform, clinic, analytics,
   subscription, ehr_sync, agentic_ai, etc).
   Clean, minimal cards with soft-tinted icon chips, large numbers,
   and colored delta pills. Dark-mode aware.
   ═══════════════════════════════════════════════════════════════ */

/* ── Stat Card (primary reference pattern) ── */
.stat-card-ref {
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, rgba(15, 23, 42, .06));
    border-radius: 1rem;
    padding: 1rem 1.125rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 1rem;
    min-height: 88px;
    position: relative;
    overflow: hidden;
    transition: box-shadow .3s cubic-bezier(.4,0,.2,1), transform .3s cubic-bezier(.4,0,.2,1), border-color .3s ease;
}
.stat-card-ref::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 100% at 100% 0%, rgba(58, 160, 198, .08) 0%, transparent 55%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.stat-card-ref:hover {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    transform: translateY(-3px);
    border-color: rgba(15, 23, 42, .10);
}
.stat-card-ref:hover::after { opacity: 1; }
.stat-card-ref:hover .stat-card-icon {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 6px 14px -4px currentColor;
}
.stat-card-ref:hover .stat-card-value {
    transform: scale(1.04);
    color: var(--bs-primary);
}
.stat-card-ref .stat-card-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 0;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.stat-card-ref .stat-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease;
    will-change: transform;
}
.stat-card-ref .stat-card-icon i {
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.stat-card-ref:hover .stat-card-icon i {
    animation: stat-icon-pulse 0.8s cubic-bezier(.4, 0, .2, 1);
}
@keyframes stat-icon-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.18); }
    65%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}
.stat-card-ref .stat-card-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-sub, #6b7280);
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
    transition: color .25s ease;
}
.stat-card-ref:hover .stat-card-label { color: var(--bs-heading-color, #111827); }
.stat-card-ref .stat-card-value {
    justify-self: end;
    font-size: 2rem;
    font-weight: 800;
    color: var(--bs-heading-color, #111827);
    letter-spacing: -.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), color .25s ease;
}
.stat-card-ref .stat-card-delta-row { display: none; }
.stat-card-ref .stat-card-delta {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    font-size: .65rem;
    font-weight: 700;
    padding: .125rem .5rem;
    border-radius: 999px;
    line-height: 1.3;
    letter-spacing: .01em;
}
.stat-card-ref .stat-card-delta.delta-up    { background: rgba(16, 185, 129, .12); color: #059669; }
.stat-card-ref .stat-card-delta.delta-down  { background: rgba(244, 63, 94, .12);  color: #dc2626; }
.stat-card-ref .stat-card-delta.delta-muted { background: rgba(148, 163, 184, .12);color: #64748b; }
.stat-card-ref .stat-card-delta i { font-size: .6rem; }
.stat-card-ref .stat-card-sub { display: none; }

/* Soft tinted icon chips (share the same palette across dashboards) */
.sc-icon-primary   { background: rgba(0, 105, 166, .1);  color: #0069A6; }
.sc-icon-info      { background: rgba(9, 165, 190, .1);  color: #09a5be; }
.sc-icon-success   { background: rgba(16, 185, 129, .1); color: #059669; }
.sc-icon-warning   { background: rgba(255, 137, 86, .12);color: #f97316; }
.sc-icon-danger    { background: rgba(244, 63, 94, .12); color: #dc2626; }
.sc-icon-purple    { background: rgba(124, 58, 237, .1); color: #7c3aed; }
.sc-icon-secondary { background: rgba(100, 116, 139, .1);color: #64748b; }

@media (max-width: 575.98px) {
    .stat-card-ref { padding: 0.875rem 1rem; min-height: 78px; }
    .stat-card-ref .stat-card-icon { width: 2rem; height: 2rem; font-size: .9rem; }
    .stat-card-ref .stat-card-value { font-size: 1.625rem; }
    .stat-card-ref .stat-card-label { font-size: .68rem; letter-spacing: .035em; }
}

/* ── Highlight chart card (large dual-area trend) ── */
.highlight-card {
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, rgba(15, 23, 42, .06));
    border-radius: 1rem;
    padding: 1.25rem 1.35rem 1rem;
    min-height: 380px;
}
.highlight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}
.highlight-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bs-heading-color);
    margin: 0;
    letter-spacing: -.01em;
}
.highlight-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.highlight-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: var(--text-sub);
    font-weight: 500;
}
.highlight-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.highlight-chart-wrap {
    position: relative;
    height: 320px;
    margin-top: .5rem;
}

/* ── Mini analytics cards (Orders / Profit style) ── */
.mini-analytics-card {
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, rgba(15, 23, 42, .06));
    border-radius: 1rem;
    padding: 1rem 1.1rem .85rem;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s ease, transform .25s ease;
}
.mini-analytics-card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
    transform: translateY(-2px);
}
.mini-analytics-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-sub, #6b7280);
    letter-spacing: .015em;
}
.mini-analytics-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--bs-heading-color, #111827);
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-top: .1rem;
    font-variant-numeric: tabular-nums;
}
.mini-analytics-chart {
    flex: 1;
    min-height: 70px;
    margin-top: .55rem;
    position: relative;
}

/* ── Earnings / gauge card ── */
.earnings-card {
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, rgba(15, 23, 42, .06));
    border-radius: 1rem;
    padding: 1.2rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 170px;
}
.earnings-card-left { flex: 1; min-width: 0; }
.earnings-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bs-heading-color);
    margin: 0 0 .1rem;
    text-align: center;
}
.earnings-subtitle {
    font-size: .72rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: .45rem;
}
.earnings-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--bs-heading-color);
    letter-spacing: -.025em;
    line-height: 1.1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.earnings-delta-text {
    font-size: .72rem;
    color: #059669;
    text-align: center;
    margin-top: .3rem;
    font-weight: 500;
}
.earnings-delta-text.delta-down { color: #dc2626; }
.earnings-gauge-wrap {
    width: 108px;
    height: 108px;
    position: relative;
    flex-shrink: 0;
}
.earnings-gauge-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.earnings-gauge-pct {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--bs-heading-color);
    line-height: 1;
    letter-spacing: -.02em;
}
.earnings-gauge-sub {
    font-size: .65rem;
    color: var(--text-sub);
    font-weight: 600;
    margin-top: .1rem;
}

/* ── Dark mode overrides ── */
[data-theme="dark"] .stat-card-ref,
[data-theme="dark"] .highlight-card,
[data-theme="dark"] .mini-analytics-card,
[data-theme="dark"] .earnings-card {
    background: var(--dark-bg-surface);
    border-color: rgba(255, 255, 255, .06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
[data-theme="dark"] .stat-card-ref:hover,
[data-theme="dark"] .mini-analytics-card:hover {
    background: var(--dark-bg-elevated);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
    border-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .stat-card-ref .stat-card-label,
[data-theme="dark"] .mini-analytics-label {
    color: var(--dark-text-secondary);
}
[data-theme="dark"] .stat-card-ref .stat-card-value,
[data-theme="dark"] .mini-analytics-value,
[data-theme="dark"] .earnings-amount,
[data-theme="dark"] .earnings-gauge-pct,
[data-theme="dark"] .earnings-title,
[data-theme="dark"] .highlight-card-title {
    color: var(--dark-text-primary);
}
[data-theme="dark"] .stat-card-ref .stat-card-sub,
[data-theme="dark"] .earnings-subtitle,
[data-theme="dark"] .earnings-gauge-sub,
[data-theme="dark"] .highlight-legend-item {
    color: var(--dark-text-muted);
}
[data-theme="dark"] .stat-card-ref::after {
    background: radial-gradient(120% 80% at 100% 0%, rgba(58, 160, 198, .06) 0%, transparent 55%);
}
[data-theme="dark"] .stat-card-ref .stat-card-delta.delta-up    { background: rgba(16, 185, 129, .18); color: #34d399; }
[data-theme="dark"] .stat-card-ref .stat-card-delta.delta-down  { background: rgba(244, 63, 94, .18);  color: #f87171; }
[data-theme="dark"] .stat-card-ref .stat-card-delta.delta-muted { background: rgba(148, 163, 184, .18);color: #94a3b8; }
[data-theme="dark"] .sc-icon-primary   { background: rgba(0, 105, 166, .22);  color: #7ec1eb; }
[data-theme="dark"] .sc-icon-info      { background: rgba(9, 165, 190, .22);  color: #67d2e5; }
[data-theme="dark"] .sc-icon-success   { background: rgba(16, 185, 129, .22); color: #34d399; }
[data-theme="dark"] .sc-icon-warning   { background: rgba(255, 137, 86, .22); color: #fb923c; }
[data-theme="dark"] .sc-icon-danger    { background: rgba(244, 63, 94, .22);  color: #f87171; }
[data-theme="dark"] .sc-icon-purple    { background: rgba(124, 58, 237, .22); color: #a78bfa; }
[data-theme="dark"] .sc-icon-secondary { background: rgba(100, 116, 139, .22);color: #94a3b8; }
[data-theme="dark"] .earnings-delta-text { color: #34d399; }
[data-theme="dark"] .earnings-delta-text.delta-down { color: #f87171; }

/* ─────────────────────────────────────────────────────────────────────────
   EHR Monitor Tabs — segmented switcher between logs / events / audit / health
   Visually consistent with stat-card-ref above (same surface, hover lift,
   accent on active).
   ───────────────────────────────────────────────────────────────────────── */
.ehr-monitor-tabs {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0 0 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}
.ehr-monitor-tabs > .ehr-monitor-tab {
    flex: 1 1 0;
    min-width: 0;
}
@media (max-width: 720px) {
    .ehr-monitor-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .ehr-monitor-tabs::-webkit-scrollbar { display: none; }
    .ehr-monitor-tabs > .ehr-monitor-tab { flex: 0 0 auto; }
}

.ehr-monitor-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .85rem 1rem 1rem;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #64748b;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.ehr-monitor-tab::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: -1px;
    height: 2px;
    background: #0069a6;
    border-radius: 2px 2px 0 0;
    transition: left .25s cubic-bezier(.22, 1, .36, 1), right .25s cubic-bezier(.22, 1, .36, 1);
}
.ehr-monitor-tab:hover {
    color: #0f172a;
    text-decoration: none;
    background: linear-gradient(180deg, transparent, rgba(0, 105, 166, .06));
}
.ehr-monitor-tab:hover::after {
    left: 25%;
    right: 25%;
    background: rgba(0, 105, 166, .4);
}
.ehr-monitor-tab.is-active {
    color: #0f172a;
    background: linear-gradient(180deg, transparent, rgba(0, 105, 166, .08));
}
.ehr-monitor-tab.is-active::after {
    left: 0;
    right: 0;
    height: 3px;
    background: #0069a6;
}

.ehr-monitor-tab-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .04);
    border: 1px solid rgba(15, 23, 42, .08);
    color: #64748b;
    font-size: .78rem;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ehr-monitor-tab-icon i { line-height: 1; }
.ehr-monitor-tab.is-active .ehr-monitor-tab-icon {
    background: rgba(0, 105, 166, .12);
    border-color: rgba(0, 105, 166, .35);
    color: #0069a6;
    box-shadow: 0 4px 10px -4px rgba(0, 105, 166, .35);
}
.ehr-monitor-tab-body {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
}
.ehr-monitor-tab-label {
    font-size: .82rem;
    font-weight: 600;
    color: inherit;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ehr-monitor-tab-desc { display: none; }
.ehr-monitor-tab-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .04);
    border: 1px solid rgba(15, 23, 42, .08);
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.ehr-monitor-tab.is-active .ehr-monitor-tab-count {
    background: #fff;
    border-color: rgba(0, 105, 166, .3);
    color: #0069a6;
}

[data-theme="dark"] .ehr-monitor-tabs { border-bottom-color: rgba(148, 163, 184, .14); }
[data-theme="dark"] .ehr-monitor-tab { color: var(--dark-text-muted, #94a3b8); background: transparent; box-shadow: none; }
[data-theme="dark"] .ehr-monitor-tab::after { background: #7ec1eb; }
[data-theme="dark"] .ehr-monitor-tab:hover {
    color: var(--dark-text, #e2e8f0);
    background: linear-gradient(180deg, transparent, rgba(126, 193, 235, .08));
}
[data-theme="dark"] .ehr-monitor-tab:hover::after { background: rgba(126, 193, 235, .45); }
[data-theme="dark"] .ehr-monitor-tab.is-active {
    color: var(--dark-text, #e2e8f0);
    background: linear-gradient(180deg, transparent, rgba(126, 193, 235, .10));
}
[data-theme="dark"] .ehr-monitor-tab.is-active::after { background: #7ec1eb; }
[data-theme="dark"] .ehr-monitor-tab-icon {
    background: rgba(148, 163, 184, .10);
    border-color: rgba(148, 163, 184, .14);
    color: #94a3b8;
}
[data-theme="dark"] .ehr-monitor-tab.is-active .ehr-monitor-tab-icon {
    background: rgba(126, 193, 235, .18);
    border-color: rgba(126, 193, 235, .4);
    color: #7ec1eb;
    box-shadow: 0 4px 10px -4px rgba(126, 193, 235, .4);
}
[data-theme="dark"] .ehr-monitor-tab-label { color: inherit; }
[data-theme="dark"] .ehr-monitor-tab-count {
    background: rgba(148, 163, 184, .10);
    border-color: rgba(148, 163, 184, .14);
    color: #cbd5e1;
}
[data-theme="dark"] .ehr-monitor-tab.is-active .ehr-monitor-tab-count {
    background: var(--dark-card-bg, #0f1c25);
    border-color: rgba(126, 193, 235, .35);
    color: #7ec1eb;
}

/* ─────────────────────────────────────────────────────────────────────────
   EHR Dashboard — Pulse Strip / Sparkline / Mix legend / Error list
   Used by ehr_sync/dashboard.html partials. Visually consistent with
   stat-card-ref + dash-card patterns above.
   ───────────────────────────────────────────────────────────────────────── */

/* Live pulse dot in section headers */
.ehr-pulse-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: .55rem;
    vertical-align: middle;
    box-shadow: 0 0 0 0 currentColor;
    animation: ehr-pulse 2s ease-out infinite;
}
.ehr-pulse-success { background: #10b981; color: rgba(16, 185, 129, .55); }
.ehr-pulse-warning { background: #f59e0b; color: rgba(245, 158, 11, .55); }
.ehr-pulse-danger  { background: #ef4444; color: rgba(239, 68, 68, .55); }
.ehr-pulse-secondary { background: #94a3b8; color: rgba(148, 163, 184, .45); animation: none; }
@keyframes ehr-pulse {
    0%   { box-shadow: 0 0 0 0 currentColor; }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* 4-column health pulse strip inside a dash-card */
.ehr-pulse-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid rgba(15, 23, 42, .06);
}
.ehr-pulse-metric {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 1rem 1.25rem;
    border-right: 1px solid rgba(15, 23, 42, .06);
}
.ehr-pulse-metric:last-child { border-right: none; }
.ehr-pulse-metric-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-sub, #64748b);
}
.ehr-pulse-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: .25rem;
}
.ehr-pulse-metric-value .bi { font-size: 1rem; }
.ehr-pulse-metric-value .ehr-unit {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-sub, #64748b);
}
.ehr-pulse-metric-sub {
    font-size: .72rem;
    color: var(--text-sub, #64748b);
}
@media (max-width: 767px) {
    .ehr-pulse-strip { grid-template-columns: repeat(2, 1fr); }
    .ehr-pulse-metric { border-bottom: 1px solid rgba(15, 23, 42, .06); }
    .ehr-pulse-metric:nth-child(2n) { border-right: none; }
    .ehr-pulse-metric:nth-last-child(-n+2) { border-bottom: none; }
}

/* Sparkline for 7-day volume */
.ehr-spark-wrap {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ehr-spark {
    width: 100%;
    height: 56px;
    display: block;
}
.ehr-spark-axis {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding-top: .25rem;
    border-top: 1px dashed rgba(15, 23, 42, .08);
}
.ehr-spark-tick {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
.ehr-spark-tick-count {
    font-size: .82rem;
    font-weight: 700;
    color: var(--bs-heading-color, #111827);
    font-variant-numeric: tabular-nums;
}
.ehr-spark-tick-day {
    font-size: .65rem;
    color: var(--text-sub, #64748b);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 1px;
}

/* Mix legend list (event mix + mapping health) */
.ehr-mix-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.ehr-mix-item { display: flex; flex-direction: column; gap: .3rem; }
.ehr-mix-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
}
.ehr-mix-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ehr-mix-dot-primary { background: #0069A6; }
.ehr-mix-dot-info    { background: #09a5be; }
.ehr-mix-dot-success { background: #10b981; }
.ehr-mix-dot-warning { background: #f59e0b; }
.ehr-mix-dot-danger  { background: #ef4444; }
.ehr-mix-dot-purple  { background: #7c3aed; }
.ehr-mix-label {
    flex: 1;
    color: var(--bs-heading-color, #111827);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ehr-mix-count {
    color: var(--text-sub, #64748b);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.ehr-mix-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
    overflow: hidden;
}
.ehr-mix-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .35s ease;
}
.ehr-mix-bar-primary { background: #0069A6; }
.ehr-mix-bar-info    { background: #09a5be; }
.ehr-mix-bar-success { background: #10b981; }
.ehr-mix-bar-warning { background: #f59e0b; }
.ehr-mix-bar-danger  { background: #ef4444; }
.ehr-mix-bar-purple  { background: #7c3aed; }

/* Top errors list */
.ehr-error-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.ehr-error-item {
    display: flex;
    gap: .65rem;
    padding: .6rem .65rem;
    border-radius: 10px;
    background: rgba(244, 63, 94, .04);
    border: 1px solid rgba(244, 63, 94, .12);
}
.ehr-error-dot {
    width: 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ehr-error-error,
.ehr-error-critical { background: #ef4444; }
.ehr-error-warning  { background: #f59e0b; }
.ehr-error-body { flex: 1; min-width: 0; }
.ehr-error-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--bs-heading-color, #111827);
}
.ehr-error-msg {
    font-size: .76rem;
    color: var(--text-sub, #475569);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ehr-error-meta {
    font-size: .68rem;
    color: var(--text-sub, #94a3b8);
    margin-top: 3px;
}

/* Connection pill (manual sync card) */
.ehr-conn-summary {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}
.ehr-conn-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.ehr-conn-pill-success {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}
.ehr-conn-pill-danger {
    background: rgba(244, 63, 94, .12);
    color: #dc2626;
}

/* Dark theme overrides */
[data-theme="dark"] .ehr-pulse-strip,
[data-theme="dark"] .ehr-pulse-metric { border-color: rgba(255, 255, 255, .07); }
[data-theme="dark"] .ehr-pulse-metric-label,
[data-theme="dark"] .ehr-pulse-metric-sub,
[data-theme="dark"] .ehr-mix-count,
[data-theme="dark"] .ehr-spark-tick-day,
[data-theme="dark"] .ehr-error-meta,
[data-theme="dark"] .ehr-pulse-metric-value .ehr-unit { color: var(--dark-text-muted, #94a3b8); }
[data-theme="dark"] .ehr-pulse-metric-value,
[data-theme="dark"] .ehr-mix-label,
[data-theme="dark"] .ehr-spark-tick-count,
[data-theme="dark"] .ehr-error-title { color: var(--dark-text, #e2e8f0); }
[data-theme="dark"] .ehr-mix-bar { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .ehr-spark-axis { border-top-color: rgba(255, 255, 255, .08); }
[data-theme="dark"] .ehr-error-item {
    background: rgba(244, 63, 94, .08);
    border-color: rgba(244, 63, 94, .2);
}
[data-theme="dark"] .ehr-error-msg { color: var(--dark-text-muted, #cbd5e1); }
[data-theme="dark"] .ehr-conn-pill-success {
    background: rgba(16, 185, 129, .18);
    color: #34d399;
}
[data-theme="dark"] .ehr-conn-pill-danger {
    background: rgba(244, 63, 94, .18);
    color: #f87171;
}

/* ════════════════════════════════════════════════════════════════
   Dashboard 2027 — shared cdash- and padmin- components
   Moved from inline <style> in templates/dashboard/index.html so the
   clinic-admin and platform-admin dashboards share the same surfaces.
   ════════════════════════════════════════════════════════════════ */

/* ── Task & assignee helpers ────────────────────────────────────── */
.task-row-overdue { border-left: 3px solid #dc3545 !important; }
.task-row-overdue td.task-due-cell { color: #dc3545 !important; font-weight: 600 !important; }

.assignee-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; font-size: .65rem; font-weight: 700;
    color: #fff; text-transform: uppercase; flex-shrink: 0;
}

.task-complete-btn {
    opacity: 0; transition: opacity .2s; border: none; background: none;
    color: #198754; font-size: .9rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.task-complete-btn:hover { background: rgba(25,135,84,.1); }
tr:hover .task-complete-btn { opacity: 1; }

/* ── Pipeline mini bar chart & summary blocks ──────────────────── */
.pipeline-mini-bar {
    display: flex; height: 8px; border-radius: 999px; overflow: hidden;
    background: var(--ehr-bar-bg, #eef0f3);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.02);
}
.pipeline-mini-bar-segment { height: 100%; transition: width .4s ease; min-width: 2px; }
.pipeline-mini-bar-empty { position: relative; }
.pipeline-mini-bar-empty::after {
    content: ""; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.04) 6px 12px);
    border-radius: inherit;
}

.pipeline-summary-block {
    padding: .75rem 0;
    border-bottom: 1px dashed var(--dash-divider, #eef0f3);
}
.pipeline-summary-block:first-child { padding-top: 0; }
.pipeline-summary-block:last-child { border-bottom: 0; padding-bottom: 0; }
.pipeline-summary-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .5rem; gap: .75rem;
}
.pipeline-summary-title {
    font-size: .78rem; font-weight: 600;
    color: var(--text-heading, #1f2937); letter-spacing: .01em;
}
.pipeline-summary-count {
    font-size: .7rem; color: var(--text-sub, #6b7280);
    font-weight: 500; white-space: nowrap;
}
.pipeline-summary-count strong { color: var(--text-heading, #1f2937); font-weight: 700; }

.pipeline-stage-chips {
    display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem;
}
.pipeline-stage-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .15rem .5rem; border-radius: 999px;
    font-size: .68rem; font-weight: 500; line-height: 1.4;
    background: var(--chip-bg, #f5f6f8); color: var(--text-sub, #6b7280);
    border: 1px solid var(--chip-border, #eceef2);
    transition: transform .15s ease, box-shadow .15s ease;
}
.pipeline-stage-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.pipeline-stage-chip.is-active { background: #fff; color: var(--text-heading, #1f2937); border-color: rgba(0,0,0,.08); }
.pipeline-stage-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pipeline-stage-chip-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.pipeline-stage-chip.is-zero .pipeline-stage-chip-count { opacity: .55; }

/* ── Attention card (shared across all role dashboards) ────────── */
.attention-card {
    background: var(--attention-card-bg, linear-gradient(135deg, #fff5f5 0%, #fff 100%));
    border: 1px solid var(--attention-card-border, #fecaca);
    border-radius: .625rem;
    padding: 1rem 1.25rem;
}
.attention-card-item {
    display: flex; align-items: center; gap: .5rem;
    font-size: .8125rem; padding: .35rem 0;
    color: var(--attention-card-text, #991b1b);
}
.attention-card-item i { font-size: .9rem; }

/* ── Hero — platform admin (gradient) ────────────────────────────
   `.padmin-hero` keeps the legacy gradient look. The clinic
   dashboard hero (`.cdash-hero`) below now uses a light SaaS surface
   so the two products can diverge without one fighting the other. */
.padmin-hero {
    position: relative;
    padding: .85rem 1.15rem .8rem;
    border-radius: 1.125rem;
    background: linear-gradient(135deg, #062a47 0%, #0a4f7a 50%, #0c7e98 100%);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
    margin-bottom: 1.25rem;
}
.padmin-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -10%;
    width: 50%; height: 180%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}
.padmin-hero-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}
.padmin-hero-row--simple { grid-template-columns: 1fr; }

@media (max-width: 991.98px) {
    .padmin-hero { padding: .85rem 1rem; }
    .padmin-hero-row { grid-template-columns: 1fr; gap: .75rem; }
}

.padmin-hero-eyebrow {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .6rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase;
    padding: .15rem .55rem;
    border-radius: 1rem;
    background: rgba(255,255,255,.16);
    color: #e0f2fe;
    margin-bottom: .25rem;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.padmin-hero-eyebrow i { font-size: .72rem; }

.padmin-hero-title {
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    font-weight: 800; letter-spacing: -.025em;
    margin: 0 0 .15rem; color: #fff; line-height: 1.15;
}

.padmin-hero-user {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .7rem; font-weight: 500;
    color: rgba(255,255,255,.78);
    margin: 0 0 .2rem; line-height: 1.25;
}
.padmin-hero-user i { font-size: .8rem; opacity: .85; }
.padmin-hero-user strong { color: #fff; font-weight: 600; }

.padmin-hero-sub {
    font-size: .85rem;
    color: rgba(255,255,255,.7);
    margin: 0;
    line-height: 1.45;
    max-width: 56ch;
}

.padmin-pulse {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}
@media (max-width: 575.98px) {
    .padmin-pulse { grid-template-columns: repeat(2, 1fr); }
}

.padmin-pulse-tile {
    padding: .45rem .6rem;
    border-radius: .65rem;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    text-align: left;
}
.padmin-pulse-label {
    display: flex; align-items: center; gap: .3rem;
    font-size: .58rem; color: rgba(255,255,255,.7);
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: .15rem;
}
.padmin-pulse-value {
    font-size: 1.05rem; font-weight: 800; color: #fff;
    letter-spacing: -.02em; line-height: 1;
}
.padmin-pulse-sub {
    margin-top: .1rem;
    font-size: .55rem; color: rgba(255,255,255,.65);
    font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

/* ── Clinic dashboard hero — flat header row ───────────────────
   Greeting + action row sit directly on the page, no card chrome. */
.cdash-hero {
    position: relative;
    padding: .25rem .25rem .75rem;
    color: var(--text-heading, #0f172a);
    margin-bottom: .75rem;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.cdash-hero-top {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.cdash-hero-greet { min-width: 0; }
.cdash-hero-title {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    font-weight: 800; letter-spacing: -.025em;
    margin: 0 0 .2rem;
    color: var(--text-heading, #0f172a);
    line-height: 1.2;
}
.cdash-hero-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: cdash-wave 2.4s ease-in-out 1s 2;
}
@keyframes cdash-wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20%, 40% { transform: rotate(-8deg); }
}
.cdash-hero-sub {
    font-size: .85rem;
    color: var(--text-sub, #64748b);
    margin: 0;
    line-height: 1.45;
}

.cdash-hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}
.cdash-hero-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .1);
    color: var(--text-heading, #0f172a);
    font-size: .78rem; font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    white-space: nowrap;
}
.cdash-hero-pill i { color: #0d6efd; font-size: .9rem; }
.cdash-hero-pill--ghost {
    background: rgba(15, 23, 42, .04);
    border-color: rgba(15, 23, 42, .06);
    color: var(--text-sub, #475569);
    font-weight: 500;
    box-shadow: none;
}
.cdash-hero-pill--ghost i { color: var(--text-sub, #64748b); }
.cdash-hero-pill-sep { opacity: .4; }

a.cdash-hero-pill { text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
a.cdash-hero-pill:hover { transform: translateY(-1px); }
.cdash-hero-pill--onboard {
    background: linear-gradient(135deg, rgba(13, 110, 253, .10) 0%, rgba(13, 110, 253, .05) 100%);
    color: #1d4ed8;
    border-color: rgba(13, 110, 253, .22);
}
.cdash-hero-pill--onboard i { color: #1d4ed8; }
.cdash-hero-pill--onboard:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.cdash-hero-pill--onboard:hover i { color: #fff; }
.cdash-hero-pill--onboard:hover .cdash-hero-pill-bar { background: rgba(255, 255, 255, .28); }
.cdash-hero-pill--onboard:hover .cdash-hero-pill-bar > span { background: #fff; }
.cdash-hero-pill-bar {
    width: 56px; height: 4px; border-radius: 999px;
    background: rgba(13, 110, 253, .18);
    overflow: hidden; position: relative;
    margin-left: .15rem;
}
.cdash-hero-pill-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    border-radius: inherit; transition: width .6s ease;
}
.cdash-hero-pill--done {
    background: rgba(22, 163, 74, .10);
    color: #15803d;
    border-color: rgba(22, 163, 74, .25);
}
.cdash-hero-pill--done i { color: #15803d; }
.cdash-hero-pill--done:hover { background: #15803d; color: #fff; border-color: #15803d; }
.cdash-hero-pill--done:hover i { color: #fff; }
.cdash-hero-pill--alert {
    background: rgba(220, 38, 38, .08);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, .22);
}
.cdash-hero-pill--alert i { color: #b91c1c; }
.cdash-hero-pill--alert:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.cdash-hero-pill--alert:hover i { color: #fff; }

.cdash-hero-cta {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0d6efd 0%, #2563eb 100%);
    color: #fff !important;
    font-size: .78rem; font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(13, 110, 253, .35);
    box-shadow: 0 4px 12px -4px rgba(13, 110, 253, .5);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    white-space: nowrap;
}
.cdash-hero-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 16px -4px rgba(13, 110, 253, .55);
    color: #fff;
}
.cdash-hero-cta i { font-size: .9rem; }

.cdash-hero-chiprow {
    position: relative;
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin-bottom: .9rem;
}
.cdash-hero-onboard {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(13, 110, 253, .08) 0%, rgba(13, 110, 253, .04) 100%);
    color: #1d4ed8;
    text-decoration: none;
    font-size: .76rem; font-weight: 600;
    border: 1px solid rgba(13, 110, 253, .2);
    transition: all .15s ease;
}
.cdash-hero-onboard:hover {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}
.cdash-hero-onboard:hover .cdash-hero-onboard-meta { color: rgba(255, 255, 255, .8); }
.cdash-hero-onboard:hover .cdash-hero-onboard-bar { background: rgba(255, 255, 255, .25); }
.cdash-hero-onboard:hover .cdash-hero-onboard-bar > span { background: #fff; }
.cdash-hero-onboard-text { display: inline-flex; align-items: center; gap: .35rem; }
.cdash-hero-onboard-meta {
    color: var(--text-sub, #64748b);
    font-weight: 500;
    font-size: .7rem;
}
.cdash-hero-onboard-bar {
    width: 70px; height: 5px; border-radius: 999px;
    background: rgba(13, 110, 253, .18);
    overflow: hidden; position: relative;
}
.cdash-hero-onboard-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    border-radius: inherit; transition: width .6s ease;
}
.cdash-hero-onboard-arrow { font-size: .8rem; }
.cdash-hero-onboard--done {
    background: rgba(22, 163, 74, .1);
    color: #15803d;
    border-color: rgba(22, 163, 74, .25);
}
.cdash-hero-onboard--done:hover { background: #15803d; color: #fff; border-color: #15803d; }

.cdash-hero-alert {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: rgba(220, 38, 38, .08);
    color: #b91c1c;
    text-decoration: none;
    font-size: .76rem; font-weight: 600;
    border: 1px solid rgba(220, 38, 38, .2);
    transition: all .15s ease;
}
.cdash-hero-alert:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.cdash-hero-alert-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .55);
    animation: cdash-alert-pulse 1.8s ease-out infinite;
}
@keyframes cdash-alert-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
    70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ── Pulse strip — light tone cards inside the clinic hero ─────── */
.cdash-pulse {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .65rem;
}
.cdash-pulse--4col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1199.98px) {
    .cdash-pulse { grid-template-columns: repeat(3, 1fr); }
    .cdash-pulse--4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .cdash-pulse { grid-template-columns: repeat(2, 1fr); }
    .cdash-pulse--4col { grid-template-columns: 1fr; }
}

.cdash-pulse-tile {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .55rem;
    padding: .65rem .75rem;
    border-radius: .85rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.cdash-pulse-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, .25);
    box-shadow: 0 8px 22px -10px rgba(15, 23, 42, .18);
    color: inherit;
}
.cdash-pulse-tile:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}
.cdash-pulse-tile.is-empty { opacity: .72; }

.cdash-pulse-icon {
    width: 34px; height: 34px;
    border-radius: .65rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex: none;
}
.cdash-pulse-tile.tone-primary .cdash-pulse-icon { background: rgba(13, 110, 253, .12); color: #0d6efd; }
.cdash-pulse-tile.tone-info    .cdash-pulse-icon { background: rgba(6, 182, 212, .12);  color: #0891b2; }
.cdash-pulse-tile.tone-warning .cdash-pulse-icon { background: rgba(245, 158, 11, .14); color: #d97706; }
.cdash-pulse-tile.tone-success .cdash-pulse-icon { background: rgba(22, 163, 74, .12);  color: #16a34a; }
.cdash-pulse-tile.tone-danger  .cdash-pulse-icon { background: rgba(220, 38, 38, .12);  color: #dc2626; }
.cdash-pulse-tile.tone-purple  .cdash-pulse-icon { background: rgba(139, 92, 246, .14); color: #7c3aed; }
.cdash-pulse-tile.tone-pink    .cdash-pulse-icon { background: rgba(236, 72, 153, .14); color: #db2777; }

.cdash-pulse-body { min-width: 0; }
.cdash-pulse-label {
    font-size: .65rem;
    font-weight: 600;
    color: var(--text-sub, #64748b);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.1;
    margin-bottom: .15rem;
}
.cdash-pulse-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading, #0f172a);
    letter-spacing: -.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.cdash-pulse-meta {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: .35rem;
    margin-top: .15rem;
    font-size: .68rem;
}
.cdash-pulse-meta--stack {
    flex-direction: column; align-items: flex-start;
    gap: .2rem;
}
.cdash-pulse-sub {
    color: var(--text-sub, #64748b);
    font-weight: 500;
}
.cdash-pulse-delta {
    display: inline-flex; align-items: center; gap: .1rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.cdash-pulse-delta i { font-size: .75rem; margin-left: -2px; }
.cdash-pulse-delta--success { background: rgba(22, 163, 74, .12);  color: #15803d; }
.cdash-pulse-delta--info    { background: rgba(6, 182, 212, .12);  color: #0e7490; }
.cdash-pulse-delta--warning { background: rgba(245, 158, 11, .14); color: #b45309; }
.cdash-pulse-delta--danger  { background: rgba(220, 38, 38, .12);  color: #b91c1c; }
.cdash-pulse-delta--muted   { background: rgba(100, 116, 139, .12); color: #475569; }

.cdash-pulse-arrow {
    color: rgba(15, 23, 42, .18);
    font-size: .85rem;
    transition: color .15s ease, transform .15s ease;
}
.cdash-pulse-tile:hover .cdash-pulse-arrow {
    color: #0d6efd;
    transform: translateX(2px);
}

@media (max-width: 1199.98px) {
    .cdash-pulse-tile { padding: .55rem .65rem; }
    .cdash-pulse-value { font-size: 1.1rem; }
}

/* ── Pulse tile · AI variant + inline badge ────────────────────── */
.cdash-pulse-ai-badge {
    display: inline-flex; align-items: center;
    margin-left: .35rem;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    box-shadow: 0 2px 5px -2px rgba(139, 92, 246, .5);
    line-height: 1.4;
}
.cdash-pulse-tile--ai {
    background: linear-gradient(135deg, rgba(139, 92, 246, .045) 0%, rgba(236, 72, 153, .045) 100%);
    border-color: rgba(139, 92, 246, .15);
}
.cdash-pulse-tile--ai .cdash-pulse-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, .14) 0%, rgba(236, 72, 153, .14) 100%);
    color: #7c3aed;
}
.cdash-pulse-tile--ai:hover { border-color: rgba(139, 92, 246, .3); }

[data-theme="dark"] .cdash-pulse-tile--ai {
    background: linear-gradient(135deg, rgba(139, 92, 246, .10) 0%, rgba(236, 72, 153, .10) 100%);
    border-color: rgba(139, 92, 246, .2);
}

/* ── Lifecycle funnel (clinic dashboard) ────────────────────────── */
.cdash-funnel-section { background: transparent; border: 0; padding: 0; }
.cdash-funnel-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin-bottom: .65rem;
    padding: 0 .25rem;
}
.cdash-funnel-section-title {
    display: inline-flex; align-items: center;
    font-size: .85rem; font-weight: 700;
    letter-spacing: -.005em;
    color: var(--text-heading, #0f172a);
    margin: 0;
}

.cdash-funnel {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem;
}
@media (max-width: 991.98px) { .cdash-funnel { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .cdash-funnel { grid-template-columns: repeat(2, 1fr); } }
.cdash-funnel-stage {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon count" "icon label";
    align-items: center;
    column-gap: .65rem; row-gap: .1rem;
    padding: .55rem .7rem .6rem;
    border-radius: .75rem;
    background: var(--hub-bg-soft, #f8fafc);
    border: 1px solid var(--hub-border, rgba(15,23,42,.06));
    transition: transform .15s ease, box-shadow .15s ease;
}
.cdash-funnel-stage:hover { transform: translateY(-1px); box-shadow: var(--hub-shadow-md, 0 6px 18px rgba(15,23,42,.06)); }
.cdash-funnel-icon {
    grid-area: icon;
    width: 1.75rem; height: 1.75rem; border-radius: .5rem;
    display: grid; place-items: center;
    font-size: .8rem; margin: 0;
}
.cdash-funnel-count {
    grid-area: count;
    font-size: 1.15rem; font-weight: 800; line-height: 1.05;
    color: var(--hub-text, #0f172a); letter-spacing: -.02em;
}
.cdash-funnel-label {
    grid-area: label;
    font-size: .62rem; font-weight: 600; color: var(--hub-text-sub, #64748b);
    text-transform: uppercase; letter-spacing: .05em; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cdash-funnel-bar {
    grid-column: 1 / -1;
    height: 2px; border-radius: 2px; margin-top: .3rem;
    background: rgba(15,23,42,.06); overflow: hidden;
}
.cdash-funnel-bar > span { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; }

/* ── Activity feed (shared cdash- + padmin-) ───────────────────── */
.cdash-feed,
.padmin-feed { padding: .25rem .5rem; }
.cdash-feed-item,
.padmin-feed-item {
    display: flex; gap: .8rem; padding: .65rem .75rem;
    border-radius: .65rem;
    transition: background .15s ease;
}
.cdash-feed-item:hover,
.padmin-feed-item:hover { background: var(--hub-bg-soft, #f8fafc); }
.cdash-feed-item + .cdash-feed-item,
.padmin-feed-item + .padmin-feed-item {
    border-top: 1px dashed var(--hub-border, rgba(15,23,42,.06));
}
.cdash-feed-icon,
.padmin-feed-icon {
    width: 2rem; height: 2rem; flex: none;
    border-radius: 50%; display: grid; place-items: center;
    font-size: .85rem;
}
.cdash-feed-icon[data-tone="primary"],
.padmin-feed-icon[data-tone="primary"] { background: var(--hub-primary-soft, rgba(0,105,166,.08)); color: var(--hub-primary, #0069a6); }
.cdash-feed-icon[data-tone="success"],
.padmin-feed-icon[data-tone="success"] { background: var(--hub-success-soft, rgba(22,163,74,.10)); color: var(--hub-success, #16a34a); }
.cdash-feed-icon[data-tone="info"],
.padmin-feed-icon[data-tone="info"]    { background: var(--hub-info-soft, rgba(8,145,178,.10)); color: var(--hub-info, #0891b2); }
.cdash-feed-icon[data-tone="warning"],
.padmin-feed-icon[data-tone="warning"] { background: var(--hub-warning-soft, rgba(217,119,6,.10)); color: var(--hub-warning, #d97706); }
.cdash-feed-icon[data-tone="danger"],
.padmin-feed-icon[data-tone="danger"]  { background: var(--hub-danger-soft, rgba(220,38,38,.10)); color: var(--hub-danger, #dc2626); }

.cdash-feed-body,
.padmin-feed-body { flex: 1 1 auto; min-width: 0; }
.cdash-feed-label,
.padmin-feed-label {
    font-size: .8rem; font-weight: 600; color: var(--hub-text, #0f172a);
    line-height: 1.3;
}
.cdash-feed-detail,
.padmin-feed-detail {
    font-size: .73rem; color: var(--hub-text-sub, #64748b);
    margin-top: .15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cdash-feed-when,
.padmin-feed-when {
    font-size: .68rem; color: var(--hub-text-sub, #64748b);
    opacity: .8; margin-top: .15rem;
}

/* ── EHR mini card (clinic dashboard) ──────────────────────────── */
.cdash-ehr {
    padding: 1rem 1.15rem;
    border-radius: 1.125rem;
    border: 1px solid var(--hub-border, rgba(15,23,42,.06));
    background: var(--hub-bg, #fff);
}
.cdash-ehr.is-connected {
    background: linear-gradient(180deg, var(--hub-success-soft, rgba(22,163,74,.10)) 0%, transparent 35%), var(--hub-bg, #fff);
}
.cdash-ehr.has-issues {
    background: linear-gradient(180deg, var(--hub-warning-soft, rgba(217,119,6,.10)) 0%, transparent 40%), var(--hub-bg, #fff);
}

/* ── Generic chip row (cdash-) ─────────────────────────────────── */
.cdash-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.cdash-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .7rem; font-weight: 600;
    padding: .15rem .55rem; border-radius: 1rem;
    background: rgba(100,116,139,.08); color: var(--hub-text-sub, #64748b);
}
.cdash-chip i { font-size: .65rem; }
.cdash-chip--success { background: var(--hub-success-soft, rgba(22,163,74,.10)); color: var(--hub-success, #16a34a); }
.cdash-chip--warning { background: var(--hub-warning-soft, rgba(217,119,6,.10)); color: var(--hub-warning, #d97706); }
.cdash-chip--danger  { background: var(--hub-danger-soft, rgba(220,38,38,.10));  color: var(--hub-danger, #dc2626); }
.cdash-chip--info    { background: var(--hub-info-soft, rgba(8,145,178,.10));    color: var(--hub-info, #0891b2); }

/* ── Platform admin: section rhythm ─────────────────────────────── */
.padmin-stack > .row { --bs-gutter-x: .75rem; }
.padmin-stack > section,
.padmin-stack > .row { margin-bottom: 1.5rem; }

.padmin-section-title {
    display: flex; align-items: center; gap: .55rem;
    font-size: .85rem; font-weight: 700;
    color: var(--text-heading, #111827);
    margin: 0 0 .75rem;
    text-transform: none; letter-spacing: -.005em;
}
.padmin-section-title-eyebrow {
    font-size: .6rem; font-weight: 700;
    color: var(--text-sub, #6b7280);
    text-transform: uppercase; letter-spacing: .08em;
}

/* ── Platform admin: EHR card rows ─────────────────────────────── */
.padmin-ehr-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .68rem; font-weight: 600;
    padding: .2rem .55rem; border-radius: 999px;
    border: 1px solid transparent;
}
.padmin-ehr-pill .padmin-ehr-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.padmin-ehr-pill.is-ok    { color: #047857; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
.padmin-ehr-pill.is-warn  { color: #b45309; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }
.padmin-ehr-pill.is-muted { color: var(--text-sub, #64748b); background: rgba(100,116,139,.10); border-color: rgba(100,116,139,.2); }

.padmin-ehr-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .55rem 0;
    border-bottom: 1px dashed var(--d-border, rgba(15,23,42,.08));
    font-size: .82rem;
}
.padmin-ehr-row:last-of-type { border-bottom: 0; }
.padmin-ehr-row-label { color: var(--text-sub, #64748b); }
.padmin-ehr-row strong { font-weight: 700; font-variant-numeric: tabular-nums; }

.padmin-ehr-link {
    display: inline-flex; align-items: center; gap: .35rem;
    margin-top: .85rem;
    font-size: .78rem; font-weight: 600;
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
}
.padmin-ehr-link:hover { text-decoration: underline; }
.padmin-ehr-link i { font-size: .7rem; }

/* ── Donut (clinic universe / tier mix) ─────────────────────────── */
.padmin-donut {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: center;
}
@media (max-width: 575.98px) {
    .padmin-donut { grid-template-columns: 1fr; }
}
.padmin-donut-svg { width: 148px; height: 148px; position: relative; flex: none; overflow: visible; }
.padmin-donut-svg svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; display: block; }
.padmin-donut-svg .padmin-donut-track { fill: none; stroke: var(--bs-border-color, #eef0f3); stroke-width: 5.5; }
.padmin-donut-svg .padmin-donut-seg {
    fill: none; stroke-width: 5.5;
    stroke-linecap: butt;
    transition: stroke-dasharray .6s ease;
}
.padmin-donut-center {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    text-align: center;
    pointer-events: none;
}
.padmin-donut-center strong {
    display: block;
    font-size: 1.65rem; font-weight: 800; line-height: 1;
    color: var(--text-heading, #111827);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.padmin-donut-center span {
    display: block;
    margin-top: .35rem;
    font-size: .62rem; font-weight: 700;
    color: var(--text-sub, #6b7280);
    text-transform: uppercase; letter-spacing: .08em;
}
.padmin-donut-legend { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.padmin-donut-legend-row {
    display: grid; grid-template-columns: auto 1fr auto auto;
    align-items: center; gap: .6rem;
    padding: .25rem 0;
    font-size: .8rem;
    border-bottom: 1px dashed var(--d-border, rgba(15,23,42,.06));
}
.padmin-donut-legend-row:last-child { border-bottom: 0; }
.padmin-donut-legend-dot {
    width: 9px; height: 9px; border-radius: 50%; flex: none;
}
.padmin-donut-legend-label {
    color: var(--text-heading, #1f2937); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.padmin-donut-legend-count {
    font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--text-heading, #1f2937);
}
.padmin-donut-legend-pct {
    font-size: .7rem; color: var(--text-sub, #6b7280);
    font-variant-numeric: tabular-nums;
    min-width: 3.5ch; text-align: right;
}

/* ── Mini stat tile (compact footer system stats) ──────────────── */
.padmin-mini-stat {
    display: flex; align-items: center; gap: .65rem;
    padding: .85rem 1rem;
    border-radius: .85rem;
    border: 1px solid var(--bs-border-color, rgba(15,23,42,.06));
    background: var(--bs-card-bg, #fff);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.padmin-mini-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15,23,42,.06);
    border-color: rgba(15,23,42,.10);
    color: inherit;
}
.padmin-mini-stat-icon {
    width: 2rem; height: 2rem; border-radius: .55rem;
    display: grid; place-items: center;
    font-size: .9rem;
    flex: none;
}
.padmin-mini-stat-body { flex: 1; min-width: 0; line-height: 1.2; }
.padmin-mini-stat-label {
    font-size: .65rem; font-weight: 700; color: var(--text-sub, #6b7280);
    text-transform: uppercase; letter-spacing: .05em;
}
.padmin-mini-stat-value {
    font-size: 1.05rem; font-weight: 800;
    color: var(--text-heading, #111827);
    font-variant-numeric: tabular-nums;
    margin-top: .15rem;
}
.padmin-mini-stat-sub {
    font-size: .68rem; color: var(--text-sub, #6b7280);
    margin-top: .1rem;
}

/* ── Onboarding queue row (pending clinics needing platform admin) ── */
.padmin-onboarding-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem .25rem;
    border-bottom: 1px dashed var(--d-border, rgba(15,23,42,.06));
    font-size: .82rem;
}
.padmin-onboarding-row:last-child { border-bottom: 0; }
.padmin-onboarding-name {
    font-weight: 600;
    color: var(--text-heading, #1f2937);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.padmin-onboarding-name a { color: inherit; text-decoration: none; }
.padmin-onboarding-name a:hover { color: var(--bs-primary, #0d6efd); }
.padmin-onboarding-meta {
    font-size: .7rem; color: var(--text-sub, #6b7280);
    margin-top: .1rem;
}
.padmin-onboarding-progress {
    width: 80px; height: 6px; border-radius: 999px;
    background: var(--bs-border-color, #eef0f3);
    overflow: hidden;
}
.padmin-onboarding-progress > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, #0d6efd, #0891b2);
    border-radius: inherit;
}
.padmin-onboarding-progress-label {
    font-size: .7rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-sub, #6b7280);
    min-width: 2.5ch; text-align: right;
}

/* ── Lead row (recent leads list) ──────────────────────────────── */
.padmin-lead-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem .25rem;
    border-bottom: 1px dashed var(--d-border, rgba(15,23,42,.06));
    font-size: .82rem;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
    border-radius: .35rem;
}
.padmin-lead-row:last-child { border-bottom: 0; }
.padmin-lead-row:hover { background: var(--bs-tertiary-bg, #f8fafc); color: inherit; }
.padmin-lead-body { min-width: 0; }
.padmin-lead-name {
    font-weight: 600;
    color: var(--text-heading, #1f2937);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.padmin-lead-meta {
    font-size: .7rem; color: var(--text-sub, #6b7280);
    margin-top: .1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.padmin-lead-pill {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .15rem .55rem; border-radius: 999px;
    font-size: .65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.padmin-lead-pill[data-status="new"]       { background: rgba(13,110,253,.10); color: #0d6efd; }
.padmin-lead-pill[data-status="contacted"] { background: rgba(8,145,178,.10);  color: #0891b2; }
.padmin-lead-pill[data-status="qualified"] { background: rgba(168,85,247,.10); color: #a855f7; }
.padmin-lead-pill[data-status="converted"] { background: rgba(22,163,74,.10);  color: #16a34a; }
.padmin-lead-pill[data-status="lost"]      { background: rgba(220,38,38,.10);  color: #dc2626; }

/* ── Empty state placeholder ───────────────────────────────────── */
.padmin-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-sub, #6b7280);
}
.padmin-empty i {
    display: block;
    font-size: 1.75rem;
    color: var(--bs-border-color, #cbd5e1);
    margin-bottom: .55rem;
}
.padmin-empty-title {
    font-size: .85rem; font-weight: 600;
    color: var(--text-heading, #1f2937);
    margin: 0 0 .2rem;
}
.padmin-empty-sub {
    font-size: .75rem; color: var(--text-sub, #6b7280); margin: 0;
}

/* ── Dark mode overrides ───────────────────────────────────────── */
[data-theme="dark"] {
    --ehr-bar-bg: rgba(255, 255, 255, 0.08);
    --attention-card-bg: linear-gradient(135deg, rgba(220, 53, 69, 0.08) 0%, rgba(26, 29, 39, 0.5) 100%);
    --attention-card-border: rgba(220, 53, 69, 0.2);
    --attention-card-text: #f87171;
}
[data-theme="dark"] .task-complete-btn:hover { background: rgba(25, 135, 84, 0.15); }
[data-theme="dark"] .assignee-avatar { opacity: .9; }
[data-theme="dark"] .cdash-funnel-stage,
[data-theme="dark"] .cdash-ehr { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .cdash-feed-item:hover,
[data-theme="dark"] .padmin-feed-item:hover { background: rgba(255,255,255,.03); }
[data-theme="dark"] .padmin-mini-stat,
[data-theme="dark"] .padmin-donut-svg .padmin-donut-track {
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.06);
    stroke: rgba(255,255,255,.06);
}
[data-theme="dark"] .padmin-onboarding-progress { background: rgba(255,255,255,.08); }
[data-theme="dark"] .padmin-lead-row:hover { background: rgba(255,255,255,.03); }

[data-theme="dark"] .padmin-hero {
    background: linear-gradient(135deg, #04223a 0%, #073f63 50%, #0a627c 100%);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .cdash-hero {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--dark-text-primary, #f0f2f5);
}
[data-theme="dark"] .cdash-hero-title { color: var(--dark-text-primary, #f0f2f5); }
[data-theme="dark"] .cdash-hero-sub { color: var(--dark-text-secondary, #9ba3b5); }
[data-theme="dark"] .cdash-hero-pill {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .08);
    color: var(--dark-text-primary, #f0f2f5);
    box-shadow: none;
}
[data-theme="dark"] .cdash-hero-pill i { color: #60a5fa; }
[data-theme="dark"] .cdash-hero-pill--ghost {
    background: rgba(255, 255, 255, .02);
    color: var(--dark-text-secondary, #9ba3b5);
}
[data-theme="dark"] .cdash-hero-pill--ghost i { color: var(--dark-text-secondary, #9ba3b5); }
[data-theme="dark"] .cdash-hero-onboard {
    background: rgba(96, 165, 250, .12);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, .25);
}
[data-theme="dark"] .cdash-hero-onboard-meta { color: var(--dark-text-secondary, #9ba3b5); }
[data-theme="dark"] .cdash-hero-onboard-bar { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .cdash-hero-onboard--done {
    background: rgba(34, 197, 94, .12);
    color: #86efac;
    border-color: rgba(34, 197, 94, .25);
}
[data-theme="dark"] .cdash-hero-alert {
    background: rgba(248, 113, 113, .12);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .25);
}
[data-theme="dark"] .cdash-hero-pill--onboard {
    background: rgba(96, 165, 250, .12);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, .25);
}
[data-theme="dark"] .cdash-hero-pill--onboard i { color: #93c5fd; }
[data-theme="dark"] .cdash-hero-pill-bar { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .cdash-hero-pill--done {
    background: rgba(34, 197, 94, .12);
    color: #86efac;
    border-color: rgba(34, 197, 94, .25);
}
[data-theme="dark"] .cdash-hero-pill--done i { color: #86efac; }
[data-theme="dark"] .cdash-hero-pill--alert {
    background: rgba(248, 113, 113, .12);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .25);
}
[data-theme="dark"] .cdash-hero-pill--alert i { color: #fca5a5; }
[data-theme="dark"] .cdash-pulse-tile {
    background: rgba(255, 255, 255, .03);
    border-color: rgba(255, 255, 255, .06);
    box-shadow: none;
}
[data-theme="dark"] .cdash-pulse-tile:hover {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(96, 165, 250, .3);
}
[data-theme="dark"] .cdash-pulse-label { color: var(--dark-text-secondary, #9ba3b5); }
[data-theme="dark"] .cdash-pulse-value { color: var(--dark-text-primary, #f0f2f5); }
[data-theme="dark"] .cdash-pulse-sub { color: var(--dark-text-secondary, #9ba3b5); }
[data-theme="dark"] .cdash-pulse-arrow { color: rgba(255, 255, 255, .2); }
[data-theme="dark"] .cdash-pulse-tile:hover .cdash-pulse-arrow { color: #60a5fa; }

[data-theme="dark"] .pipeline-summary-block {
    border-bottom-color: var(--dark-border, rgba(255, 255, 255, 0.08));
}
[data-theme="dark"] .pipeline-summary-title,
[data-theme="dark"] .pipeline-summary-count strong {
    color: var(--dark-text-primary, #f0f2f5);
}
[data-theme="dark"] .pipeline-summary-count {
    color: var(--dark-text-secondary, #9ba3b5);
}
[data-theme="dark"] .pipeline-mini-bar {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .pipeline-mini-bar-empty::after {
    background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, 0.05) 6px 12px);
}
[data-theme="dark"] .pipeline-stage-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--dark-text-secondary, #9ba3b5);
    border-color: var(--dark-border, rgba(255, 255, 255, 0.08));
}
[data-theme="dark"] .pipeline-stage-chip:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .pipeline-stage-chip.is-active {
    background: var(--dark-bg-overlay, #2a2e3d);
    color: var(--dark-text-primary, #f0f2f5);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .pipeline-stage-chip.is-zero {
    color: var(--dark-text-secondary, #9ba3b5);
}
[data-theme="dark"] .pipeline-stage-chip.is-zero .pipeline-stage-chip-count {
    opacity: 0.5;
}

/* ════════════════════════════════════════════════════════════════
   Unified Clinic Dashboard Tabs (cdash-tabs) — 2027 segmented control
   Used on the root clinic dashboard to organise sections by category.
   ════════════════════════════════════════════════════════════════ */
.cdash-tabs-shell {
    display: block;
    margin: 0 0 1.25rem; overflow-x: auto;
    scrollbar-width: none;
}
.cdash-tabs-shell::-webkit-scrollbar { display: none; }
.cdash-tabs {
    display: flex; align-items: center; gap: .25rem;
    width: 100%;
    padding: .35rem; margin: 0; list-style: none;
    background:
        linear-gradient(120deg, rgba(219, 234, 254, .35) 0%, rgba(237, 233, 254, .30) 45%, rgba(252, 231, 243, .25) 100%),
        linear-gradient(180deg, rgba(248, 250, 252, .85) 0%, rgba(248, 250, 252, .55) 100%);
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: 1rem;
    flex-wrap: nowrap;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7);
}
.cdash-tabs .nav-link {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .5rem .9rem; border-radius: .625rem;
    color: var(--text-sub, #64748b);
    font-size: .8125rem; font-weight: 600;
    white-space: nowrap; border: 0; background: transparent;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
    position: relative;
}
.cdash-tabs .nav-link:hover { background: rgba(255, 255, 255, .55); color: var(--text-heading, #0f172a); }
.cdash-tabs .nav-link.active {
    background: #fff; color: var(--text-heading, #0f172a);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .04);
}
.cdash-tabs .nav-link i { font-size: .95rem; opacity: .65; }
.cdash-tabs .nav-link.active i { opacity: 1; color: #0d6efd; }

.cdash-tab-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 .4rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08); color: var(--text-heading, #0f172a);
    font-size: .65rem; font-weight: 700; line-height: 1;
    margin-left: .15rem;
}
.cdash-tab-pill.is-danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.cdash-tab-pill.is-success { background: rgba(22, 163, 74, .12); color: #15803d; }
.cdash-tabs .nav-link.active .cdash-tab-pill { background: rgba(13, 110, 253, .12); color: #0d6efd; }
.cdash-tabs .nav-link.active .cdash-tab-pill.is-danger { background: rgba(220, 38, 38, .15); color: #b91c1c; }
.cdash-tabs .nav-link.active .cdash-tab-pill.is-success { background: rgba(22, 163, 74, .15); color: #15803d; }

@media (max-width: 575.98px) {
    .cdash-tabs .nav-link span:not(.cdash-tab-pill) { display: none; }
    .cdash-tabs .nav-link { padding: .5rem .65rem; }
    .cdash-tabs .nav-link i { font-size: 1.05rem; opacity: .85; }
}

/* ── Tab panes — give breathing room and smooth fade ───────────── */
.cdash-tab-content > .tab-pane {
    animation: cdash-tab-fade .25s ease-out;
}
@keyframes cdash-tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* ── Section header inside a tab (eyebrow + actions) ───────────── */
.cdash-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin: .25rem 0 .75rem;
}
.cdash-section-head h2 {
    font-size: .95rem; font-weight: 700; margin: 0;
    letter-spacing: -.01em; color: var(--text-heading, #0f172a);
    display: inline-flex; align-items: center; gap: .5rem;
}
.cdash-section-head h2 i { color: #0d6efd; }
.cdash-section-head .cdash-section-sub {
    font-size: .75rem; color: var(--text-sub, #64748b); font-weight: 500;
}

/* ── Stat tile (compact) used in tabs ──────────────────────────── */
.cdash-stat {
    display: flex; flex-direction: column; gap: .25rem;
    padding: .9rem 1rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--card-border, rgba(15,23,42,.06));
    border-radius: .75rem;
    text-decoration: none; color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    position: relative; overflow: hidden;
}
.cdash-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
    border-color: rgba(13,110,253,.18);
    color: inherit;
}
.cdash-stat-icon {
    width: 32px; height: 32px; border-radius: .55rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; flex: none; margin-bottom: .15rem;
}
.cdash-stat-icon.tone-primary { background: rgba(13,110,253,.12); color: #0d6efd; }
.cdash-stat-icon.tone-success { background: rgba(22,163,74,.12); color: #16a34a; }
.cdash-stat-icon.tone-info    { background: rgba(6,182,212,.12);  color: #0891b2; }
.cdash-stat-icon.tone-warning { background: rgba(245,158,11,.12); color: #d97706; }
.cdash-stat-icon.tone-danger  { background: rgba(220,38,38,.12);  color: #dc2626; }
.cdash-stat-icon.tone-purple  { background: rgba(139,92,246,.12); color: #7c3aed; }
.cdash-stat-icon.tone-pink    { background: rgba(236,72,153,.12); color: #db2777; }
.cdash-stat-label {
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-sub, #64748b);
}
.cdash-stat-value {
    font-size: 1.4rem; font-weight: 800; line-height: 1.1;
    color: var(--text-heading, #0f172a);
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.cdash-stat-sub {
    font-size: .7rem; font-weight: 500;
    color: var(--text-sub, #64748b);
}
.cdash-stat-arrow {
    position: absolute; top: .65rem; right: .65rem;
    color: rgba(15,23,42,.2); transition: color .15s ease, transform .15s ease;
    font-size: .9rem;
}
.cdash-stat:hover .cdash-stat-arrow {
    color: #0d6efd; transform: translate(2px, -2px);
}

/* ── Mini list row (timelines, recent activity, lead/sub lists) ── */
.cdash-mini-row {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .25rem;
    border-bottom: 1px dashed var(--dash-divider, #eef0f3);
    text-decoration: none; color: inherit;
    transition: background-color .15s ease;
}
.cdash-mini-row:last-child { border-bottom: 0; }
.cdash-mini-row:hover { background: rgba(13,110,253,.03); color: inherit; }
.cdash-mini-row-icon {
    width: 30px; height: 30px; border-radius: .5rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; flex: none;
}
.cdash-mini-row-icon.tone-primary { background: rgba(13,110,253,.12); color: #0d6efd; }
.cdash-mini-row-icon.tone-success { background: rgba(22,163,74,.12); color: #16a34a; }
.cdash-mini-row-icon.tone-info    { background: rgba(6,182,212,.12);  color: #0891b2; }
.cdash-mini-row-icon.tone-warning { background: rgba(245,158,11,.12); color: #d97706; }
.cdash-mini-row-icon.tone-danger  { background: rgba(220,38,38,.12);  color: #dc2626; }
.cdash-mini-row-icon.tone-muted   { background: rgba(100,116,139,.12); color: #64748b; }
.cdash-mini-row-body { flex: 1; min-width: 0; }
.cdash-mini-row-title {
    font-size: .82rem; font-weight: 600;
    color: var(--text-heading, #0f172a); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cdash-mini-row-meta {
    font-size: .7rem; color: var(--text-sub, #64748b);
    margin-top: .1rem; line-height: 1.3;
}
.cdash-mini-row-side {
    font-size: .7rem; font-weight: 600;
    color: var(--text-sub, #64748b); white-space: nowrap;
}

/* ── Compact list "View all" footer link ───────────────────────── */
.cdash-list-foot {
    margin-top: .5rem; padding-top: .5rem;
    border-top: 1px solid var(--dash-divider, #eef0f3);
    text-align: center;
}
.cdash-list-foot a {
    font-size: .75rem; font-weight: 600;
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
}
.cdash-list-foot a:hover { text-decoration: underline; }

/* ── Big donut for ratings/sync rate ───────────────────────────── */
.cdash-bigdonut {
    width: 130px; height: 130px; position: relative;
    flex: none; margin: 0 auto .5rem;
}
.cdash-bigdonut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cdash-bigdonut-track { fill: none; stroke: rgba(15,23,42,.07); stroke-width: 3; }
.cdash-bigdonut-seg { fill: none; stroke-width: 3.2; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.cdash-bigdonut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .1rem;
}
.cdash-bigdonut-center strong {
    font-size: 1.45rem; font-weight: 800;
    color: var(--text-heading, #0f172a); line-height: 1; letter-spacing: -.02em;
}
.cdash-bigdonut-center span {
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-sub, #64748b);
}

/* ── Star rating display (Reputation tab) ──────────────────────── */
.cdash-stars { display: inline-flex; gap: .1rem; font-size: 1.1rem; line-height: 1; }
.cdash-stars i { color: #f59e0b; }
.cdash-stars i.is-empty { color: rgba(15,23,42,.15); }

/* ── Channel mix bar (Outreach tab) ────────────────────────────── */
.cdash-channel-bar {
    display: flex; height: 10px; border-radius: 999px; overflow: hidden;
    background: rgba(15,23,42,.04);
}
.cdash-channel-bar > span { transition: width .4s ease; }
.cdash-channel-legend {
    display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .55rem;
    font-size: .72rem; color: var(--text-sub, #64748b);
}
.cdash-channel-legend span.dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: .3rem; vertical-align: middle;
}

/* ── Appointment timeline row (Today tab) ──────────────────────── */
.cdash-appt-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: .75rem; align-items: center;
    padding: .65rem .15rem;
    border-bottom: 1px solid var(--dash-divider, #eef0f3);
}
.cdash-appt-row:last-child { border-bottom: 0; }
.cdash-appt-time {
    text-align: center; font-variant-numeric: tabular-nums;
}
.cdash-appt-time strong {
    display: block; font-size: .9rem; font-weight: 800;
    color: var(--text-heading, #0f172a);
}
.cdash-appt-time small {
    font-size: .65rem; color: var(--text-sub, #64748b);
    text-transform: uppercase; letter-spacing: .05em;
}
.cdash-appt-body { min-width: 0; }
.cdash-appt-patient {
    font-size: .85rem; font-weight: 600;
    color: var(--text-heading, #0f172a); line-height: 1.25;
}
.cdash-appt-provider {
    font-size: .7rem; color: var(--text-sub, #64748b);
    margin-top: .15rem;
}
.cdash-appt-duration {
    font-size: .7rem; font-weight: 600;
    padding: .25rem .55rem; border-radius: 999px;
    background: rgba(13,110,253,.08); color: #0d6efd;
}

/* ── Empty state (compact, in-tab) ─────────────────────────────── */
.cdash-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: .35rem;
    padding: 2rem 1rem; text-align: center;
}
.cdash-empty i {
    font-size: 1.6rem; color: rgba(15,23,42,.2);
}
.cdash-empty-title {
    font-size: .85rem; font-weight: 600;
    color: var(--text-heading, #0f172a); margin: 0;
}
.cdash-empty-sub {
    font-size: .72rem; color: var(--text-sub, #64748b); margin: 0;
}

/* ── Dark mode for tab system ──────────────────────────────────── */
[data-theme="dark"] .cdash-tabs {
    background: linear-gradient(180deg, rgba(30, 41, 59, .65) 0%, rgba(30, 41, 59, .35) 100%);
    border-color: rgba(255,255,255,.06);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.02);
}
[data-theme="dark"] .cdash-tabs .nav-link { color: #94a3b8; }
[data-theme="dark"] .cdash-tabs .nav-link:hover {
    background: rgba(255,255,255,.04); color: #f1f5f9;
}
[data-theme="dark"] .cdash-tabs .nav-link.active {
    background: rgba(255,255,255,.08); color: #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06);
}
[data-theme="dark"] .cdash-tab-pill {
    background: rgba(255,255,255,.08); color: #cbd5e1;
}
[data-theme="dark"] .cdash-stat {
    background: var(--dark-card-bg, #1e2330);
    border-color: var(--dark-border, rgba(255,255,255,.06));
}
[data-theme="dark"] .cdash-stat-value { color: #f1f5f9; }
[data-theme="dark"] .cdash-mini-row { border-bottom-color: rgba(255,255,255,.05); }
[data-theme="dark"] .cdash-mini-row:hover { background: rgba(255,255,255,.03); }
[data-theme="dark"] .cdash-mini-row-title { color: #f1f5f9; }
[data-theme="dark"] .cdash-channel-bar { background: rgba(255,255,255,.05); }
[data-theme="dark"] .cdash-appt-row { border-bottom-color: rgba(255,255,255,.05); }
[data-theme="dark"] .cdash-appt-time strong,
[data-theme="dark"] .cdash-appt-patient { color: #f1f5f9; }
[data-theme="dark"] .cdash-bigdonut-track { stroke: rgba(255,255,255,.08); }
[data-theme="dark"] .cdash-bigdonut-center strong,
[data-theme="dark"] .cdash-empty-title { color: #f1f5f9; }
[data-theme="dark"] .cdash-list-foot { border-top-color: rgba(255,255,255,.06); }
