/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Root variables ───────────────────────────────────────────────────────── */
:root {
    --accent:        #ff8c00;
    --accent-dim:    rgba(255,140,0,0.10);
    --accent-border: rgba(255,140,0,0.30);
    --border:        rgba(255,255,255,0.08);
    --border-hover:  rgba(255,255,255,0.14);
    --card-bg:       #161616;
    --text-muted:    rgba(255,255,255,0.45);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: 200px;
    min-width: 200px;
    background-color: #111318;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
}

.sidebar-hr {
    border-color: var(--border);
    margin: 0 16px 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    color: rgba(255,255,255,0.50);
    font-size: 0.98rem;
    font-weight: 500;
    user-select: none;
}

.sidebar-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}

.sidebar-item.active {
    background-color: var(--accent-dim);
    color: #ffffff;
    font-weight: 600;
}

.sidebar-item.active .sidebar-icon {
    opacity: 1;
}

.sidebar-icon {
    font-size: 1rem;
    color: rgba(255,255,255,0.40);
    flex-shrink: 0;
    transition: color 0.15s;
}

.sidebar-item:hover .sidebar-icon {
    color: rgba(255,255,255,0.80);
}

.sidebar-item.active .sidebar-icon {
    color: var(--accent);
}

.sidebar-label {
    flex: 1;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #0d0d0d !important;
    color: #ffffff !important;
}

/* Subtle ambient gradient in the background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 45% at 10% 0%,  rgba(80,50,160,0.14) 0%, transparent 55%),
        radial-gradient(ellipse 55% 35% at 90% 5%,  rgba(30,60,180,0.10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.navbar-brand {
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
}

/* ── Store tabs ───────────────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom-color: var(--border) !important;
    gap: 2px;
}

.nav-tabs .nav-link {
    color: var(--text-muted) !important;
    border-bottom: 2px solid transparent !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    border-radius: 0 !important;
    transition: color 0.15s, background-color 0.15s !important;
    letter-spacing: 0.01em;
}

.nav-tabs .nav-link:hover {
    color: rgba(255,255,255,0.80) !important;
    background-color: rgba(255,255,255,0.04) !important;
    border-color: transparent transparent transparent !important;
}

.nav-tabs .nav-link.active {
    background-color: var(--accent-dim) !important;
    border-color: transparent transparent transparent !important;
    border-bottom: 2px solid var(--accent) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* ── Dashboard selector buttons ───────────────────────────────────────────── */
.btn-secondary {
    background-color: transparent !important;
    border-color: var(--border) !important;
    color: rgba(255,255,255,0.60) !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    transition: all 0.15s !important;
    letter-spacing: 0.01em;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: rgba(255,255,255,0.06) !important;
    border-color: var(--border-hover) !important;
    color: rgba(255,255,255,0.90) !important;
    box-shadow: none !important;
}

.btn-warning {
    background-color: var(--accent-dim) !important;
    border-color: var(--accent-border) !important;
    color: var(--accent) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: all 0.15s !important;
    letter-spacing: 0.01em;
}

.btn-warning:hover, .btn-warning:focus {
    background-color: rgba(255,140,0,0.16) !important;
    border-color: rgba(255,140,0,0.45) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
}

/* ── Controls label ───────────────────────────────────────────────────────── */
label {
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
}

/* ── Radio items (Filter by) ─────────────────────────────────────────────── */
.form-check-label {
    font-size: 0.83rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: rgba(255,255,255,0.75) !important;
}

.form-check-input:checked {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.form-check-input {
    border-color: var(--border-hover) !important;
}

/* ── Chart card ───────────────────────────────────────────────────────────── */
.card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    position: relative;
    overflow: hidden;
}

/* Orange glow line at top of card */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-border) 35%, transparent 100%);
    z-index: 1;
}

.card-body {
    padding: 20px 24px !important;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,0.10); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.18); }

/* ── Date-mode toggle switch ──────────────────────────────────────────────── */
.date-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 3px;
    cursor: pointer;
    user-select: none;
    gap: 2px;
}

