/* ======================================================
   ClimAlert Dashboard v2 — Redesigned CSS
   Design system from mockup (Instatus/Betterstack/Linear)
   ====================================================== */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Surface layers (depth-based) */
    --bg-void: #060912;
    --bg-base: #0a0e1a;
    --bg-surface: #111627;
    --bg-elevated: #171d32;
    --bg-overlay: #1e2642;
    --bg-hover: #252e4a;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* Text */
    --text-primary: #f0f2f7;
    --text-secondary: #9ca3bf;
    --text-muted: #5c6384;
    --text-dim: #3d4460;

    /* Status — both naming conventions for compat */
    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.12);
    --green-glow: rgba(16, 185, 129, 0.30);
    --yellow: #f59e0b;
    --yellow-soft: rgba(245, 158, 11, 0.12);
    --orange: #f97316;
    --orange-soft: rgba(249, 115, 22, 0.12);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);
    --red-glow: rgba(239, 68, 68, 0.30);

    /* Legacy status aliases (used by JS) */
    --status-green: #10b981;
    --status-yellow: #f59e0b;
    --status-orange: #f97316;
    --status-red: #ef4444;

    /* Accent */
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-bright: #818cf8;
    --accent-primary: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-blue: #3b82f6;
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.12);

    /* Semantic backgrounds */
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning-bg: rgba(245, 158, 11, 0.08);
    --error-bg: rgba(239, 68, 68, 0.08);

    /* Effects */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
    --shadow-glow-green: 0 0 24px rgba(16, 185, 129, 0.15);
    --shadow-glow-red: 0 0 24px rgba(239, 68, 68, 0.15);
    --transition: 0.15s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-void);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── HEADER / TOPBAR ─── */
.topbar,
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.topbar-left,
.dash-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e0e7ff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.nav-link:hover { color: var(--text-secondary); background: var(--bg-overlay); }
.nav-link.active { color: var(--text-primary); background: var(--bg-overlay); }

.btn-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-alert:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.dash-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.dash-logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e0e7ff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

.stat-online .stat-value { color: var(--green); }
.stat-problems .stat-value { color: var(--yellow); }
.stat-incidents .stat-value { color: var(--red); }

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
}

/* Topbar stat pills (mockup style) */
.topbar-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.topbar-stat.online { background: var(--green-soft); color: var(--green); }
.topbar-stat.down { background: var(--red-soft); color: var(--red); }
.topbar-stat .stat-dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.topbar-stat.online .stat-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.topbar-stat.down .stat-dot { background: var(--red); animation: pulse-red 2s infinite; }

.btn-alert-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}
.btn-alert-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-alert-icon { font-size: 1rem; }

.dash-user-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}
.dash-user-link:hover {
    color: var(--text-primary);
    border-color: var(--border-default);
    background: var(--bg-overlay);
}

/* ─── SERVICE TICKER ─── */
.service-ticker {
    width: 100%;
    overflow: hidden;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 0;
    position: relative;
    user-select: none;
}

.service-ticker::before,
.service-ticker::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.service-ticker::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-base), transparent);
}

.service-ticker::after {
    right: 0;
    background: linear-gradient(90deg, transparent, var(--bg-base));
}

.ticker-track {
    display: flex;
    gap: 0;
    animation: tickerScroll 120s linear infinite;
    width: max-content;
}

.service-ticker:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 18px;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s;
}

.ticker-item:hover { background: var(--bg-surface); }

.ticker-item.ticker-all-ok {
    cursor: default;
    padding: 3px 24px;
}

.ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticker-dot.operational {
    background: var(--green);
    box-shadow: 0 0 6px var(--green-glow);
}

.ticker-dot.degraded {
    background: var(--yellow);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    animation: tickerPulse 1.5s ease-in-out infinite;
}

.ticker-dot.outage {
    background: var(--red);
    box-shadow: 0 0 8px var(--red-glow);
    animation: tickerPulse 0.8s ease-in-out infinite;
}

