#teamPrediction {
    color: var(--text-1);
    margin-top: 6px;
}
[data-theme="light"] #teamPrediction { color: #6c757d; }
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}
/* Allow vertical scroll on larger screens to avoid chart clipping */
@media (min-width: 992px) {
    body, html {
        overflow-y: auto;
        /* Prevent content shift when scrollbar appears */
        scrollbar-gutter: stable;
    }
}

/* Scale base font size on larger screens to emulate ~112.5% zoom */
@media (min-width: 1200px) {
    html { font-size: 112.5%; } /* 16px -> 18px */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', sans-serif;
    color: #FF4500;
    font-weight: 700;
    line-height: 1.2;
}
h1 { font-size: 2.5em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.75em;}
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

.nav-tabs .nav-link {
    font-size: 0.9rem; /* slightly larger for readability */
    color: #054BC5;
}

.tab-content > .tab-pane {
    padding: 16px;
}

/* Responsive site container for cleaner layout bounds */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 1400px) {
    .site-container { max-width: 1320px; }
}

/* Constrain top-level tabs and content without affecting nested panes */
body > .nav.nav-tabs,
body > .tab-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 1400px) {
    body > .nav.nav-tabs,
    body > .tab-content { max-width: 1320px; }
}

:root {
    --chart-vh-offset: 120px;
}

/* Light theme overrides */
[data-theme="light"] {
    --bg-0: #f5f7fb;
    --bg-1: #eef2f9;
    --bg-2: #ffffff;
    --text-0: #0b1020;
    --text-1: #2a3553;
    --accent-0: #3a82ff;
    --accent-1: #7c3cff;
    --accent-2: #12b886;
    --danger-0: #d64045;

    --surface: rgba(0,0,0,0.06);
    --surface-strong: rgba(0,0,0,0.10);
    --border: rgba(0,0,0,0.16);
    --shadow-soft: 0 10px 28px rgba(20, 28, 54, 0.12);
    --glow-cyan: 0 0 18px rgba(58, 130, 255, 0.35);
    --glow-violet: 0 0 18px rgba(124, 60, 255, 0.25);
}

/* Floating theme toggle button */
.theme-toggle-floating {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    padding: 6px 10px;
}

.grid-toggle-floating {
    position: fixed;
    top: 52px;
    right: 12px;
    z-index: 10000;
    padding: 6px 10px;
}

/* Animated grid background overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 28px, var(--grid-line, rgba(102,225,255,0.12)) 29px 30px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 28px, var(--grid-line, rgba(102,225,255,0.12)) 29px 30px);
    background-size: 100% 100%;
    background-position: 0 0;
}

[data-grid="on"] body::before {
    opacity: 0.12;
    animation: gridDrift 32s linear infinite;
}

@keyframes gridDrift {
    0%   { background-position: 0 0; }
    50%  { background-position: 60px 60px; }
    100% { background-position: 0 0; }
}

/* Light theme grid line color override */
[data-theme="light"] {
    --grid-line: rgba(58,130,255,0.12);
}

