/* ==============================================
   GLOBAL OVERRIDES
============================================== */
/*.fi-header { display: none !important; }*/

/* ==============================================
   CSS CUSTOM PROPERTIES
============================================== */
:root {
    --brand-primary: #6366f1;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-soft: #f1f5f9;
}

/* ==============================================
   WRAPPER & LAYOUT
============================================== */
.cd-wrapper {
    padding: 24px 0;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* --- 12-Column Grid --- */
.cd-grid-12 {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
    margin-bottom: 24px;
}

.cd-col-3  { grid-column: span 3; }
.cd-col-6  { grid-column: span 6; }

/* --- 4-Column Auto Grid --- */
.cd-grid-4 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 24px;
}

/* ==============================================
   BASE CARD
============================================== */
.cd-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   MAIN ACCOUNT AREA
============================================== */
.cd-main-account {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    background: #ffffff;
}

.cd-main-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cd-main-greeting {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cd-main-balance {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

.cd-unit-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
}

.cd-main-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.cd-meta-divider {
    margin: 0 8px;
    color: #cbd5e1;
}

.cd-main-actions {
    display: flex;
    gap: 12px;
}

/* --- Pulse Dot --- */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0%   { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0); }
}

/* --- Workspace ID Badge --- */
.cd-main-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 2px;
    border-radius: 99px;
    margin-top: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cd-main-id-badge .label {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    margin-right: 8px;
}

.cd-main-id-badge code {
    font-family: monospace;
    font-size: 11px;
    color: #0f172a;
    font-weight: 600;
}

.cd-id-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cd-id-toggle:hover {
    background: #e2e8f0;
}

.cd-workspace-id {
    font-family: monospace;
    font-size: 11px;
    color: #334155;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cd-workspace-id.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.uuid-copy-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.uuid-copy-btn:hover {
    opacity: 1;
    transform: scale(1.08);
}

.uuid-copy-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.uuid-copy-btn.copied .uuid-copy-icon {
    color: #10b981;
}

/* ==============================================
   ORBITAL BALANCE BOX
============================================== */
.cd-balance-orbital-container {
    position: relative;
    width: 260px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.orbital-mesh {
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(
        from 180deg at 50% 50%,
        #e0e7ff 0deg,
        #ffffff 120deg,
        #d1fae5 240deg,
        #e0e7ff 360deg
    );
    filter: blur(30px);
    animation: rotate-mesh 10s linear infinite;
    opacity: 0.6;
    z-index: 0;
}

@keyframes rotate-mesh {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.balance-glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 8px 32px 0 rgba(31,38,135,0.07);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-glass-card:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 12px 40px 0 rgba(31,38,135,0.12);
}

.glass-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #64748b;
}