.toggle-option {
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.40);
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.toggle-option.toggle-active {
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

/* ── Date Picker text ─────────────────────────────────────────────────────── */
input#date-picker,
span.dash-dropdown-value-item,
.dash-datepicker-input,
.dash-input-element {
    color: black !important;
}

/* ── GECs calls chart — fills remaining screen height on desktop ──────────── */
@media (min-width: 1024px) {
    .gecs-calls-card,
    .gecs-team-card {
        height: calc(100vh - 300px);
        display: flex;
        flex-direction: column;
    }
    .gecs-calls-card .card-body,
    .gecs-team-card .card-body {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding-bottom: 8px;
    }
    .gecs-calls-card .dash-graph,
    .gecs-team-card .dash-graph {
        flex: 1;
        min-height: 0;
    }
    .gecs-calls-card .js-plotly-plot,
    .gecs-calls-card .plot-container,
    .gecs-calls-card .svg-container,
    .gecs-team-card .js-plotly-plot,
    .gecs-team-card .plot-container,
    .gecs-team-card .svg-container {
        height: 100% !important;
    }
}

/* ── Responsive: mobile sidebar & layout ──────────────────────────────────── */

/* Hamburger button — only visible on mobile */
#sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: rgba(255,140,0,0.12);
    border: 1px solid rgba(255,140,0,0.30);
    color: var(--accent);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.15s;
}
#sidebar-toggle:hover { background: rgba(255,140,0,0.22); }

/* Overlay behind open sidebar on mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1050;
}

/* Charts: always constrain to their containers */
.dash-graph, .js-plotly-plot { max-width: 100%; overflow: hidden; }

/* Dropdown theming */
.Select-control, .Select-menu-outer {
    background-color: #1e1e1e !important;
    border-color: var(--border) !important;
    color: white !important;
}
.Select-value-label, .Select-placeholder { color: rgba(255,255,255,0.75) !important; }

/* ── Tablet (768 – 1023px): icon-only slim sidebar ────────────────────────── */
@media (max-width: 1023px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
    }
    .sidebar-label { display: none; }
    .sidebar-logo { padding: 14px 8px 12px; justify-content: center; }
    .sidebar-logo img { height: 32px !important; max-width: 40px !important; }
    .sidebar-item { justify-content: center; padding: 10px 0; }
    .sidebar-icon { font-size: 1.25rem; }
}

/* ── Mobile (≤ 767px): off-canvas drawer ──────────────────────────────────── */
@media (max-width: 767px) {

    #sidebar-toggle { display: flex; }

    /* Sidebar slides in from left */
    .sidebar {
        position: fixed;
        top: 0;
        left: -220px;
        height: 100%;
        width: 200px !important;
        min-width: 200px !important;
        z-index: 1060;
        transition: left 0.25s cubic-bezier(.4,0,.2,1);
        box-shadow: 4px 0 24px rgba(0,0,0,0.6);
    }
    .sidebar.sidebar-open { left: 0; }
    .sidebar-label { display: block; }
    .sidebar-logo { padding: 20px 16px 16px; justify-content: flex-start; }
    .sidebar-logo img { height: 44px !important; max-width: 160px !important; }
    .sidebar-item { justify-content: flex-start; padding: 9px 12px; }
    .sidebar-icon { font-size: 1rem; }

    #sidebar-overlay.sidebar-open { display: block; }

    /* Push main content down past the hamburger */
    #main-content { padding-top: 60px; }

    /* Smaller card padding */
    .card-body { padding: 12px 14px !important; }

    /* Nav tabs: horizontal scroll, no wrap */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-link {
        font-size: 0.78rem !important;
        padding: 7px 10px !important;
        white-space: nowrap;
    }

    /* Dashboard buttons row: wrap */
    #dashboard-buttons { display: flex; flex-wrap: wrap; gap: 4px; }

    /* Plotly charts: give them minimum height */
    .js-plotly-plot { min-height: 180px; }
}