/* Classic light overrides to resemble Bootstrap-like look */
[data-theme="light"] body {
    background: #ffffff;
    color: #212529; /* Bootstrap body color */
}
[data-theme="light"] .chart-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
[data-theme="light"] .chart-header { border-bottom-color: #e9ecef; }
[data-theme="light"] .chart-footnote { color: #495057; }
[data-theme="light"] .nav-tabs { border-bottom-color: #dee2e6; }
[data-theme="light"] .nav-tabs .nav-link {
    color: #495057;
    background: transparent;
}
[data-theme="light"] .nav-tabs .nav-link:hover { color: #212529; }
[data-theme="light"] .nav-tabs .nav-link.active {
    color: #0d6efd; /* Bootstrap primary */
    background: #ffffff;
    box-shadow: inset 0 -2px 0 #0d6efd;
}
[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: #ced4da;
    color: #212529;
}
[data-theme="light"] .input-group-text {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #212529;
}
[data-theme="light"] .form-control::placeholder { color: #6c757d; }
[data-theme="light"] .btn-primary { box-shadow: none; }
[data-theme="light"] .btn {
    background: #ffffff;
    border-color: #dee2e6;
}
[data-theme="light"] .btn.btn-primary,
[data-theme="light"] .btn.btn-info {
    color: #ffffff;
    background: linear-gradient(90deg, var(--accent-0), var(--accent-1));
    border-color: #0d6efd; /* ensure contrast if gradient not supported */
}
[data-theme="light"] .btn.btn-info {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-0));
    border-color: #0dcaf0;
}
[data-theme="light"] #spinner-overlay {
    background: rgba(255,255,255,0.75);
}

.chart-container {
    width: 100%;
    height: calc(100vh - var(--chart-vh-offset));
    /* Remove min-height to avoid forcing page overflow */
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Let the chart content grow to fill available vertical space */
.chart-container > .chart-header { flex: 0 0 auto; }
.chart-container > .chart-footnote { flex: 0 0 auto; }
.chart-container > div[id] {
    flex: 1 1 auto;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.chart-footnote {
    font-size: 0.9rem; /* ~18px on large screens */
    color: #666;
    margin-top: 6px;
}

.loading-text {
    opacity: 0;
    animation: fadeIn 160ms ease-in forwards;
}

.loading-overlay {
    position: absolute;
    top: 0; left: 0;
    right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease-in-out;
}

.loading-overlay.visible {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 576px) {
    .nav-tabs {
        border-bottom: 0;
    }

    .nav-tabs .nav-link.active {
        border-color: transparent;
    }

    .chart-header {
        flex-direction: column;
        align-items: center; 
    }

    .checkbox-container {
        align-self: flex-start;
        margin-bottom: 10px;
    }
}

.chart-header {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px; /* uniform spacing between header controls */
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin: 0; /* rely on flex gap for spacing */
}

.weekday-checkbox {
    margin-right: 5px;
}

.average-tabs,
.average-tabs-2024 {
    display: flex;
    justify-content: center;
}

#spinner-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  z-index: 9999;
}

.spinner {
  border: 8px solid #eee;
  border-top: 8px solid #222;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}
/* Ensure daterangepicker overlays above Bootstrap components */
.daterangepicker {
    z-index: 1080 !important; /* Above modals/tooltips but below offcanvas */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === Futuristic UI Theme (v20260205e) === */
:root {
    /* Core palette */
    --bg-0: #0b1020;           /* deep space */
    --bg-1: #111936;           /* night blue */
    --bg-2: #0f1430;           /* panel base */
    --text-0: #e6f0ff;         /* primary text */
    --text-1: #b8c7e6;         /* secondary text */
    --accent-0: #66e1ff;       /* cyan neon */
    --accent-1: #9b7bff;       /* violet neon */
    --accent-2: #27f3a3;       /* mint neon */
    --danger-0: #ff5b6e;       /* warm alert */

    /* Surfaces & effects */
    --surface: rgba(255,255,255,0.06);
    --surface-strong: rgba(255,255,255,0.12);
    --border: rgba(255,255,255,0.14);
    --shadow-soft: 0 6px 24px rgba(6, 10, 30, 0.45);
    --glow-cyan: 0 0 22px rgba(102, 225, 255, 0.45);
    --glow-violet: 0 0 22px rgba(155, 123, 255, 0.35);

    /* Controls */
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    /* Glass & gloss controls */
    --glass-blur: 14px;
    --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    --glass-border-1: rgba(255,255,255,0.22);
    --glass-border-2: rgba(255,255,255,0.08);
    --gloss-highlight: inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Background: layered gradient with subtle moving sheen */
body {
    background: radial-gradient(1200px 800px at 10% 10%, rgba(102,225,255,0.08), transparent 40%),
                            radial-gradient(1000px 700px at 90% 20%, rgba(155,123,255,0.08), transparent 45%),
                            linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
    color: var(--text-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle vignette for cleaner focus */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(1100px 600px at 50% 0%, rgba(0,0,0,0.25), transparent 40%);
    opacity: 0.22;
}

/* Headings: sleek neon accent */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-0);
    letter-spacing: 0.4px;
}
h2 {
    background: linear-gradient(90deg, var(--accent-0), var(--accent-1));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav tabs: glassy segments with neon underline */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(120%) blur(calc(var(--glass-blur) - 6px));
    -webkit-backdrop-filter: saturate(120%) blur(calc(var(--glass-blur) - 6px));
}
/* Team input + dropdown styling */
.input-group #teamInput {
    height: 36px;
    padding: 6px 10px;
}
[data-theme] .input-group { position: relative; }

#teamGhost {
    position: absolute;
    left: 12px; /* initial, updated via JS */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-1);
    opacity: 0.6;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 48px); /* avoid overlapping dropdown button */
    overflow: hidden;
    text-overflow: ellipsis;
    font: inherit;
}

#teamMeasure {
    position: absolute;
    left: -9999px;
    top: -9999px;
    white-space: nowrap;
    font: inherit;
}

[data-theme="light"] #teamGhost { color: #6c757d; opacity: 0.7; }

#teamInputDropdown {
    height: 36px;
    padding: 4px 10px;
    border-left: 0;
    color: var(--text-0);
    background: var(--surface);
    border-color: var(--border);
}
#teamInputDropdown:hover {
    background: var(--surface-strong);
}
#teamInputDropdown:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 225, 255, 0.25);
}

[data-theme="light"] #teamInputDropdown {
    color: #212529;
    background: #f8f9fa;
    border-color: #ced4da;
}
[data-theme="light"] #teamInputDropdown:hover { background: #e9ecef; }
.nav-tabs .nav-link {
    color: var(--text-0);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--glass-bg);
    transition: color 200ms ease, box-shadow 200ms ease;
    box-shadow: var(--gloss-highlight);
}
.nav-tabs .nav-link:hover {
    color: var(--text-0);
    box-shadow: inset 0 -2px 0 var(--accent-1), var(--glow-violet);
}
.nav-tabs .nav-link.active {
    color: var(--accent-0);
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
    box-shadow: inset 0 -2px 0 var(--accent-0), var(--glow-cyan);
}

/* Panels: glassmorphism cards for charts */
.chart-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: saturate(130%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(130%) blur(var(--glass-blur));
    padding: 14px 16px;
    border-image: linear-gradient(180deg, var(--glass-border-1), var(--glass-border-2)) 1;
}
.chart-header {
    border-bottom: 1px dashed rgba(255,255,255,0.12);
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.chart-footnote {
    color: var(--text-0);
}

/* Chart panel hover sheen */
.chart-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 240ms ease;
}
.chart-container:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(6,10,30,0.55); }
.chart-container:hover::after { opacity: 0.25; }

/* Glossy ripple sweep on hover */
.chart-container::before {
    content: "";
    position: absolute;
    top: 0; left: -50%;
    width: 200%; height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.28), rgba(255,255,255,0));
    transform: translateX(-60%);
    opacity: 0;
}
.chart-container:hover::before {
    opacity: 0.18;
    animation: sheenSweep 1800ms linear;
}

/* Controls: inputs and buttons */
.form-control {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text-0);
    border-radius: var(--radius-md);
    transition: box-shadow 160ms ease, border-color 160ms ease;
    box-shadow: var(--gloss-highlight);
}
.input-group-text {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text-0);
    border-radius: var(--radius-md);
}
.date-range-input { min-width: 420px; }
.form-control::placeholder { color: #94a3c1; }
.form-control:focus {
    border-color: var(--accent-0);
    box-shadow: 0 0 0 3px rgba(102,225,255,0.25);
}

/* Responsive date input on smaller screens */
@media (max-width: 768px) {
    .date-range-input { min-width: 0; width: 100%; }
}

.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 0.03em;
    background: var(--glass-bg);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: var(--gloss-highlight);
}