.glass-value {
    font-size: 34px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.05em;
    margin: 4px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.glass-value small {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.glass-footer {
    margin-top: auto;
    font-size: 11px;
    font-weight: 600;
    color: #4f46e5;
    background: rgba(79,70,229,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    align-self: flex-start;
}

/* ==============================================
   QUICK ACTIONS GRID
============================================== */
.cd-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.qa-item:active { transform: scale(0.92); }

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.qa-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
}

.qa-item:hover .qa-icon {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2);
}

/* ==============================================
   HERO / GRADIENT CARDS
============================================== */

/* --- Standing Card --- */
.cd-standing {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.cd-standing::before {
    content: '';
    position: absolute;
    top: -20%; right: -10%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.cd-hero-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cd-hero-title  { font-size: 16px; font-weight: 600; color: white !important; }
.cd-hero-body   { font-size: 14px; opacity: 0.9; line-height: 1.5; }
.cd-hero-badges { display: flex; gap: 8px; margin-top: 20px; }

.cd-hero-badge {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    backdrop-filter: blur(4px);
}

/* --- Volume Hero Card --- */
.cd-volume-hero {
    position: relative;
    background: linear-gradient(135deg, #0f766e 0%, #064e3b 100%);
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: none !important;
}

.cd-volume-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.25;
    z-index: 1;
}

.cd-volume-pattern path {
    fill: none;
    stroke: #5eead4;
    stroke-width: 1.5;
    stroke-linecap: round;
    animation: dash 10s linear infinite;
}

@keyframes dash {
    to { stroke-dashoffset: -1000; }
}

.cd-volume-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.cd-volume-text { max-width: 65%; }

.cd-volume-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #ccfbf1;
    margin-bottom: 8px;
    display: block;
}

.cd-volume-value {
    font-size: 42px;
    font-weight: 900;
    margin: 4px 0;
    letter-spacing: -0.04em;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cd-volume-description {
    font-size: 13px;
    color: #f0fdfa;
    opacity: 0.85;
    margin-bottom: 16px;
    line-height: 1.4;
}

.cd-volume-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.volume-meta-pill {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
}

.cd-volume-action .fi-btn {
    background: white !important;
    color: #065f46 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 11px !important;
    letter-spacing: 0.05em;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.cd-volume-action .fi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.cd-volume-illustration {
    flex-shrink: 0;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    animation: float-vol 6s ease-in-out infinite;
}

@keyframes float-vol {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50%       { transform: translateY(-10px) rotate(2deg); }
}

/* ==============================================
   KPI CARDS
============================================== */
.cd-linked { padding: 20px !important; }

.cd-linked-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cd-kpi-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.cd-kpi-value h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 12px;
}

.cd-kpi-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==============================================
   SECTION HEADER & MESSAGING TABLE
============================================== */
.cd-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cd-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-section-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.cd-message-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f8fafc;
}

.cd-msg-main { display: flex; gap: 16px; }

.cd-msg-avatar {
    width: 40px; height: 40px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.cd-msg-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.cd-msg-dest  { font-weight: 600; font-size: 14px; }
.cd-msg-body  { font-size: 13px; color: var(--text-muted); }
.cd-msg-meta  { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.cd-status-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 6px;
}

.status-delivered { background: #ecfdf5; color: #059669; }
.status-failed    { background: #fef2f2; color: #dc2626; }

.cd-msg-stats { text-align: right; }
.cd-msg-units { display: block; font-weight: 700; font-size: 15px; }
.cd-msg-unit-label { font-size: 11px; color: var(--text-muted); }

/* ==============================================
   CHART AREA
============================================== */
.cd-chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.cd-canvas-wrapper {
    width: 100%;
    height: 260px;
    position: relative;
}

.cd-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.cd-legend-item {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dlv { background: #10b981; }
.fld { background: #f43f5e; }
.sub { background: #64748b; }
.que { background: #e2e8f0; }

/* ==============================================
   TOP SENDERS
============================================== */
.cd-top-senders {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cd-sender-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cd-sender-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-sender-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.cd-sender-name { font-weight: 600; font-size: 13px; }
.cd-sender-meta { font-size: 11px; color: #94a3b8; }
.cd-sender-count { font-size: 16px; font-weight: 700; }
.cd-sender-count small { font-size: 11px; color: #94a3b8; }

/* ==============================================
   INTELLIGENCE & HEALTH CARDS
============================================== */
.cd-intelligence-card,
.cd-health-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --- Header --- */
.cd-intel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cd-intel-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.cd-intel-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

/* --- Summary Grid --- */
.cd-intel-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

/* --- Intel Pills --- */
.intel-pill {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 78px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.intel-pill::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(99,102,241,0.08), transparent 55%);
    pointer-events: none;
}

.intel-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
    border-color: #cbd5e1;
}

.intel-pill span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 6px;
}

.intel-pill strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1;
}

.intel-pill strong::after {
    content: "";
    display: block;
    width: 28px;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #34d399);
    opacity: 0.75;
}

.intel-pill.is-blue strong::after    { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.intel-pill.is-emerald strong::after { background: linear-gradient(90deg, #10b981, #34d399); }
.intel-pill.is-purple strong::after  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* --- Intel List --- */
.cd-intel-list {
    display: flex;
    flex-direction: column;
}

.cd-intel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cd-intel-row:last-child { border-bottom: none; }

.cd-intel-row:hover {
    background: #f8fafc;
    border-radius: 8px;
}

.cd-intel-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-intel-rank {
    width: 22px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.cd-intel-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Top-1 avatar highlight */
.cd-intel-row:first-child .cd-intel-avatar {
    background: #ecfdf5;
    color: #059669;
}

.cd-intel-meta {
    display: flex;
    flex-direction: column;
}

.cd-intel-name { font-size: 14px; font-weight: 600; }
.cd-intel-sub  { font-size: 11px; color: #94a3b8; }

.cd-intel-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-progress-wrap {
    width: 140px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.cd-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.cd-intel-rate {
    font-size: 12px;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
}

.cd-success-rate {
    font-size: 12px;
    color: #078355;
}
/* =========================================================
   MESSAGING HEALTH CARD — PREMIUM SOFT STYLE
   ========================================================= */

/* --- Card container polish --- */
.cd-health-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- HEADER ---------- */
.cd-health-card .cd-intel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

/* ---------- TOP SENDER ---------- */
.health-top-sender {
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #f8fafc 100%
    );
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;

    display: flex;
    flex-direction: column;
    gap: 6px;

    position: relative;
    overflow: hidden;

    transition: all .25s ease;
}

/* soft enterprise glow */
.health-top-sender::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(16,185,129,0.08),
            transparent 60%
        );
    pointer-events: none;
}

/* gentle hover (not aggressive) */
.health-top-sender:hover {
    border-color: #dbe5ee;
    box-shadow: 0 6px 18px rgba(15,23,42,0.04);
}

/* label */
.health-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
}

/* sender name */
.health-top-sender strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.15;
}

/* sub info */
.health-top-sender small {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

/* ---------- METRICS GRID ---------- */
.health-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
}

/* base metric card */
.health-metrics > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;

    padding: 11px 12px;

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;

    color: #64748b;

    display: flex;
    flex-direction: column;
    gap: 7px;

    transition: all .2s ease;
}

/* gentle hover */
.health-metrics > div:hover {
    transform: translateY(-2px);
    border-color: #dbe5ee;
    box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.health-metrics strong {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #0f172a;
}

/* ---------- DELIVERY (soft emerald) ---------- */
.metric-delivery {
    background: #f8fdfb;
    border-color: #d1fae5;
}
.metric-delivery strong {
    color: #059669;
}
.metric-delivery::after {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: #6ee7b7;
    opacity: .7;
}

/* ---------- FAILURE (soft rose) ---------- */
.metric-failure {
    background: #fdfafa;
    border-color: #fecdd3;
}
.metric-failure strong {
    color: #e11d48;
}
.metric-failure::after {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: #fda4af;
    opacity: .7;
}

/* ---------- IN FLIGHT (soft blue) ---------- */
.metric-inflight {
    background: #f8fbff;
    border-color: #bfdbfe;
}
.metric-inflight strong {
    color: #3b82f6;
}
.metric-inflight::after {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: #93c5fd;
    opacity: .7;
}

/* ---------- MOBILE ---------- */
@media (max-width:768px) {

    .health-metrics {
        grid-template-columns: 1fr;
    }

    .health-top-sender strong {
        font-size: 18px;
    }

    .health-metrics strong {
        font-size: 18px;
    }
}

/* ==============================================
   UTILITY CLASSES
============================================== */
code {
    background: rgba(0,0,0,0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

.bg-blue-light   { background: #eff6ff; color: #3b82f6; }
.bg-green-light  { background: #f0fdf4; color: #10b981; }
.bg-amber-light  { background: #fffbeb; color: #f59e0b; }
.bg-purple-light { background: #faf5ff; color: #a855f7; }
.text-success    { color: #059669 !important; }

.bg-primary { background: #4f46e5; }
.bg-gray    { background: #64748b; }
.bg-success { background: #10b981; }
.bg-amber   { background: #f59e0b; }

.cd-btn-glow {
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.4);
}

/* ==============================================
   RESPONSIVE — DESKTOP (≥ 1024px)
============================================== */
@media (min-width: 1024px) {
    .cd-grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .cd-col-8 { grid-column: span 8; }
    .cd-col-7 { grid-column: span 7; }
    .cd-col-5 { grid-column: span 5; }
    .cd-col-4 { grid-column: span 4; }
}

/* ==============================================
   RESPONSIVE — TABLET / MOBILE (≤ 1024px)
============================================== */
@media (max-width: 1024px) {
    .cd-col-3,
    .cd-col-6 {
        grid-column: span 12;
    }
}

/* ==============================================
   RESPONSIVE — MOBILE (≤ 768px)
============================================== */
@media (max-width: 768px) {

    /* Wrapper */
    .cd-wrapper { padding: 12px; }

    /* Main account */
    .cd-main-account {
        padding: 16px !important;
        height: auto !important;
    }

    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px;
    }

    /* Greeting */
    .cd-main-greeting {
        font-size: 18px !important;
        margin-bottom: 4px;
    }

    .greeting-text {
        display: block;
        opacity: 0.7;
    }

    /* Workspace ID */
    .cd-mobile-meta-group {
        display: block !important;
        width: 100%;
        margin-bottom: 10px;
    }

    .cd-workspace-id {
        font-size: 10px;
        word-break: break-all;
    }

    /* Orbital Balance */
    .cd-balance-orbital-container {
        height: 120px;
        perspective: none;
        order: 2;
        width: 100% !important;
        margin-bottom: 16px;
    }

    .cd-main-left { order: 1; }

    .balance-glass-card {
        padding: 15px;
        border-radius: 16px;
    }

    .glass-value { font-size: 28px; }
    .glass-label { font-size: 9px; }

    .orbital-mesh {
        width: 100%;
        height: 100%;
        filter: blur(20px);
    }

    /* Quick Actions — vertical list */
    .cd-quick-actions {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #f1f5f9;
    }

    .qa-item {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
        padding: 10px 12px;
        border-radius: 12px;
        background: #f8fafc;
        width: 100%;
    }

    .qa-item:active { background: #e2e8f0; }

    .qa-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .qa-item span {
        text-align: left;
        font-size: 13px;
        font-weight: 600;
    }

    /* Volume Hero */
    .cd-volume-content {
        flex-direction: column-reverse;
        text-align: center;
        align-items: center;
    }

    .cd-volume-text  { max-width: 100%; }
    .cd-volume-meta  { justify-content: center; }
    .cd-volume-value { font-size: 34px; }

    /* Buttons */
    .cd-main-actions .fi-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    /* Chart */
    .cd-canvas-wrapper { height: 220px; margin: auto; }

    .cd-chart-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    /* Intelligence summary & health metrics — single column */
    .cd-intel-summary,
    .health-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .intel-pill {
        min-height: 72px;
    }

    .intel-pill strong { font-size: 22px; }

    /* Intel rows — stack vertically */
    .cd-intel-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cd-intel-right {
        width: 100%;
        justify-content: space-between;
    }

    .cd-progress-wrap {
        flex: 1;
        width: auto;
    }
}