.ticker-name {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ticker-status {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticker-status.operational { color: var(--green); }
.ticker-status.degraded { color: var(--yellow); }
.ticker-status.outage { color: var(--red); }

.ticker-item.has-incident .ticker-name { color: var(--red); }

.ticker-change {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.ticker-change.down {
    background: var(--red-soft);
    color: var(--red);
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes tickerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── HERO STATUS BANNER / INCIDENT BANNER ─── */
.hero-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.6s ease, border-color 0.6s ease;
    overflow: hidden;
    font-size: 0.78rem;
}

.hero-banner.status-ok {
    background: linear-gradient(90deg, var(--green-soft), transparent);
    border-bottom-color: rgba(16, 185, 129, 0.15);
}

.hero-banner.status-warning {
    background: linear-gradient(90deg, var(--yellow-soft), transparent);
    border-bottom-color: rgba(245, 158, 11, 0.15);
}

.hero-banner.status-critical {
    background: linear-gradient(90deg, var(--red-soft), transparent);
    border-bottom-color: rgba(239, 68, 68, 0.15);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.hero-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.hero-banner.status-ok .hero-icon {
    background: var(--green);
    color: #fff;
    box-shadow: 0 0 6px var(--green);
}

.hero-banner.status-warning .hero-icon {
    background: var(--yellow);
    color: #fff;
    animation: pulse-red 2s infinite;
}

.hero-banner.status-critical .hero-icon {
    background: var(--red);
    color: #fff;
    animation: pulse-red 2s infinite;
}

.hero-text {
    font-weight: 600;
    color: var(--text-primary);
}

.hero-banner.status-critical .hero-text { color: var(--red); }
.hero-banner.status-warning .hero-text { color: var(--yellow); }
.hero-banner.status-ok .hero-text { color: var(--green); }

.hero-updated {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-left: auto;
    flex-shrink: 0;
}

.hero-problems {
    display: flex;
    gap: 6px;
    margin-left: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.hero-problem-item {
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.hero-problem-item:hover {
    border-color: var(--border-default);
    background: var(--bg-hover);
}

/* Mockup incident-banner classes (alias) */
.incident-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: linear-gradient(90deg, var(--red-soft), transparent);
    border-bottom: 1px solid rgba(239, 68, 68, 0.15);
    font-size: 0.78rem;
    overflow: hidden;
}

.incident-banner-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
    animation: pulse-red 2s infinite;
    color: #fff;
}

.incident-banner-text {
    font-weight: 600;
    color: var(--red);
}

.incident-banner-services {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.incident-tag {
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 4px var(--red); }
    50% { box-shadow: 0 0 12px var(--red), 0 0 24px rgba(239,68,68,0.3); }
}

/* ─── CONTROLS BAR ─── */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    gap: 16px;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.view-toggle {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.view-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.view-btn.active {
    background: var(--bg-overlay);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.view-btn:hover:not(.active) {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.filter-pills {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 600px;
}
.filter-pills::-webkit-scrollbar { display: none; }

/* Category pills (mockup) */
.category-pills {
    display: flex;
    gap: 4px;
}

.cat-pill {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--border-default); color: var(--text-secondary); }
.cat-pill.active {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-bright);
}

.pill {
    padding: 5px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

.pill.active {
    background: var(--accent-soft);
    color: var(--accent-bright);
    border-color: rgba(99, 102, 241, 0.3);
}

.pill:hover:not(.active) {
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.pill-more-wrapper {
    position: relative;
}
.pill.pill-more {
    border-style: dashed;
}
.pill-more-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px;
    z-index: 100;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pill-more-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    text-align: left;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.pill-more-item:hover, .pill-more-item.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Search box (mockup style) */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    width: 220px;
    transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.78rem;
    outline: none;
    width: 100%;
}
.search-box input::placeholder { color: var(--text-dim); }

/* Search wrapper (existing) */
.search-wrapper {
    position: relative;
    min-width: 180px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input::placeholder { color: var(--text-dim); }

.status-filter {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.status-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.status-btn.active {
    background: var(--bg-overlay);
    color: var(--text-primary);
}
.status-btn:hover:not(.active) {
    color: var(--text-secondary);
}

/* ─── MAIN LAYOUT ─── */
.dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
}

.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    min-height: calc(100vh - 56px - 48px - 40px);
}

/* Main layout (mockup grid) */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - 56px - 48px - 40px);
    min-height: 500px;
}

/* ─── MAP AREA ─── */
.map-area {
    position: relative;
    background: var(--bg-base);
    overflow-y: auto;
    overflow-x: hidden;
}
.map-area.map-mode {
    overflow: hidden;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    position: relative;
}

.map-visual {
    width: 100%;
    height: 100%;
    position: relative;
}
.map-visual svg {
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

/* Map markers */
.map-marker {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}
.marker-dot.green { background: var(--green); box-shadow: 0 0 12px var(--green-glow); }
.marker-dot.red { background: var(--red); box-shadow: 0 0 12px var(--red-glow); animation: pulse-marker 2s infinite; }
.marker-dot.yellow { background: var(--yellow); box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }

.marker-dot::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.2;
}
.marker-dot.green::after { border-color: var(--green); }
.marker-dot.red::after { border-color: var(--red); }
.marker-dot.yellow::after { border-color: var(--yellow); }

@keyframes pulse-marker {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.marker-label {
    font-size: 0.58rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.marker-cluster {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    position: absolute;
}
.marker-cluster.green-cluster {
    background: var(--green-soft);
    border: 2px solid var(--green);
    color: var(--green);
}
.marker-cluster.red-cluster {
    background: var(--red-soft);
    border: 2px solid var(--red);
    color: var(--red);
    animation: pulse-marker 2s infinite;
}
.marker-cluster.mixed-cluster {
    background: var(--yellow-soft);
    border: 2px solid var(--yellow);
    color: var(--yellow);
}

/* ─── MAP OVERLAY STATS ─── */
.map-overlay-stats {
    position: absolute;
    bottom: 24px;
    left: 16px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 10;
}

.map-stat-card {
    padding: 12px 16px;
    background: rgba(17, 22, 39, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 140px;
}

.map-stat-label {
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.map-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.map-stat-value.val-green { color: var(--green); }
.map-stat-value.val-red { color: var(--red); }

.map-stat-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

/* ─── LIST VIEW ─── */
.service-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Skeleton loading */
.skeleton-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-card {
    height: 80px;
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-md);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state-icon { font-size: 2.5rem; opacity: 0.5; }

/* ─── CATEGORY GROUPS ─── */
.category-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s;
}

.category-group:hover {
    border-color: var(--border-default);
}

.category-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.category-group-header:hover {
    background: var(--bg-elevated);
}

.category-group-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.category-group-info {
    flex: 1;
    min-width: 0;
}

.category-group-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-group-stats {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    margin-top: 2px;
}

.cat-stat-ok { color: var(--green); }
.cat-stat-warn { color: var(--yellow); }
.cat-stat-down { color: var(--red); font-weight: 600; }

.category-group-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.category-group.open .category-group-arrow {
    transform: rotate(90deg);
}

.category-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-group.open .category-group-body {
    max-height: 2000px;
}

.category-cards {
    padding: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ─── SERVICE CARD ─── */
.svc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.svc-card:hover {
    background: var(--bg-elevated);
}

.svc-card-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.svc-card-logo-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.svc-card-main {
    flex: 1;
    min-width: 0;
}

.svc-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.svc-card-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.svc-card-comps {
    display: flex;
    gap: 2px;
    align-items: center;
}

.svc-card-comps--dots {
    display: flex;
    flex-wrap: wrap;
    max-width: 120px;
}

.svc-card-comps--bar {
    display: none;
}

.svc-card-comp-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

.svc-card-comp-dot.operational { background: var(--green); }
.svc-card-comp-dot.degraded { background: var(--yellow); }
.svc-card-comp-dot.outage { background: var(--red); }

/* Mobile compact bar */
.comp-bar {
    display: flex;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background: var(--bg-overlay);
    flex-shrink: 0;
}

.comp-bar-seg { height: 100%; }
.comp-bar-ok { background: var(--green); }
.comp-bar-warn { background: var(--yellow); }
.comp-bar-down { background: var(--red); }

.comp-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.svc-card-incident-info {
    margin-top: 3px;
}

.svc-card-incident-title {
    font-size: 0.72rem;
    color: var(--yellow);
}

.svc-card-incident-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.svc-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.svc-card-incident-tag {
    font-size: 0.62rem;
    padding: 2px 6px;
    background: var(--red-soft);
    color: var(--red);
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.svc-card-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.operational {
    background: var(--green);
    box-shadow: 0 0 6px var(--green-glow);
}

.status-dot.degraded {
    background: var(--yellow);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    animation: pulse-yellow 2s ease-in-out infinite;
}

.status-dot.outage {
    background: var(--red);
    box-shadow: 0 0 6px var(--red-glow);
    animation: pulse-status-red 1s ease-in-out infinite;
}

@keyframes pulse-yellow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-status-red {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
}

.status-text {
    font-size: 0.72rem;
    font-weight: 500;
}

.status-text.operational { color: var(--green); }
.status-text.degraded { color: var(--yellow); }
.status-text.outage { color: var(--red); }

.svc-card-arrow {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s;
}

.svc-card:hover .svc-card-arrow { opacity: 1; }

/* ─── INCIDENTS SIDEBAR ─── */
.incidents-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 240px);
    position: sticky;
    top: 76px;
    border-left: 1px solid var(--border-subtle);
    overflow: hidden;
}

.incidents-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.section-title {
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.section-title-icon { font-size: 1rem; }

.incidents-count {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: var(--red-soft);
    color: var(--red);
}

.incidents-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.incidents-sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--text-muted);
    gap: 8px;
    font-size: 0.85rem;
}

.incidents-empty-icon {
    font-size: 2rem;
    color: var(--green);
    opacity: 0.5;
}

.sidebar-cta {
    margin: 8px;
    padding: 10px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--accent-bright);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
}

.sidebar-cta:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Mockup sidebar classes */
.sidebar {
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.sidebar-badge.red { background: var(--red-soft); color: var(--red); }

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}
.sidebar-tab.active {
    color: var(--text-primary);
}
.sidebar-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ─── INCIDENT CARDS (sidebar items) ─── */
.incident-card {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 3px solid var(--border-default);
    background: var(--bg-surface);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.incident-card:hover { background: var(--bg-elevated); }
.incident-card.severity-critical { border-left-color: var(--red); }
.incident-card.severity-major { border-left-color: var(--orange); }
.incident-card.severity-minor { border-left-color: var(--yellow); }

.incident-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.incident-service-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.severity-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.severity-critical {
    background: var(--red-soft);
    color: var(--red);
}

.severity-major {
    background: var(--orange-soft);
    color: var(--orange);
}

.severity-minor {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.severity-none {
    background: rgba(107, 115, 148, 0.1);
    color: var(--text-muted);
}

/* Mockup incident-item */
.incident-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.incident-item:hover { background: var(--bg-elevated); }

.incident-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.incident-item.sev-critical::before { background: var(--red); }
.incident-item.sev-major::before { background: var(--orange); }
.incident-item.sev-minor::before { background: var(--yellow); }

.incident-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.incident-service {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.incident-service-logo {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.52rem;
    font-weight: 700;
    color: var(--text-muted);
}

.incident-sev {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.incident-sev.critical { background: var(--red-soft); color: var(--red); }
.incident-sev.major { background: var(--orange-soft); color: var(--orange); }
.incident-sev.minor { background: var(--yellow-soft); color: var(--yellow); }

.incident-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.incident-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.4;
}

.incident-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.incident-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.incident-region {
    display: flex;
    align-items: center;
    gap: 4px;
}

.incident-region-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-dim);
}

.incident-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.incident-source-link, .incident-flow-link, .incident-fluxo-link {
    font-size: 0.72rem;
    color: var(--accent-bright);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}

.incident-source-link:hover, .incident-flow-link:hover, .incident-fluxo-link:hover {
    opacity: 0.8;
}

.incident-fluxo-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.incident-fluxo-link:hover {
    background: rgba(99, 102, 241, 0.2);
    text-decoration: none;
    border-color: var(--accent);
}

/* ─── MAP (Leaflet) ─── */
.map-container-full {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

#dashMap {
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: var(--bg-surface);
}

#mapContainer {
    width: 100%;
    height: 100%;
    min-height: 500px;
    position: relative;
}

/* Leaflet overrides */
.leaflet-container { background: var(--bg-surface) !important; font-family: 'Inter', sans-serif !important; }
.leaflet-popup-content-wrapper { background: var(--bg-elevated) !important; color: var(--text-primary) !important; border-radius: var(--radius-md) !important; box-shadow: var(--shadow-md) !important; border: 1px solid var(--border-default) !important; }
.leaflet-popup-tip { background: var(--bg-elevated) !important; border: 1px solid var(--border-default) !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; }
.leaflet-control-zoom a { background: var(--bg-elevated) !important; color: var(--text-primary) !important; border-color: var(--border-default) !important; }
.leaflet-tooltip { background: var(--bg-overlay) !important; color: var(--text-primary) !important; border: 1px solid var(--border-default) !important; border-radius: var(--radius-sm) !important; padding: 4px 8px !important; font-size: 0.75rem !important; }
.custom-marker { background: transparent !important; border: none !important; }

/* Map marker pulse */
.marker-pulse-red { animation: markerPulse 1.5s ease-in-out infinite; }
.marker-pulse-yellow { animation: markerPulse 2s ease-in-out infinite; }

@keyframes markerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Map popup */
.popup-service { font-size: 0.82rem; }
.popup-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.popup-logo { width: 24px; height: 24px; border-radius: 4px; }
.popup-name { font-weight: 600; }
.popup-status-badge { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 500; margin-bottom: 8px; }
.popup-status-operational { background: var(--green-soft); color: var(--green); }
.popup-status-degraded { background: var(--yellow-soft); color: var(--yellow); }
.popup-status-outage { background: var(--red-soft); color: var(--red); }
.popup-components { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.popup-component { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; padding: 2px 6px; background: var(--bg-overlay); border-radius: 4px; }
.popup-incident { background: var(--red-soft); padding: 8px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.popup-incident-title { font-size: 0.78rem; display: flex; align-items: center; gap: 6px; }
.popup-incident-link { font-size: 0.72rem; color: var(--accent-bright); text-decoration: none; }
.popup-actions { display: flex; gap: 8px; margin-top: 8px; }
.popup-btn-detail, .popup-btn-alert { padding: 5px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: all 0.15s; }
.popup-btn-detail { background: var(--bg-overlay); color: var(--text-primary); }
.popup-btn-alert { background: var(--accent); color: #fff; }

/* ─── SERVICE DETAIL POPUP ─── */
.svc-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.svc-popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.svc-popup {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    animation: popupIn 0.2s ease;
}

@keyframes popupIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.svc-popup-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.svc-popup-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; }
.svc-popup-logo-placeholder { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-overlay); display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.svc-popup-title { flex: 1; }
.svc-popup-name { font-size: 1.1rem; font-weight: 600; }
.svc-popup-cat { font-size: 0.78rem; color: var(--text-muted); }
.svc-popup-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 4px; line-height: 1; transition: color 0.15s; }
.svc-popup-close:hover { color: var(--text-primary); }

.svc-popup-status-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--bg-elevated); border-radius: var(--radius-sm); margin-bottom: 16px; }
.svc-popup-status-left { display: flex; align-items: center; gap: 8px; }
.svc-popup-status-dot { width: 10px; height: 10px; }
.svc-popup-status-text { font-weight: 600; font-size: 0.9rem; }
.svc-popup-status-text.operational { color: var(--green); }
.svc-popup-status-text.degraded { color: var(--yellow); }
.svc-popup-status-text.outage { color: var(--red); }
.svc-popup-check { font-size: 0.75rem; color: var(--text-muted); }

.svc-popup-section { margin-bottom: 16px; }
.svc-popup-section-title { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.svc-popup-comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.svc-popup-comp { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; padding: 4px 8px; background: var(--bg-overlay); border-radius: 4px; }
.svc-popup-no-incidents { color: var(--green); font-size: 0.85rem; padding: 12px; text-align: center; }

.svc-popup-incident { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; border-left: 3px solid var(--red); }
.svc-popup-incident-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.svc-popup-incident-title { font-size: 0.85rem; font-weight: 500; }
.svc-popup-incident-time { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }
.svc-popup-incident-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 6px; }
.svc-popup-incident-updates { margin-top: 8px; }
.svc-popup-update { display: flex; gap: 8px; font-size: 0.75rem; padding: 4px 0; border-top: 1px solid var(--border-subtle); }
.svc-popup-update-status { color: var(--accent-bright); font-weight: 600; white-space: nowrap; }
.svc-popup-update-desc { color: var(--text-secondary); }

.svc-popup-actions { display: flex; gap: 10px; margin-top: 16px; }
.card-btn { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all 0.15s; }
.card-btn-detail { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); }
.card-btn-detail:hover { border-color: var(--border-strong); background: var(--bg-overlay); }
.card-btn-alert { background: var(--accent); color: #fff; }
.card-btn-alert:hover { background: #4f46e5; }

/* ─── CTA BANNER ─── */
.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-lg);
    margin: 0 24px 24px;
    gap: 16px;
}

.cta-left,
.cta-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cta-icon,
.cta-banner-icon { font-size: 1.2rem; }

.cta-text strong,
.cta-banner-text strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
    color: var(--text-primary);
}
.cta-text span,
.cta-banner-text span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cta-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cta-btn,
.cta-banner-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.cta-btn:hover,
.cta-banner-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ─── BOTTOM SECTION ─── */
.bottom-section {
    background: var(--bg-base);
    border-top: 1px solid var(--border-subtle);
    padding: 24px;
}

/* ─── KPI STRIP ─── */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}
.kpi-card:hover {
    border-color: var(--border-default);
    background: var(--bg-elevated);
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-bottom: 6px;
}
.kpi-value.v-default { color: var(--text-primary); }
.kpi-value.v-green { color: var(--green); }
.kpi-value.v-red { color: var(--red); }
.kpi-value.v-orange { color: var(--orange); }
.kpi-value.v-yellow { color: var(--yellow); }

.kpi-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-trend {
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
}
.kpi-trend.up { color: var(--red); }
.kpi-trend.down { color: var(--green); }

/* ─── BOTTOM GRID (Ranking + Uptime) ─── */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.panel-pill {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s;
}
.panel-pill:hover { border-color: var(--border-default); color: var(--text-secondary); }
.panel-pill.active {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-bright);
}

.panel-link {
    font-size: 0.72rem;
    color: var(--accent-bright);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}
.panel-link:hover { opacity: 0.8; }

/* ─── RANKING SECTION ─── */
.ranking-section {
    margin: 16px 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.ranking-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ranking-filters {
    display: flex;
    gap: 4px;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.ranking-filter-btn {
    padding: 4px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ranking-filter-btn:hover { color: var(--text-secondary); }
.ranking-filter-btn.active {
    background: var(--bg-overlay);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.ranking-more-link {
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    color: var(--accent-bright);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s ease;
}
.ranking-more-link:hover { opacity: 0.8; }

.ranking-summary {
    display: none;
}

.ranking-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 12px;
    border-right: 1px solid var(--border-subtle);
}
.ranking-stat:last-child { border-right: none; }

.ranking-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1;
}
.ranking-stat-value.red { color: var(--red); }
.ranking-stat-value.orange { color: var(--orange); }
.ranking-stat-value.yellow { color: var(--yellow); }
.ranking-stat-value.blue { color: var(--blue); }

.ranking-stat-label {
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.ranking-list {
    padding: 0;
}

.ranking-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.ranking-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s;
}
.ranking-item:last-child { border-bottom: none; }
.ranking-item:hover { background: var(--bg-elevated); }

.ranking-pos {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}
.ranking-pos.gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.ranking-pos.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }
.ranking-pos.bronze { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.ranking-pos.normal,
.ranking-pos.default { background: var(--bg-overlay); color: var(--text-muted); }

.ranking-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ranking-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    object-fit: contain;
}

.ranking-logo-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ranking-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.ranking-cat {
    font-size: 0.58rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: 'JetBrains Mono', monospace;
}

.ranking-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.ranking-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ranking-stat-num {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-secondary);
}

