/* ═══════════════════════════════════════════════════════════════
   Service Excellence Command Center — Premium Dashboard CSS
   CX-PredictIQ © 2026
   ═══════════════════════════════════════════════════════════════ */

:root {
    --se-bg: #060a13;
    --se-surface: rgba(15, 23, 42, 0.6);
    --se-surface2: rgba(30, 41, 59, 0.45);
    --se-border: rgba(255, 255, 255, 0.07);
    --se-border-hover: rgba(99, 102, 241, 0.4);
    --se-text: #f1f5f9;
    --se-muted: #94a3b8;
    --se-dim: #64748b;
    --se-primary: #6366f1;
    --se-primary-glow: rgba(99, 102, 241, 0.35);
    --se-cyan: #06b6d4;
    --se-emerald: #10b981;
    --se-amber: #f59e0b;
    --se-rose: #f43f5e;
    --se-violet: #8b5cf6;
    --se-indigo: #818cf8;
    --se-sky: #38bdf8;
    --se-teal: #14b8a6;
    --glass: rgba(15, 23, 42, 0.55);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--se-bg);
    color: var(--se-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Ambient background ── */
.ambient-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(6,182,212,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139,92,246,0.04) 0%, transparent 60%);
}

/* ── Navigation ── */
.se-nav {
    background: rgba(6,10,19,0.88);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--se-border);
    padding: 0.85rem 0;
    position: sticky; top: 0; z-index: 100;
}
.se-nav-inner {
    max-width: 1800px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
.se-brand {
    display: flex; align-items: center; gap: 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem; font-weight: 700; color: #fff;
    text-decoration: none;
}
.se-brand .logo {
    width: 30px; height: 30px; background: linear-gradient(135deg, var(--se-primary), var(--se-cyan));
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 14px var(--se-primary-glow);
}
.se-nav-links {
    display: flex; gap: 2rem; align-items: center;
}
.se-nav-links a {
    color: var(--se-muted); text-decoration: none; font-weight: 500;
    font-size: 0.88rem; transition: all 0.3s; display: flex; align-items: center; gap: 0.5rem;
}
.se-nav-links a:hover { color: #fff; }
.se-nav-links a.active { color: var(--se-primary); }
.live-badge {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
    border-radius: 99px; padding: 0.4rem 1rem; font-size: 0.72rem; font-weight: 700; color: var(--se-emerald);
}
.live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--se-emerald);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* ── Page Layout ── */
.se-wrap {
    max-width: 1800px; margin: 0 auto; padding: 2rem; position: relative; z-index: 1;
}

/* ── Hero ── */
.se-hero {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 2.5rem;
}
.se-hero h1 {
    font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
}
.se-hero p { color: var(--se-muted); font-size: 1.05rem; max-width: 700px; }

.se-cx-score {
    text-align: center; padding: 1.5rem 2.5rem;
    background: var(--glass); border: 1px solid var(--se-border); border-radius: 20px;
    position: relative; overflow: hidden;
}
.se-cx-score::before {
    content: ''; position: absolute; inset: 0;
    background: conic-gradient(from 180deg, var(--se-primary) 0%, var(--se-cyan) 25%, var(--se-emerald) 50%, var(--se-amber) 75%, var(--se-primary) 100%);
    opacity: 0.06;
}
.se-cx-score .score-label {
    font-size: 0.65rem; color: var(--se-muted); text-transform: uppercase; letter-spacing: 2px; font-weight: 700;
    position: relative;
}
.se-cx-score .score-val {
    font-family: 'Space Grotesk', sans-serif; font-size: 3.5rem; font-weight: 800; color: #fff;
    position: relative;
}
.se-cx-score .score-label-bottom {
    font-size: 0.7rem; color: var(--se-emerald); font-weight: 700; position: relative;
}

/* ── Persona Tabs ── */
.se-tabs {
    display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.se-tab {
    background: var(--se-surface); border: 1px solid var(--se-border); border-radius: 12px;
    padding: 0.7rem 1.4rem; font-size: 0.82rem; font-weight: 600; color: var(--se-muted);
    cursor: pointer; transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; gap: 0.6rem;
}
.se-tab:hover { border-color: var(--se-border-hover); color: #fff; transform: translateY(-2px); }
.se-tab.active {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.4); color: var(--se-primary);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}
.se-tab i { font-size: 1rem; }

/* ── Section Cards ── */
.se-section {
    display: none;
    animation: fadeInSection 0.5s ease-out;
}
.se-section.active { display: block; }

@keyframes fadeInSection {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── KPI Grid ── */
.se-kpi-grid {
    display: grid; gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.se-kpi-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.se-kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.se-kpi-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.se-kpi-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.se-kpi {
    background: var(--glass); border: 1px solid var(--se-border); border-radius: 18px;
    padding: 1.75rem; position: relative; overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.se-kpi::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--kpi-accent, linear-gradient(90deg, var(--se-primary), var(--se-cyan)));
}
.se-kpi:hover {
    transform: translateY(-6px); border-color: var(--se-border-hover);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.se-kpi .icon {
    width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 1rem; color: var(--se-primary);
}
.se-kpi h4 {
    font-size: 0.72rem; color: var(--se-muted); text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: 700; margin-bottom: 0.4rem;
}
.se-kpi .val {
    font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; color: #fff;
}
.se-kpi .sub {
    font-size: 0.78rem; color: var(--se-dim); margin-top: 0.35rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.se-kpi .sub.up { color: var(--se-emerald); }
.se-kpi .sub.down { color: var(--se-rose); }
.se-kpi .sub.warn { color: var(--se-amber); }

/* ── Benchmark Bar ── */
.benchmark-bar {
    margin-top: 1rem; position: relative;
}
.benchmark-bar .bar-bg {
    width: 100%; height: 6px; background: rgba(255,255,255,0.08); border-radius: 10px;
    overflow: hidden; position: relative;
}
.benchmark-bar .bar-fill {
    height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, var(--se-primary), var(--se-cyan));
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.benchmark-bar .markers {
    position: relative; margin-top: 4px; font-size: 0.6rem; display: flex; justify-content: space-between;
}
.benchmark-bar .marker {
    position: absolute; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.benchmark-bar .marker::before {
    content: ''; width: 1px; height: 10px; background: rgba(255,255,255,0.2);
}
.benchmark-bar .marker.global { color: var(--se-amber); }
.benchmark-bar .marker.best { color: var(--se-emerald); }
.benchmark-bar .marker.ours { color: var(--se-primary); }

/* ── Glass Panel ── */
.se-panel {
    background: var(--glass); border: 1px solid var(--se-border); border-radius: 20px;
    padding: 2rem; backdrop-filter: blur(20px); margin-bottom: 2rem;
}
.se-panel h3 {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem;
}
.se-panel h3 i { color: var(--se-primary); }

/* ── Data Grid ── */
.se-data-grid {
    display: grid; gap: 2rem; margin-bottom: 2rem;
}
.se-data-grid.g-2 { grid-template-columns: 1fr 1fr; }
.se-data-grid.g-3 { grid-template-columns: 1fr 1fr 1fr; }
.se-data-grid.g-2-1 { grid-template-columns: 2fr 1fr; }
.se-data-grid.g-1-2 { grid-template-columns: 1fr 2fr; }

/* ── Table ── */
.se-table {
    width: 100%; border-collapse: separate; border-spacing: 0 0.5rem;
}
.se-table th {
    text-align: left; padding: 0.75rem 1rem; color: var(--se-muted);
    font-size: 0.7rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em;
}
.se-table-row {
    background: rgba(255,255,255,0.015); transition: all 0.2s;
}
.se-table-row:hover {
    background: rgba(255,255,255,0.04); transform: scale(1.001);
}
.se-table-row td {
    padding: 1rem; vertical-align: middle;
    border-top: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.se-table-row td:first-child { border-left: 1px solid rgba(255,255,255,0.03); border-radius: 10px 0 0 10px; }
.se-table-row td:last-child { border-right: 1px solid rgba(255,255,255,0.03); border-radius: 0 10px 10px 0; }

/* ── Status Badges ── */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.65rem; border-radius: 6px;
    font-size: 0.7rem; font-weight: 700;
}
.badge.success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: var(--se-emerald); }
.badge.warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: var(--se-amber); }
.badge.danger { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.3); color: var(--se-rose); }
.badge.info { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); color: var(--se-primary); }
.badge.neutral { background: rgba(148,163,184,0.12); border: 1px solid rgba(148,163,184,0.2); color: var(--se-muted); }

/* ── Progress Circles ── */
.progress-ring { position: relative; width: 48px; height: 48px; display: inline-block; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: transparent; stroke-width: 4; }
.progress-ring .bg { stroke: rgba(255,255,255,0.08); }
.progress-ring .fill { stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.progress-ring .center-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800;
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%; border-radius: 10px; transition: width 1s ease;
}

/* ── Charts ── */
.se-chart-wrap {
    position: relative; height: 300px;
}

/* ── SWOT Grid ── */
.swot-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.swot-card {
    border-radius: 16px; padding: 1.5rem; border: 1px solid var(--se-border);
}
.swot-card.strengths { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.2); }
.swot-card.weaknesses { background: rgba(244,63,94,0.06); border-color: rgba(244,63,94,0.2); }
.swot-card.opportunities { background: rgba(6,182,212,0.06); border-color: rgba(6,182,212,0.2); }
.swot-card.threats { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
.swot-card h4 {
    font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 700;
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.swot-card.strengths h4 { color: var(--se-emerald); }
.swot-card.weaknesses h4 { color: var(--se-rose); }
.swot-card.opportunities h4 { color: var(--se-cyan); }
.swot-card.threats h4 { color: var(--se-amber); }
.swot-card ul { list-style: none; }
.swot-card li {
    padding: 0.5rem 0; font-size: 0.82rem; color: var(--se-muted);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.swot-card li:last-child { border-bottom: none; }
.swot-card li i { margin-top: 3px; font-size: 0.7rem; }

/* ── Initiative Cards ── */
.initiative-card {
    background: rgba(255,255,255,0.02); border: 1px solid var(--se-border); border-radius: 16px;
    padding: 1.5rem; margin-bottom: 1rem; transition: all 0.3s;
}
.initiative-card:hover { border-color: var(--se-border-hover); transform: translateX(4px); }
.initiative-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.initiative-title { font-weight: 700; font-size: 0.95rem; }
.initiative-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.initiative-action {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--se-muted);
}
.initiative-action i.complete { color: var(--se-emerald); }
.initiative-action i.pending { color: var(--se-dim); }
.initiative-action i.progress { color: var(--se-amber); }

/* ── Capacity Gauge ── */
.capacity-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.gauge-card {
    background: rgba(255,255,255,0.02); border: 1px solid var(--se-border); border-radius: 16px;
    padding: 1.5rem; text-align: center;
}
.gauge-card h4 { font-size: 0.75rem; color: var(--se-muted); text-transform: uppercase; margin-bottom: 1rem; }
.gauge-circle {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1rem;
    position: relative;
    background: conic-gradient(
        var(--gauge-color, var(--se-primary)) calc(var(--gauge-pct, 50) * 3.6deg),
        rgba(255,255,255,0.06) 0
    );
    display: flex; align-items: center; justify-content: center;
}
.gauge-circle::after {
    content: ''; width: 62px; height: 62px; border-radius: 50%; background: var(--se-bg);
    position: absolute;
}
.gauge-circle .gauge-val {
    position: relative; z-index: 1; font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem; font-weight: 800; color: #fff;
}
.gauge-card .gauge-label { font-size: 0.75rem; color: var(--se-dim); }
.gauge-card .gauge-rec {
    font-size: 0.72rem; color: var(--se-muted); margin-top: 0.75rem;
    background: rgba(255,255,255,0.03); border-radius: 8px; padding: 0.5rem;
}

/* ── Heatmap ── */
.heatmap-row {
    display: grid; grid-template-columns: 150px repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
}
.heatmap-cell {
    border-radius: 6px; padding: 0.5rem; text-align: center; font-size: 0.72rem; font-weight: 700;
    transition: all 0.2s;
}
.heatmap-cell:hover { transform: scale(1.08); }
.heatmap-label { display: flex; align-items: center; font-size: 0.78rem; color: var(--se-muted); font-weight: 600; }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.anim-up { animation: fadeInUp 0.6s ease-out backwards; }
.anim-up-d1 { animation-delay: 0.1s; }
.anim-up-d2 { animation-delay: 0.2s; }
.anim-up-d3 { animation-delay: 0.3s; }
.anim-up-d4 { animation-delay: 0.4s; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    .se-kpi-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .se-kpi-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
    .se-kpi-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
    .se-data-grid.g-2, .se-data-grid.g-2-1, .se-data-grid.g-1-2 { grid-template-columns: 1fr; }
    .swot-grid { grid-template-columns: 1fr; }
    .capacity-gauges { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .se-hero { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .se-kpi-grid.cols-4, .se-kpi-grid.cols-3, .se-kpi-grid.cols-5, .se-kpi-grid.cols-6 {
        grid-template-columns: 1fr;
    }
    .se-nav-links { display: none; }
    .se-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .capacity-gauges { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }
