/* ─────────────────────────────────────────────────────────────────────────
   Coordy Analytics — shared chart chrome for CoordyCharts (coordy-charts.js)
   Glass cards matching the broker executive dashboard; dark theme is the
   default, cloud (light) theme overrides at the bottom.
   ───────────────────────────────────────────────────────────────────────── */

.cc-bi {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.cc-bi-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background:
        radial-gradient(95% 120% at 0% 0%, rgba(139, 92, 246, 0.08), transparent 56%),
        linear-gradient(160deg, rgba(34, 36, 41, 0.9), rgba(24, 26, 31, 0.94));
}

.cc-bi-head h3 {
    margin: 4px 0 0;
    color: #f8fafc;
    font-size: 20px;
    line-height: 1.2;
}

.cc-bi-head p {
    margin: 6px 0 0;
    color: #9aa5b6;
    font-size: 12.5px;
    line-height: 1.45;
    max-width: 640px;
}

.cc-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.cc-card {
    grid-column: span 4;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background:
        radial-gradient(95% 120% at 0% 0%, rgba(139, 92, 246, 0.06), transparent 56%),
        linear-gradient(160deg, rgba(34, 36, 41, 0.9), rgba(24, 26, 31, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 34px rgba(0, 0, 0, 0.24);
    transition: border-color 0.16s ease;
}

.broker-coming-soon {
    position: relative;
    cursor: help;
}

.broker-coming-soon[aria-disabled="true"] {
    cursor: help;
}

.broker-coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid rgba(168, 85, 247, 0.32);
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.12);
    color: #ddd6fe;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.broker-coming-soon-badge-icon,
.broker-coming-soon-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.broker-coming-soon-badge svg,
.broker-coming-soon-panel-icon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.broker-coming-soon-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 390px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background:
        radial-gradient(120% 120% at 10% 0%, rgba(168, 85, 247, 0.14), transparent 58%),
        linear-gradient(180deg, #1d2024 0%, #17191c 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 42px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(168, 85, 247, 0.1);
    color: #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.broker-coming-soon-tooltip strong {
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.25;
}

.broker-coming-soon-tooltip span {
    color: #b7c0ce;
    font-size: 12px;
    line-height: 1.45;
}

.broker-coming-soon:hover .broker-coming-soon-tooltip,
.broker-coming-soon:focus .broker-coming-soon-tooltip,
.broker-coming-soon:focus-visible .broker-coming-soon-tooltip,
.broker-coming-soon:focus-within .broker-coming-soon-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.broker-coming-soon.is-tooltip-closed .broker-coming-soon-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
}

.broker-coming-soon-panel {
    min-height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(168, 85, 247, 0.08), transparent 62%),
        linear-gradient(180deg, #1d2024 0%, #17191c 100%);
}

.broker-coming-soon-panel.is-compact {
    align-items: flex-start;
}

.broker-coming-soon-panel-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid rgba(168, 85, 247, 0.32);
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.14);
    color: #c4b5fd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.broker-coming-soon-panel-icon svg {
    width: 17px;
    height: 17px;
}

.broker-coming-soon-panel > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.broker-coming-soon-panel strong {
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.25;
}

.broker-coming-soon-panel p,
.broker-coming-soon-panel small {
    margin: 0;
    color: #aab3c2;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.broker-coming-soon-panel small {
    color: #c4b5fd;
    font-weight: 750;
}

