/* ==========================================================================
   ConvertCRM — Platform Admin · "Mission Control" redesign v2
   Dark command-centre aesthetic: near-black indigo canvas, glass panels,
   cyan→violet neon accents, tabular metrics, glow depth.
   Deliberately the opposite of the light/green whatsapp-crm design.
   All styles namespaced under .cc. Class hooks match app.js / data.js.
   ========================================================================== */

.cc {
    --bg: #070a12;
    --panel: rgba(17, 23, 41, .72);
    --panel-solid: #111729;
    --panel2: #0d1222;
    --line: rgba(148, 163, 216, .14);
    --line-strong: rgba(148, 163, 216, .28);
    --ink: #e8edf9;
    --muted: #7c88a8;
    --brand: #22d3ee;            /* neon cyan */
    --brand2: #8b5cf6;           /* violet */
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #fb7185;
    --glow-c: rgba(34, 211, 238, .35);
    --glow-v: rgba(139, 92, 246, .3);
    color-scheme: dark;
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px; line-height: 1.55;
    color: var(--ink);
    min-height: calc(100vh - 44px);
    background:
        radial-gradient(1000px 480px at 85% -10%, rgba(139, 92, 246, .16), transparent 60%),
        radial-gradient(800px 420px at 8% 0%, rgba(34, 211, 238, .12), transparent 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}
.cc * { box-sizing: border-box; }
.cc h2, .cc h3 { margin: 0; }

/* faint grid texture */
.cc::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(148,163,216,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,216,.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}
.cc > * { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Topbar — floating glass bar
   -------------------------------------------------------------------------- */
.cc-topbar {
    display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
    margin: .9rem auto 0; padding: .6rem .9rem;
    width: min(1240px, calc(100% - 2rem));
    background: rgba(13, 18, 34, .78);
    border: 1px solid var(--line);
    border-radius: 16px;
    backdrop-filter: blur(14px) saturate(150%);
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255,255,255,.05);
    position: sticky; top: .8rem; z-index: 40;
}
.cc-brand { display: flex; align-items: center; gap: .65rem; }
.cc-logo {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    font-size: 1.05rem; color: #04121a;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 8px 22px -6px var(--glow-c);
}
.cc-brand b {
    display: block; font-size: 1rem; letter-spacing: -.02em;
    font-family: "Space Grotesk", "Inter", sans-serif;
}
.cc-brand small { color: var(--muted); font-size: .7rem; font-weight: 500; letter-spacing: .03em; }

.cc-nav { display: flex; gap: .2rem; margin: 0 auto; flex-wrap: wrap; background: rgba(255,255,255,.04); border: 1px solid var(--line); padding: .25rem; border-radius: 11px; }
.cc-navbtn {
    border: 0; background: transparent; color: var(--muted); font: 600 .83rem inherit;
    padding: .46rem .9rem; border-radius: 8px; cursor: pointer;
    transition: color .16s, background .16s;
}
.cc-navbtn:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.cc-navbtn.active {
    color: #04121a; font-weight: 700;
    background: linear-gradient(135deg, var(--brand), #67e8f9);
    box-shadow: 0 6px 16px -6px var(--glow-c);
}

.cc-live {
    color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .14em;
    display: inline-flex; gap: .4rem; align-items: center;
    background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .3);
    padding: .3rem .7rem; border-radius: 999px;
}
.cc-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: ccp 1.5s infinite; }
@keyframes ccp {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--glow-c); }
    50% { opacity: .55; box-shadow: 0 0 0 5px rgba(34, 211, 238, 0); }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.cc-view { max-width: 1240px; margin: 0 auto; padding: 1.8rem 1.4rem 3.5rem; animation: ccIn .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes ccIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cc-view[hidden] { display: none !important; }

.cc-h {
    font: 700 1.6rem/1.15 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.025em;
    background: linear-gradient(90deg, #fff, #a5b4fc 65%, var(--brand));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cc-sub { color: var(--muted); font-size: .87rem; margin: .35rem 0 1.4rem; }

/* --------------------------------------------------------------------------
   KPI cards — glass tiles with neon edge
   -------------------------------------------------------------------------- */
.cc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.3rem; }
.cc-kpi {
    position: relative; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 16px; padding: 1.1rem 1.2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255,255,255,.04);
    transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .2s;
}
.cc-kpi::before {
    content: ""; position: absolute; top: 0; left: 1.2rem; right: 1.2rem; height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent); opacity: .6;
}
.cc-kpi::after {
    content: ""; position: absolute; inset: auto -35% -65% 45%; height: 140%; border-radius: 50%;
    background: radial-gradient(closest-side, var(--glow-v), transparent); pointer-events: none;
}
.cc-kpi:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 26px 50px -26px rgba(0,0,0,.95), 0 0 40px -18px var(--glow-c); }
.cc-kpi .ic {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .22); font-size: 1rem;
}
.cc-kpi b {
    font: 700 1.65rem/1.1 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.03em;
    display: block; margin-top: .6rem; font-variant-numeric: tabular-nums; color: #fff;
}
.cc-kpi small { color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; display: block; margin-top: .15rem; }
.cc-kpi .dl { color: var(--ok); font-size: .74rem; font-weight: 700; margin-top: .35rem; }