.ranking-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
.ranking-badge.incidents {
    background: var(--red-soft);
    color: #fca5a5;
}
.ranking-badge.downtime {
    background: var(--yellow-soft);
    color: #fcd34d;
}

.ranking-uptime {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    width: 56px;
    text-align: right;
}
.ranking-uptime.good { background: var(--green-soft); color: var(--green); }
.ranking-uptime.warn { background: var(--yellow-soft); color: var(--yellow); }
.ranking-uptime.bad { background: var(--red-soft); color: var(--red); }

.ranking-severity-dots {
    display: flex;
    gap: 2px;
    align-items: center;
}
.sev-dot,
.ranking-sev-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.sev-dot.crit, .ranking-sev-dot.critical { background: var(--red); }
.sev-dot.maj, .ranking-sev-dot.major { background: var(--orange); }
.sev-dot.min, .ranking-sev-dot.minor { background: var(--yellow); }

.ranking-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.ranking-empty-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    display: block;
}

/* ─── UPTIME TIMELINE ─── */
.uptime-timeline {
    padding: 16px 18px;
}

.uptime-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.uptime-row:last-child { margin-bottom: 0; }

.uptime-service-name {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    width: 100px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uptime-bars {
    display: flex;
    gap: 1px;
    flex: 1;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
}

.uptime-bar {
    flex: 1;
    border-radius: 2px;
    transition: opacity 0.15s;
}
.uptime-bar:hover { opacity: 0.7; }
.uptime-bar.bar-green { background: var(--green); opacity: 0.6; }
.uptime-bar.bar-yellow { background: var(--yellow); }
.uptime-bar.bar-red { background: var(--red); }
.uptime-bar.bar-gray { background: var(--bg-overlay); opacity: 0.3; }

.uptime-pct {
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    width: 52px;
    text-align: right;
    flex-shrink: 0;
}
.uptime-pct.pct-good { color: var(--green); }
.uptime-pct.pct-warn { color: var(--yellow); }
.uptime-pct.pct-bad { color: var(--red); }

/* ─── RESOLVED INCIDENTS ─── */
.resolved-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.resolved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.resolved-header:hover { background: var(--bg-elevated); border-radius: var(--radius-md); }

.resolved-toggle-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.resolved-body {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.resolved-body.collapsed {
    max-height: 0;
}

.resolved-body.expanded {
    max-height: 2000px;
}

.resolved-section.open .resolved-toggle-arrow {
    transform: rotate(90deg);
}

.resolved-filters {
    display: flex;
    gap: 4px;
}

.resolved-filter-btn {
    padding: 4px 10px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.15s;
}

.resolved-filter-btn.active {
    background: var(--bg-overlay);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.resolved-timeline { padding: 0 16px 16px; }

.resolved-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-left: 2px solid var(--border-default);
    margin-left: 8px;
    gap: 4px;
}

.resolved-item.sev-critical { border-left-color: var(--red); }
.resolved-item.sev-major { border-left-color: var(--orange); }
.resolved-item.sev-minor { border-left-color: var(--yellow); }

.resolved-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resolved-service-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.resolved-time { font-size: 0.72rem; color: var(--text-muted); }
.resolved-title { font-size: 0.78rem; color: var(--text-secondary); }

.resolved-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.72rem;
}

.resolved-sev-badge { color: var(--text-muted); text-transform: capitalize; }
.resolved-duration { color: var(--text-muted); }
.resolved-check { color: var(--green); }

.resolved-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    color: var(--text-muted);
    gap: 8px;
}

.resolved-empty-icon { font-size: 1.5rem; color: var(--green); opacity: 0.5; }
.resolved-empty-text { font-size: 0.82rem; }

/* ─── FOOTER ─── */
.dash-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: auto;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-sep { opacity: 0.5; }
.footer-services-count { color: var(--text-secondary); }

/* Mockup footer classes */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.68rem;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-secondary); }

/* ─── LEAD MODAL ─── */
.lead-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lead-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.lead-modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: popupIn 0.2s ease;
}

.lead-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.lead-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.lead-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.lead-modal-body { padding: 20px; }

.lead-section {
    margin-bottom: 20px;
}

.lead-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.lead-hint { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }

.lead-field { margin-bottom: 12px; }

.lead-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.lead-label-whatsapp {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-whatsapp-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--green-soft);
    color: var(--green);
    border-radius: 8px;
    font-weight: 600;
}

.lead-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.lead-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.lead-input::placeholder { color: var(--text-dim); }

.lead-phone-input {
    display: flex;
    gap: 8px;
    position: relative;
}

.lead-country-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.lead-country-btn:hover { border-color: var(--border-strong); }
.lead-country-arrow { font-size: 0.6rem; color: var(--text-muted); }

.lead-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    width: 240px;
    box-shadow: var(--shadow-lg);
}

.lead-country-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s;
}

.lead-country-option:hover, .lead-country-option.active {
    background: var(--bg-overlay);
}

.lead-country-option-dial { color: var(--text-muted); margin-left: auto; }

.lead-services-toolbar {
    margin-bottom: 8px;
}

.lead-services-search {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
}

.lead-services-search:focus {
    border-color: var(--accent);
}

.lead-services {
    max-height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.lead-service-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.lead-service-item:hover { background: var(--bg-elevated); }
.lead-service-item.hidden { display: none; }

.lead-service-item input[type="checkbox"] {
    accent-color: var(--accent);
}

.lead-error {
    background: var(--red-soft);
    color: var(--red);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.lead-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.lead-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.lead-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* OTP */
.lead-verify-container { text-align: center; padding: 10px 0; }
.lead-verify-icon { font-size: 3rem; margin-bottom: 12px; }
.lead-verify-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.lead-verify-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }

.lead-otp-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.lead-otp-input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s;
}

.lead-otp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lead-otp-input.success { border-color: var(--green); background: var(--green-soft); }
.lead-otp-input.error { border-color: var(--red); animation: otpShake 0.3s ease; }

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.lead-verify-error {
    background: var(--red-soft);
    color: var(--red);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.lead-resend {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 16px;
}

.lead-resend a { color: var(--accent-bright); text-decoration: none; }
.lead-resend a:hover { text-decoration: underline; }
.lead-resend a.disabled { pointer-events: none; opacity: 0.5; }

/* Success */
.lead-success-container { text-align: center; padding: 20px 0; }
.lead-success-icon { font-size: 3rem; color: var(--green); margin-bottom: 12px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; background: var(--green-soft); border-radius: 50%; }
.lead-success-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.lead-success-message { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; }

/* ─── TOAST NOTIFICATIONS ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.82rem;
    max-width: 360px;
    animation: toastIn 0.3s ease;
}

.toast.toast-warning { border-left: 3px solid var(--yellow); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-success { border-left: 3px solid var(--green); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    margin-left: auto;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Region Incident Markers ─── */
.region-incident-marker {
    background: none !important;
    border: none !important;
}

@keyframes region-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(2.2); opacity: 0; }
}

/* ======================================================
   RESPONSIVE BREAKPOINTS
   ====================================================== */

/* === LARGE TABLET (1200px) === */
@media (max-width: 1200px) {
    .content-with-sidebar,
    .main-layout { grid-template-columns: 1fr 320px; }
    .bottom-grid { grid-template-columns: 1fr; }
    .kpi-strip { grid-template-columns: repeat(3, 1fr); }
}

/* === TABLET (1024px) === */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }

    .incidents-sidebar {
        position: static;
        max-height: 300px;
    }

    .controls-bar {
        padding: 10px 16px;
    }

    .dash-main { padding: 12px 16px; }

    .filter-pills { max-width: 400px; }
}

/* === SMALL TABLET (900px) === */
@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .category-pills { display: none; }
    .search-box { width: 160px; }
}

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

    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Ticker mobile */
    .ticker-item { padding: 3px 12px; font-size: 0.68rem; gap: 6px; }
    .ticker-dot { width: 6px; height: 6px; }
    .ticker-change { font-size: 0.55rem; padding: 1px 4px; }
    .ticker-status { font-size: 0.55rem; }

    /* Header */
    .dash-header {
        padding: 8px 12px;
        height: auto;
        gap: 6px;
        flex-wrap: wrap;
    }

    .dash-header-left {
        flex: 0 0 auto;
        gap: 6px;
    }

    .dash-logo-icon { width: 26px; height: 26px; font-size: 0.85rem; }
    .dash-logo-text { font-size: 0.9rem; }

    .dash-header-right {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
    }

    .stats-bar {
        order: 10;
        width: 100%;
        justify-content: space-evenly;
        gap: 6px;
        padding: 6px 10px;
        border-radius: var(--radius-sm);
    }

    .stat-value { font-size: 0.85rem; }
    .stat-label { font-size: 0.58rem; letter-spacing: 0.3px; }
    .stat-divider { height: 20px; }

    .btn-alert-text { display: none; }
    .btn-alert-header {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    .dash-user-link {
        font-size: 0.75rem;
        padding: 5px 8px;
    }

    /* Hero banner */
    .hero-banner {
        padding: 10px 12px;
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .hero-content {
        gap: 8px;
        flex-wrap: wrap;
    }

    .hero-icon { width: 18px; height: 18px; font-size: 0.6rem; }
    .hero-text { font-size: 0.78rem; }
    .hero-problems { margin-left: 0; flex-wrap: wrap; gap: 6px; }
    .hero-problem-item { font-size: 0.65rem; padding: 2px 8px; }
    .hero-updated { font-size: 0.65rem; align-self: flex-end; }

    /* Controls bar */
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }

    .controls-left {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .controls-right {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .view-toggle {
        align-self: flex-start;
    }

    .filter-pills {
        max-width: 100%;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .pill {
        font-size: 0.68rem;
        padding: 5px 10px;
        flex-shrink: 0;
    }

    .status-filter {
        align-self: flex-start;
        overflow: visible;
    }

    .status-btn {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .search-wrapper {
        min-width: unset;
        width: 100%;
    }

    .search-input {
        font-size: 16px;
        padding: 10px 10px 10px 34px;
    }

    /* Main content */
    .dash-main {
        padding: 10px 12px;
        gap: 14px;
    }

    .content-with-sidebar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Incidents sidebar */
    .incidents-sidebar {
        position: static;
        max-height: 280px;
        border-radius: var(--radius-sm);
        order: -1;
    }

    .incidents-sidebar-header { padding: 10px 12px; }
    .incidents-sidebar-empty { padding: 20px 12px; }
    .sidebar-cta { margin: 6px; padding: 8px; font-size: 0.78rem; }

    /* Category groups */
    .category-group { border-radius: var(--radius-sm); }
    .category-group-header { padding: 10px 12px; gap: 8px; }
    .category-group-icon { width: 28px; height: 28px; font-size: 0.9rem; }
    .category-group-name { font-size: 0.82rem; }
    .category-group-stats { font-size: 0.7rem; gap: 6px; }
    .category-cards { padding: 0 6px 6px; }

    /* Service cards */
    .svc-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .svc-card-logo,
    .svc-card-logo-placeholder {
        width: 24px;
        height: 24px;
        border-radius: 5px;
    }
    .svc-card-logo-placeholder { font-size: 0.6rem; }

    .svc-card-name { font-size: 0.78rem; }
    .svc-card-sub { font-size: 0.62rem; gap: 4px; }
    .svc-card-arrow { display: none; }
    .svc-card-incident-tag { font-size: 0.6rem; padding: 2px 5px; }

    /* Swap dots -> compact bar on mobile */
    .svc-card-comps--dots { display: none; }
    .svc-card-comps--bar { display: flex; gap: 4px; align-items: center; }

    .status-dot { width: 7px; height: 7px; }
    .status-text { font-size: 0.68rem; }

    .svc-card-right { gap: 6px; }

    /* Incident cards */
    .incident-card { padding: 10px; }

    /* KPI */
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .bottom-section { padding: 16px 12px; }

    /* CTA banner */
    .cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 14px 12px;
        gap: 12px;
        margin: 0 12px 16px;
        border-radius: var(--radius-sm);
    }

    .cta-left,
    .cta-banner-left {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .cta-banner-text,
    .cta-text { text-align: center; }
    .cta-banner-text strong,
    .cta-text strong { font-size: 0.82rem; }
    .cta-banner-text span,
    .cta-text span { font-size: 0.72rem; display: block; margin-top: 2px; }
    .cta-btn,
    .cta-banner-btn { width: 100%; text-align: center; padding: 10px 16px; }

    /* Map */
    #dashMap { height: 55vh; min-height: 260px; }
    .map-container-full { border-radius: 0; }

    /* Lead modal */
    .lead-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100%;
        margin: 0;
    }

    .lead-modal-header { padding: 12px 14px; }
    .lead-modal-header h2 { font-size: 1rem; }
    .lead-modal-body { padding: 12px 14px; }
    .lead-section h4 { font-size: 0.85rem; }
    .lead-services { grid-template-columns: 1fr; }
    .lead-input { font-size: 16px; padding: 10px 12px; }
    .lead-submit { font-size: 0.9rem; padding: 12px; }

    .lead-phone-input { flex-wrap: nowrap; }
    .lead-country-btn { padding: 8px 6px; font-size: 0.8rem; }

    .lead-otp-container { gap: 6px; justify-content: center; }
    .lead-otp-input {
        width: 38px;
        height: 46px;
        font-size: 1.2rem;
    }

    /* Service popup */
    .svc-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .svc-popup {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: 0;
    }

    .svc-popup-header { padding: 14px 16px; gap: 10px; }
    .svc-popup-logo { width: 32px; height: 32px; }
    .svc-popup-title { font-size: 0.95rem; }

    /* Resolved section */
    .resolved-header {
        padding: 12px 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .resolved-filters { gap: 4px; }
    .resolved-filter-btn { font-size: 0.72rem; padding: 4px 10px; }

    /* Footer */
    .dash-footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 14px 12px;
        font-size: 0.72rem;
    }

    .footer-services-count { font-size: 0.68rem; }

    /* Toasts */
    .toast-container {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .toast { font-size: 0.8rem; padding: 10px 12px; }

    /* Pill more dropdown */
    .pill-more-dropdown {
        left: auto;
        right: 0;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Ranking */
    .ranking-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .ranking-controls {
        width: 100%;
        justify-content: space-between;
    }
    .ranking-summary { flex-wrap: wrap; }
    .ranking-stat { min-width: 50%; }
    .ranking-item { padding: 10px 14px; gap: 8px; }
    .ranking-stats { gap: 6px; }
    .ranking-badge.downtime { display: none; }
}

/* === SMALL MOBILE (600px) === */
@media (max-width: 600px) {
    .topbar,
    .dash-header { padding: 0 12px; }
    .nav-links { display: none; }
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .bottom-section { padding: 16px 12px; }
    .cta-banner { margin: 0 12px 16px; flex-direction: column; gap: 12px; text-align: center; }
}

/* === EXTRA SMALL MOBILE (480px) === */
@media (max-width: 480px) {

    .dash-header { padding: 6px 8px; }
    .dash-logo-text { font-size: 0.85rem; }
    .dash-logo-icon { width: 22px; height: 22px; font-size: 0.8rem; }

    .stats-bar {
        gap: 4px;
        padding: 4px 6px;
    }
    .stat-value { font-size: 0.78rem; }
    .stat-label { font-size: 0.5rem; }
    .stat-divider { height: 16px; }

    .hero-banner { padding: 8px 10px; }
    .hero-text { font-size: 0.75rem; }
    .hero-icon { width: 16px; height: 16px; font-size: 0.55rem; }
    .hero-problem-item { font-size: 0.62rem; padding: 2px 6px; }

    .controls-bar { padding: 8px; gap: 8px; }
    .pill { font-size: 0.65rem; padding: 3px 8px; }
    .view-btn { font-size: 0.7rem; padding: 5px 8px; }
    .view-btn-icon { font-size: 0.85rem; }

    .dash-main { padding: 6px 8px; gap: 10px; }

    .category-group-header { padding: 8px 10px; }
    .category-group-icon { width: 24px; height: 24px; font-size: 0.8rem; }
    .category-group-name { font-size: 0.78rem; }
    .category-group-stats { font-size: 0.65rem; }

    .category-cards { padding: 0 4px 4px; }
    .svc-card { padding: 6px 8px; gap: 6px; }
    .svc-card-logo,
    .svc-card-logo-placeholder { width: 22px; height: 22px; }
    .svc-card-name { font-size: 0.75rem; }
    .svc-card-sub { font-size: 0.6rem; }
    .status-dot { width: 6px; height: 6px; }
    .status-text { font-size: 0.6rem; }

    .content-with-sidebar { min-height: 250px; }

    .incidents-sidebar { max-height: 220px; }
    .incidents-sidebar-header { padding: 8px 10px; }

    .cta-banner { padding: 10px 8px; }

    .lead-otp-input { width: 34px; height: 42px; font-size: 1.1rem; }
    .lead-otp-container { gap: 4px; }

    .svc-popup {
        max-height: 90vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .footer-left { flex-direction: column; gap: 2px; }
    .footer-sep { display: none; }
}