.cc-card-coming-soon {
    overflow: visible;
    border-color: rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(168, 85, 247, 0.08), transparent 58%),
        linear-gradient(180deg, #1d2024 0%, #17191c 100%);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cc-card-coming-soon:hover,
.cc-card-coming-soon:focus-visible {
    border-color: rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(168, 85, 247, 0.12), transparent 58%),
        linear-gradient(180deg, #202328 0%, #181b1f 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 38px rgba(0, 0, 0, 0.28),
        0 0 24px rgba(168, 85, 247, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.cc-card-coming-soon .cc-card-body {
    min-height: 172px;
    display: flex;
}

.cc-card:fullscreen {
    padding: 32px;
    border-radius: 0;
    background: #16181d;
    overflow: auto;
}

.cc-card-wide { grid-column: span 8; }
.cc-card-full { grid-column: 1 / -1; }
.cc-card-tall .cc-card-body { min-height: 300px; }

.cc-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.cc-card-head > div {
    min-width: 0;
}

.cc-card-head .cc-kicker {
    display: block;
    color: rgba(165, 180, 252, 0.65);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cc-card-head h4 {
    margin: 3px 0 0;
    color: #f8fafc;
    font-size: 14.5px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cc-card-head .cc-source {
    display: block;
    margin-top: 3px;
    color: #8d98aa;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cc-card-actions {
    display: inline-flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.cc-card-actions button {
    min-width: 28px;
    min-height: 26px;
    padding: 3px 7px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 18, 24, 0.42);
    color: #aab3c2;
    font: inherit;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.cc-card-actions button:hover,
.cc-card-actions button:focus-visible {
    border-color: rgba(139, 92, 246, 0.44);
    background: rgba(139, 92, 246, 0.12);
    color: #f8fafc;
}

.cc-card-actions button[aria-pressed="true"] {
    border-color: rgba(139, 92, 246, 0.58);
    background: rgba(139, 92, 246, 0.18);
    color: #ffffff;
}

.cc-card-body {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 268px;
}

.cc-chart {
    position: absolute;
    inset: 0;
}

.cc-chart-inline {
    position: relative;
    inset: auto;
    min-height: 272px;
}

.cc-health-shell,
.cc-revenue-shell,
.cc-agent-shell {
    display: flex;
    min-height: 100%;
    gap: 14px;
}

.cc-health-shell {
    align-items: stretch;
}

.cc-health-summary {
    width: 260px;
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 18, 24, 0.34);
}

.cc-health-summary span,
.cc-bi-metric span {
    color: #8d98aa;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cc-health-summary strong {
    color: #f8fafc;
    font-size: 23px;
    line-height: 1.1;
}

.cc-health-summary small {
    color: #aab3c2;
    font-size: 12px;
    line-height: 1.45;
}

.cc-health-summary.good { border-color: rgba(52, 211, 153, 0.26); background: rgba(52, 211, 153, 0.08); }
.cc-health-summary.warn { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.08); }
.cc-health-summary.risk { border-color: rgba(248, 113, 113, 0.32); background: rgba(248, 113, 113, 0.08); }

.cc-health-components {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cc-health-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 13px;
    background: rgba(15, 18, 24, 0.28);
}

.cc-health-row > div:first-child {
    min-width: 0;
}

.cc-health-row span,
.cc-agent-row small {
    display: block;
    color: #8d98aa;
    font-size: 11px;
}

.cc-health-row strong {
    display: block;
    margin-top: 2px;
    color: #f8fafc;
    font-size: 22px;
    line-height: 1;
}

.cc-health-row small {
    display: block;
    margin-top: 5px;
    color: #aab3c2;
    font-size: 11.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cc-health-row-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.cc-health-row-actions em {
    color: #c9d2e1;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.cc-health-row-actions button,
.cc-agent-row {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    background: rgba(15, 18, 24, 0.36);
    color: #e8edf5;
    font: inherit;
    cursor: pointer;
}

.cc-health-row-actions button {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
}

.cc-health-row.good { border-color: rgba(52, 211, 153, 0.20); }
.cc-health-row.warn { border-color: rgba(251, 191, 36, 0.24); }
.cc-health-row.risk { border-color: rgba(248, 113, 113, 0.30); }
.cc-health-row.muted {
    border-style: dashed;
}

.cc-revenue-shell,
.cc-agent-shell {
    flex-direction: column;
    gap: 18px;
}

.cc-bi-metric-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.cc-bi-metric {
    display: flex;
    min-height: 76px;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(15, 18, 24, 0.28);
    overflow: hidden;
}

.cc-bi-metric strong {
    display: block;
    color: #f8fafc;
    font-size: clamp(13px, 1.5vw, 16px);
    line-height: 1.12;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.cc-bi-metric span {
    white-space: normal;
    overflow-wrap: anywhere;
}

.cc-revenue-empty {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px dashed rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    text-align: center;
}

.cc-revenue-shell .cc-chart-inline {
    min-height: 318px;
}

.cc-card-full .cc-revenue-shell .cc-chart-inline {
    min-height: 340px;
}

.cc-revenue-empty strong {
    color: #e8edf5;
    font-size: 13px;
}

.cc-revenue-empty span {
    color: #9aa5b6;
    font-size: 12px;
}

.cc-agent-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cc-agent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 10px 11px;
    text-align: left;
}

.cc-agent-row strong {
    display: block;
    color: #f8fafc;
    font-size: 12.5px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cc-agent-row em {
    flex: 0 0 auto;
    color: #c9d2e1;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.cc-health-row-actions button:hover,
.cc-health-row-actions button:focus-visible,
.cc-agent-row:hover,
.cc-agent-row:focus-visible {
    border-color: rgba(139, 92, 246, 0.44);
    background: rgba(139, 92, 246, 0.12);
}

.cc-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #c9d2e1;
    background: rgba(148, 163, 184, 0.12);
}

.cc-delta.up { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.cc-delta.down { color: #f87171; background: rgba(248, 113, 113, 0.12); }

/* ── States ─────────────────────────────────────────────────────────────── */
.cc-state {
    display: flex;
    height: 100%;
    min-height: 180px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    border: 1px dashed rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    text-align: center;
}

.cc-state strong { color: #e8edf5; font-size: 13px; }
.cc-state span { color: #9aa5b6; font-size: 12px; line-height: 1.45; max-width: 320px; }

.cc-state-loading strong { color: #9aa5b6; }
.cc-state-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    margin-bottom: 4px;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-top-color: rgba(165, 180, 252, 0.85);
    border-radius: 50%;
    animation: ccSpin 0.8s linear infinite;
}

.cc-state-error { border-color: rgba(248, 113, 113, 0.35); }

.cc-state .cc-state-action {
    margin-top: 8px;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 9px;
    background: rgba(15, 18, 24, 0.42);
    color: #c9d2e1;
    font: inherit;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
}

.cc-state .cc-state-action:hover,
.cc-state .cc-state-action:focus-visible {
    border-color: rgba(139, 92, 246, 0.44);
    background: rgba(139, 92, 246, 0.12);
    color: #f8fafc;
}

@keyframes ccSpin { to { transform: rotate(360deg); } }

/* ── DOM tooltip (heatmap / funnel) ─────────────────────────────────────── */
.cc-tooltip {
    position: fixed;
    z-index: 1000020;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(9, 12, 18, 0.94);
    pointer-events: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.cc-tooltip strong { color: #f8fafc; font-size: 12.5px; }
.cc-tooltip span { color: #aab3c2; font-size: 11px; }

/* ── Heatmap ────────────────────────────────────────────────────────────── */
.cc-heatmap {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.cc-heatmap-row,
.cc-heatmap-hours {
    display: grid;
    grid-template-columns: 34px repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
}

.cc-heatmap-hours span {
    color: #8d98aa;
    font-size: 9.5px;
    text-align: center;
}

.cc-heatmap-day {
    color: #8d98aa;
    font-size: 10.5px;
    font-weight: 700;
}

.cc-heatmap-cell {
    height: 16px;
    border-radius: 4px;
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.10);
}

/* ── Funnel ─────────────────────────────────────────────────────────────── */
.cc-funnel-shell {
    display: flex;
    min-height: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.cc-funnel-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 18, 24, 0.28);
}

.cc-funnel-summary-copy {
    min-width: 0;
}

.cc-funnel-summary-copy span {
    display: block;
    color: #8d98aa;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cc-funnel-summary-copy strong {
    display: block;
    margin-top: 3px;
    color: #f8fafc;
    font-size: 22px;
    line-height: 1.1;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.cc-funnel-summary-copy small {
    display: block;
    margin-top: 5px;
    color: #aab3c2;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cc-funnel-action {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid rgba(139, 92, 246, 0.42);
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.16);
    color: #f5f3ff;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.cc-funnel-action:hover,
.cc-funnel-action:focus-visible {
    border-color: rgba(167, 139, 250, 0.68);
    background: rgba(139, 92, 246, 0.24);
    color: #ffffff;
}

.cc-funnel {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-content: center;
    gap: 10px;
}

.cc-funnel-grid.cc-funnel {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-content: stretch;
}

.cc-funnel-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    align-items: center;
    width: 100%;
    min-height: 106px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 13px;
    background: rgba(15, 18, 24, 0.28);
    font: inherit;
    text-align: left;
}

button.cc-funnel-stage { cursor: pointer; }
button.cc-funnel-stage:hover,
button.cc-funnel-stage:focus-visible {
    border-color: rgba(139, 92, 246, 0.38);
    background: rgba(139, 92, 246, 0.10);
}

.cc-funnel-label {
    grid-column: 1 / -1;
    color: #c9d2e1;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.cc-funnel-track {
    position: relative;
    grid-column: 1 / -1;
    height: 14px;
    border-radius: 7px;
    background: rgba(148, 163, 184, 0.10);
    overflow: hidden;
}

.cc-funnel-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 7px;
    transition: width 0.4s ease;
}

.cc-funnel-count {
    color: #f8fafc;
    font-size: 22px;
    line-height: 1;
    font-weight: 800;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.cc-funnel-pct {
    color: #8d98aa;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Table view ─────────────────────────────────────────────────────────── */
.cc-table-wrap {
    position: absolute;
    inset: 0;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
}

.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.cc-table caption {
    padding: 8px 10px;
    color: #8d98aa;
    font-size: 10.5px;
    text-align: left;
}

.cc-table th,
.cc-table td {
    padding: 6px 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.10);
    color: #c9d2e1;
    text-align: left;
    white-space: nowrap;
}

.cc-table thead th {
    position: sticky;
    top: 0;
    background: rgba(24, 26, 31, 0.98);
    color: #8d98aa;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cc-table td { font-variant-numeric: tabular-nums; }

/* ── Executive insights ─────────────────────────────────────────────────── */
.cc-insights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cc-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    background: rgba(15, 18, 24, 0.36);
}

.cc-insight-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: #8d98aa;
}

.cc-insight.good .cc-insight-dot { background: #34d399; }
.cc-insight.warn .cc-insight-dot { background: #fbbf24; }
.cc-insight.risk .cc-insight-dot { background: #f87171; }

.cc-insight-copy { min-width: 0; flex: 1; }
.cc-insight-copy strong { display: block; color: #e8edf5; font-size: 12.5px; line-height: 1.4; font-weight: 600; }

.cc-insight-source {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.10);
    color: #8d98aa;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Compare toggle (lives in the executive filter row) ─────────────────── */
.cc-compare-toggle {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    background: rgba(15, 18, 24, 0.42);
    color: #c9d2e1;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.cc-compare-toggle:hover,
.cc-compare-toggle:focus-visible {
    border-color: rgba(139, 92, 246, 0.44);
    background: rgba(139, 92, 246, 0.12);
    color: #f8fafc;
}

.cc-compare-toggle[aria-pressed="true"] {
    border-color: rgba(139, 92, 246, 0.58);
    background: rgba(139, 92, 246, 0.18);
    color: #ffffff;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .cc-card, .cc-card-wide { grid-column: span 6; }
    .cc-health-shell { flex-direction: column; }
    .cc-health-summary { width: auto; flex-basis: auto; }
    .cc-revenue-shell .cc-chart-inline { min-height: 340px; }
    .cc-funnel-grid.cc-funnel { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 780px) {
    .cc-card, .cc-card-wide { grid-column: 1 / -1; }
    .cc-bi-head { flex-direction: column; align-items: flex-start; }
    .cc-heatmap-cell { height: 12px; }
    .cc-health-components,
    .cc-agent-list { grid-template-columns: 1fr; }
    .cc-bi-metric-strip { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
    .cc-funnel { grid-template-columns: 1fr; }
    .cc-funnel-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    .cc-funnel-action { width: 100%; }
    .cc-health-row,
    .cc-agent-row { flex-direction: column; align-items: flex-start; }
    .cc-health-row-actions { width: 100%; align-items: flex-start; }
    .cc-card-head { flex-direction: column; }
    .cc-card-actions { justify-content: flex-start; }
    .cc-revenue-shell .cc-chart-inline { min-height: 360px; }
    .broker-coming-soon-tooltip {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-funnel-fill { transition: none; }
    .cc-state-loading::before { animation-duration: 1.6s; }
    .broker-coming-soon-tooltip,
    .cc-card-coming-soon {
        transition: none;
    }
}

/* ── Cloud (light) theme ────────────────────────────────────────────────── */
body[data-theme="cloud"] .cc-bi-head,
body[data-theme="cloud"] .cc-card {
    border-color: rgba(17, 24, 39, 0.10);
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(30, 41, 59, 0.10);
}

body[data-theme="cloud"] .cc-bi-head {
    border-color: rgba(99, 102, 241, 0.18);
    border-top: 3px solid rgba(99, 102, 241, 0.72);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.07), rgba(99, 102, 241, 0.02) 48%, #ffffff 100%);
}

body[data-theme="cloud"] .cc-card {
    border-top: 2px solid rgba(99, 102, 241, 0.18);
}

body[data-theme="cloud"] .cc-card:fullscreen { background: #eef1f8; }
body[data-theme="cloud"] .cc-bi-head h3,
body[data-theme="cloud"] .cc-card-head h4,
body[data-theme="cloud"] .cc-funnel-count,
body[data-theme="cloud"] .cc-state strong,
body[data-theme="cloud"] .cc-insight-copy strong,
body[data-theme="cloud"] .cc-health-summary strong,
body[data-theme="cloud"] .cc-health-row strong,
body[data-theme="cloud"] .cc-bi-metric strong,
body[data-theme="cloud"] .cc-revenue-empty strong,
body[data-theme="cloud"] .cc-agent-row strong { color: #111827; }

body[data-theme="cloud"] .cc-bi-head p,
body[data-theme="cloud"] .cc-card-head .cc-source,
body[data-theme="cloud"] .cc-state span,
body[data-theme="cloud"] .cc-heatmap-day,
body[data-theme="cloud"] .cc-heatmap-hours span,
body[data-theme="cloud"] .cc-funnel-pct,
body[data-theme="cloud"] .cc-insight-source,
body[data-theme="cloud"] .cc-table caption,
body[data-theme="cloud"] .cc-table thead th,
body[data-theme="cloud"] .cc-health-summary small,
body[data-theme="cloud"] .cc-health-row small,
body[data-theme="cloud"] .cc-revenue-empty span,
body[data-theme="cloud"] .cc-agent-row small,
body[data-theme="cloud"] .cc-health-summary span,
body[data-theme="cloud"] .cc-bi-metric span,
body[data-theme="cloud"] .cc-health-row span { color: #4b5563; }

body[data-theme="cloud"] .cc-card-head .cc-kicker { color: #4f46e5; }

body[data-theme="cloud"] .cc-bi-head .broker-command-placeholder-kicker {
    color: #4f46e5;
}

body[data-theme="cloud"] .cc-card-actions button,
body[data-theme="cloud"] .cc-compare-toggle,
body[data-theme="cloud"] .cc-state .cc-state-action,
body[data-theme="cloud"] .cc-health-row-actions button,
body[data-theme="cloud"] .cc-agent-row {
    border-color: rgba(17, 24, 39, 0.14);
    background: #ffffff;
    color: #374151;
}

body[data-theme="cloud"] .cc-health-summary,
body[data-theme="cloud"] .cc-health-row,
body[data-theme="cloud"] .cc-bi-metric,
body[data-theme="cloud"] .cc-revenue-empty,
body[data-theme="cloud"] .cc-funnel-summary,
body[data-theme="cloud"] .cc-funnel-stage {
    border-color: rgba(17, 24, 39, 0.10);
    background: #ffffff;
}

body[data-theme="cloud"] .cc-funnel-summary-copy strong {
    color: #111827;
}

body[data-theme="cloud"] .cc-funnel-summary-copy span,
body[data-theme="cloud"] .cc-funnel-summary-copy small {
    color: #4b5563;
}

body[data-theme="cloud"] .cc-funnel-action {
    border-color: rgba(99, 102, 241, 0.34);
    background: #ede9fe;
    color: #4338ca;
}

body[data-theme="cloud"] .cc-funnel-action:hover,
body[data-theme="cloud"] .cc-funnel-action:focus-visible {
    border-color: rgba(99, 102, 241, 0.5);
    background: #ddd6fe;
    color: #312e81;
}

body[data-theme="cloud"] button.cc-funnel-stage:hover,
body[data-theme="cloud"] button.cc-funnel-stage:focus-visible {
    border-color: rgba(99, 102, 241, 0.28);
    background: #f5f3ff;
}

body[data-theme="cloud"] .broker-coming-soon-badge {
    border-color: rgba(99, 102, 241, 0.28);
    background: #ede9fe;
    color: #4f46e5;
}

body[data-theme="cloud"] .broker-coming-soon-tooltip {
    border-color: rgba(99, 102, 241, 0.2);
    background:
        radial-gradient(120% 120% at 10% 0%, rgba(99, 102, 241, 0.14), transparent 58%),
        rgba(255, 255, 255, 0.98);
    box-shadow:
        0 18px 38px rgba(30, 41, 59, 0.16),
        0 0 22px rgba(99, 102, 241, 0.12);
}

body[data-theme="cloud"] .broker-coming-soon-tooltip strong,
body[data-theme="cloud"] .broker-coming-soon-panel strong {
    color: #1e1b4b;
}

body[data-theme="cloud"] .broker-coming-soon-tooltip span,
body[data-theme="cloud"] .broker-coming-soon-panel p {
    color: #4b5563;
}

body[data-theme="cloud"] .broker-coming-soon-panel {
    border-color: rgba(99, 102, 241, 0.16);
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(99, 102, 241, 0.1), transparent 62%),
        #ffffff;
}

body[data-theme="cloud"] .broker-coming-soon-panel-icon {
    border-color: rgba(99, 102, 241, 0.24);
    background: #ede9fe;
    color: #4f46e5;
}

body[data-theme="cloud"] .broker-coming-soon-panel small {
    color: #4f46e5;
}

body[data-theme="cloud"] .cc-card-coming-soon {
    border-color: rgba(99, 102, 241, 0.18);
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(99, 102, 241, 0.12), transparent 58%),
        #f7f7ff;
}

body[data-theme="cloud"] .cc-card-coming-soon:hover,
body[data-theme="cloud"] .cc-card-coming-soon:focus-visible {
    border-color: rgba(99, 102, 241, 0.32);
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 58%),
        #ffffff;
    box-shadow: 0 14px 30px rgba(30, 41, 59, 0.13), 0 0 22px rgba(99, 102, 241, 0.12);
}

body[data-theme="cloud"] .cc-health-row-actions em,
body[data-theme="cloud"] .cc-agent-row em { color: #374151; }

body[data-theme="cloud"] .cc-funnel-label,
body[data-theme="cloud"] .cc-table th,
body[data-theme="cloud"] .cc-table td { color: #1f2937; }

body[data-theme="cloud"] .cc-table thead th { background: #eef1f8; }
body[data-theme="cloud"] .cc-table th,
body[data-theme="cloud"] .cc-table td { border-top-color: rgba(17, 24, 39, 0.08); }

body[data-theme="cloud"] .cc-funnel-track { background: rgba(17, 24, 39, 0.08); }
body[data-theme="cloud"] .cc-heatmap-cell { box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08); }
body[data-theme="cloud"] .cc-insight { border-color: rgba(17, 24, 39, 0.08); background: #ffffff; }
body[data-theme="cloud"] .cc-state { border-color: rgba(17, 24, 39, 0.14); }
body[data-theme="cloud"] .cc-delta { color: #374151; background: rgba(17, 24, 39, 0.06); }
body[data-theme="cloud"] .cc-delta.up { color: #047857; background: rgba(4, 120, 87, 0.10); }
body[data-theme="cloud"] .cc-delta.down { color: #b91c1c; background: rgba(185, 28, 28, 0.10); }