/* --------------------------------------------------------------------------
   Cards & grid
   -------------------------------------------------------------------------- */
.cc-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2rem; }
.cc-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
    padding: 1.25rem 1.35rem; margin-bottom: 1.2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255,255,255,.04);
}
.cc-card h3 {
    font: 700 .95rem "Space Grotesk", "Inter", sans-serif; letter-spacing: -.01em;
    margin-bottom: 1rem; color: #fff;
    display: flex; align-items: center; gap: .5rem;
}
.cc-card h3::before {
    content: ""; width: 8px; height: 8px; border-radius: 3px;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    box-shadow: 0 0 10px var(--glow-c);
}

#cc-growth { width: 100%; height: 170px; }

/* table */
.cc-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.cc-table th {
    text-align: left; color: var(--muted); font-size: .66rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em; padding: .55rem .65rem;
    border-bottom: 1px solid var(--line);
}
.cc-table td { padding: .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cc-table tr:last-child td { border-bottom: 0; }
.cc-table tr { transition: background .14s; }
.cc-table tr:hover td { background: rgba(148, 163, 216, .05); }
.cc-table td b { color: #fff; font-weight: 600; }
.cc-table td { font-variant-numeric: tabular-nums; }

/* status pills — neon */
.cc-status { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .18rem .6rem; border-radius: 999px; }
.cc-status.Sent { background: rgba(52, 211, 153, .12); color: var(--ok); border: 1px solid rgba(52, 211, 153, .35); }
.cc-status.Sending { background: rgba(34, 211, 238, .12); color: var(--brand); border: 1px solid rgba(34, 211, 238, .35); }
.cc-status.Scheduled { background: rgba(251, 191, 36, .1); color: var(--warn); border: 1px solid rgba(251, 191, 36, .3); }

/* progress bars */
.cc-bar { height: 6px; background: rgba(148, 163, 216, .12); border-radius: 999px; overflow: hidden; margin-top: .35rem; }
.cc-bar i {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--brand2), var(--brand));
    box-shadow: 0 0 12px var(--glow-c);
    transition: width .6s cubic-bezier(.22,1,.36,1);
}

/* plans */
.cc-plan { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.cc-plan:last-child { border-bottom: 0; }
.cc-plan .dot { width: .75rem; height: .75rem; border-radius: 4px; box-shadow: 0 0 10px currentColor; }
.cc-plan .pn { flex: 1; color: var(--ink); font-weight: 600; }
.cc-plan .pn small { color: var(--muted); display: block; font-size: .74rem; font-weight: 500; }
.cc-plan b { font-variant-numeric: tabular-nums; color: #fff; font-family: "Space Grotesk", sans-serif; }

/* agents */
.cc-agent { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.cc-agent:last-child { border-bottom: 0; }
.cc-av {
    width: 2.3rem; height: 2.3rem; border-radius: 11px;
    background: linear-gradient(135deg, var(--brand2), var(--brand)); color: #04121a;
    display: grid; place-items: center; font-weight: 800; font-size: .8rem;
    box-shadow: 0 6px 14px -6px var(--glow-v);
}
.cc-agent .an b { display: block; color: #fff; font-weight: 600; }
.cc-agent .an small { color: var(--muted); font-size: .74rem; }
.cc-agent .met { margin-left: auto; text-align: right; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.cc-agent .met b { color: var(--brand); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .cc-grid { grid-template-columns: 1fr; }
    .cc-topbar { position: static; }
}
@media (max-width: 780px) {
    .cc-kpis { grid-template-columns: repeat(2, 1fr); }
    .cc-nav { margin: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .cc-navbtn { white-space: nowrap; }
    .cc-view { padding: 1.2rem 1rem 3rem; }
}