/* Subtle badge for Company Average mode */
.badge-average {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
    color: #fff;
    background: linear-gradient(90deg, var(--accent-0), var(--accent-1));
    box-shadow: 0 0 12px rgba(102,225,255,0.35);
    border: 1px solid rgba(255,255,255,0.18);
    cursor: pointer;
    user-select: none;
}

/* Provide consistent spacing for grouped buttons */
.btn-group { gap: 8px; }
.row.mb-3 { align-items: center; }
.row.mb-3 .btn { margin-right: 8px; }
.row.mb-3 .btn:last-child { margin-right: 0; }

/* Button micro-interactions */
.btn { transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(90deg, var(--accent-0), var(--accent-1));
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: var(--glow-cyan), var(--gloss-highlight);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    filter: brightness(1.08) saturate(1.1);
    box-shadow: 0 0 26px rgba(102,225,255,0.6);
}
.btn-info {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-0));
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 18px rgba(39,243,163,0.4), var(--gloss-highlight);
}

/* Spinner overlay: dim space with luminous ring */
#spinner-overlay {
    background: radial-gradient(800px 520px at 50% 40%, rgba(102,225,255,0.12), rgba(155,123,255,0.10) 60%, rgba(0,0,0,0.6) 100%);
}
.spinner {
    width: 56px; height: 56px;
    border: 5px solid rgba(255,255,255,0.12);
    border-top: 5px solid var(--accent-0);
    border-right: 5px solid var(--accent-1);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    box-shadow: var(--glow-cyan);
}

/* Tab pane fade-in micro-interaction */
@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tab-content > .tab-pane.active.show { animation: panelFadeIn 240ms ease-out; }

/* Ripple sweep animation */
@keyframes sheenSweep {
    0%   { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}

/* Gentle glow sweep on primary buttons */
.btn-primary::before {
    content: "";
    position: absolute;
    top: 0; left: -50%;
    width: 200%; height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.3), rgba(255,255,255,0));
    transform: translateX(-60%);
    opacity: 0;
}
.btn-primary:hover::before {
    opacity: 0.22;
    animation: sheenSweep 1200ms linear;
}

/* Tables, canvases, charts: ensure transparent surface */
canvas, #copilot_usage, #total_active_users, #average_active_users,
#proposed_accepted_changes, #lines_code_changes, #language_usage, #editor_usage,
#language_engagement, #ide_vs_chat_adoption,
#copilot_usage_team, #average_active_users_team, #proposed_accepted_changes_team,
#lines_code_changes_team, #language_usage_team, #editor_usage_team, #language_engagement_team,
#ide_vs_chat_adoption_team, #copilot_usage2024, #average_active_users2024,
#proposed_accepted_changes2024, #lines_code_changes2024, #language_usage2024,
#editor_usage2024, #chat_usage2024 {
    background-color: transparent !important;
}

/* Custom scrollbars for desktop */
@media (min-width: 992px) {
    * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.24) rgba(255,255,255,0.08); }
    ::-webkit-scrollbar { height: 10px; width: 10px; }
    ::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 12px; }
    ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent-1), var(--accent-0)); border-radius: 12px; }
}

/* Footer link styling */
.text-center a { color: var(--accent-0); }
.text-center a:hover { color: var(--accent-1); text-decoration: underline; }

/* Accessibility: clear focus styles */
:focus-visible {
    outline: 3px solid var(--accent-0);
    outline-offset: 2px;
    border-radius: 6px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    left: 8px; top: 8px;
    z-index: 10001;
    background: var(--bg-2);
    color: var(--text-0);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }

/* Compact pill toggle group */
.toggle-group-floating {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    gap: 8px;
}
.toggle-btn {
    border-radius: 999px;
    padding: 6px 12px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .tab-content > .tab-pane.active.show { animation: none !important; }
    .chart-container:hover::before { animation: none !important; opacity: 0; }
    .btn-primary:hover::before { animation: none !important; opacity: 0; }
}

