/* Modern Design System - Professional Dashboard Styling */

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

/* CSS Variables for consistent theming */
:root {
    /* Incode Brand Colors */
    --incode-blue: #006AFF;
    --incode-black: #101010;
    --incode-white: #FFFFFF;
    --incode-offwhite: #EEEEEE;
    --incode-green: #189F60;
    --incode-cherry: #FF5A5F;
    --incode-tangerine: #FF9900;
    --incode-purple: #820AD1;
    --incode-blue-secondary: #307FE2;

    /* Primary Colors - Mapped to Incode Blue */
    --primary-50: #e6f0ff;
    --primary-100: #cce0ff;
    --primary-200: #99c2ff;
    --primary-500: #006AFF;  /* Incode Blue */
    --primary-600: #0055CC;  /* Darker Incode Blue */
    --primary-700: #004099;
    --primary-900: #002b66;

    /* Neutral Colors - Light Theme */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #101010;  /* Incode Black */

    /* Success/Error/Warning Colors - Incode Palette */
    --success-500: #189F60;  /* Incode Green */
    --success-100: #d1fae5;
    --error-500: #FF5A5F;    /* Incode Cherry */
    --error-100: #fee2e2;
    --warning-500: #FF9900;  /* Incode Tangerine */
    --warning-100: #fef3c7;

    /* Background Colors - Light Theme */
    --bg-primary: #FFFFFF;   /* Incode White */
    --bg-secondary: #f8fafc;
    --bg-tertiary: #EEEEEE;  /* Incode Off White */
    --text-primary: #101010; /* Incode Black */
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark Theme Variables */
.theme-dark {
    /* Neutral Colors - Dark Theme (less intense) */
    --neutral-50: #0f172a;
    --neutral-100: #1e293b;
    --neutral-200: #334155;
    --neutral-300: #475569;
    --neutral-400: #64748b;
    --neutral-500: #94a3b8;
    --neutral-600: #cbd5e1;
    --neutral-700: #e2e8f0;
    --neutral-800: #f1f5f9;
    --neutral-900: #f8fafc;
    
    /* Background Colors - Dark Theme (less intense) */
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #94a3b8;
    --border-color: #475569;
    --shadow-color: rgba(0, 0, 0, 0.4);
}
    
    /* Spacing Scale (8px grid) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    
    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main container theme support */
#main-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header theme support */
#header-container {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--neutral-200) 100%);
    transition: background 0.3s ease;
}

/* Modern KPI Card styling */
.kpi-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    width: 24%;
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -2px var(--shadow-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Enhanced dark theme shadows */
.theme-dark .kpi-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -4px var(--shadow-color);
    border-color: var(--primary-200);
}

/* Enhanced dark theme hover effects */
.theme-dark .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-500);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-700);
    margin-top: var(--space-2);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* Text Color Utilities */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-tertiary {
    color: var(--text-tertiary) !important;
}

/* Internal Analytics Home */
.ia-home-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ia-home-hero {
    padding: 28px 32px;
    background:
        radial-gradient(circle at top right, rgba(0, 106, 255, 0.12), transparent 34%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.ia-home-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-600);
    margin-bottom: 8px;
}

.ia-home-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ia-home-subtitle {
    margin: 12px 0 0;
    max-width: 760px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.6;
}

.ia-home-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.ia-home-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 106, 255, 0.08);
    border: 1px solid rgba(0, 106, 255, 0.14);
    color: var(--primary-600);
    font-size: 0.8rem;
    font-weight: 600;
}

.ia-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.ia-home-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.ia-home-status-row {
    min-height: 24px;
}

.ia-home-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 153, 0, 0.12);
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ia-home-card-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.02em;
}

.ia-home-card-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.93rem;
    min-height: 72px;
}

.ia-home-card-button {
    width: fit-content;
    min-width: 120px;
    margin-top: auto;
    border-radius: 10px;
}

.ia-home-card-link,
.ia-home-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 120px;
    padding: 10px 16px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.ia-home-secondary-link {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.ia-home-section-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: none;
}

.ia-home-section-copy {
    margin: 10px 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.93rem;
}

.ia-home-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.ia-home-status-panel {
    padding: 22px 24px;
}

.ia-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.ia-cs-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ia-cs-grid-top {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 2.2fr);
    gap: 16px;
}

.ia-cs-grid-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px;
}

.ia-section-title {
    margin: 0 0 14px 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.ia-cs-table-hint {
    margin: -6px 0 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ia-funnel-stage-input {
    width: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ia-funnel-overview-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
}

.ia-funnel-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 16px;
}

.ia-funnel-coverage-card {
    padding: 20px;
    background: linear-gradient(160deg, rgba(15, 91, 216, 0.12), rgba(15, 91, 216, 0.02));
    border: 1px solid rgba(15, 91, 216, 0.18);
}

.ia-funnel-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ia-funnel-chip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.ia-funnel-rank {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 91, 216, 0.12);
    color: #0f5bd8;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ia-funnel-chip-title,
.ia-funnel-module-title {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.ia-funnel-chip-meta,
.ia-funnel-module-meta {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ia-funnel-module-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ia-funnel-module-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.ia-funnel-module-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.ia-funnel-module-metrics {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ia-funnel-module-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ia-funnel-module-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .ia-cs-grid-top,
    .ia-cs-grid-bottom,
    .ia-funnel-overview-grid,
    .ia-funnel-main-grid {
        grid-template-columns: 1fr;
    }

    .ia-funnel-module-row {
        grid-template-columns: 1fr;
    }
}

/* Modern Typography */
h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: -0.025em;
    line-height: 1.2;
    transition: color 0.3s ease;
}

h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: var(--space-6);
    margin-bottom: var(--space-4);
    letter-spacing: -0.025em;
    transition: color 0.3s ease;
}

h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: var(--space-4);
    transition: color 0.3s ease;
}

/* Modern Button styling */
button {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Modern Filter section styling */
.filter-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    transition: all 0.3s ease;
}

/* Enhanced dark theme filter section */
.theme-dark .filter-section {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

/* Modern form controls - Dropdown styling with dark mode support */
.Select-control {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.Select-control:hover {
    border-color: var(--primary-500) !important;
    box-shadow: var(--shadow-md) !important;
}

.Select-control.is-focused {
    border-color: var(--primary-500) !important;
    box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.1) !important;
}

.Select-placeholder {
    color: var(--text-tertiary) !important;
}

.Select-value {
    color: var(--text-primary) !important;
}

.Select-input > input {
    color: var(--text-primary) !important;
}

.Select-menu-outer {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    margin-top: var(--space-1) !important;
}

.Select-menu {
    background-color: var(--bg-primary) !important;
}

.Select-option {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    padding: var(--space-3) var(--space-4) !important;
    font-size: 0.875rem !important;
    transition: background-color 0.15s ease !important;
}

.Select-option:hover {
    background-color: var(--bg-tertiary) !important;
}

.Select-option.is-selected {
    background-color: rgba(0, 106, 255, 0.1) !important;
    color: var(--primary-500) !important;
    font-weight: 500 !important;
}

.Select-option.is-focused {
    background-color: var(--bg-tertiary) !important;
}

/* Dash Dropdown (newer Dash components) */
.dash-dropdown {
    background-color: var(--bg-primary) !important;
}

.dash-dropdown .Select-control {
    background-color: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dash-dropdown .Select-placeholder,
.dash-dropdown .Select-value-label {
    color: var(--text-tertiary) !important;
}

/* Modern Table styling */
.dash-table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    overflow: hidden;
    margin-bottom: var(--space-6);
    transition: all 0.3s ease;
}

/* Enhanced dark theme table styling */
.theme-dark .dash-table-container {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner {
    border: none !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    font-weight: 600;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--neutral-100) 100%);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color) !important;
    padding: var(--space-4) var(--space-5) !important;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
    padding: var(--space-4) var(--space-5) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

/* Row hover effect for tables */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover {
    background-color: var(--primary-50) !important;
}

/* First row styling (Grand Total) */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:first-child {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%) !important;
    color: var(--primary-800) !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:first-child td {
    border-bottom: 2px solid var(--primary-200) !important;
}

/* Modern chart container */
.chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    transition: all 0.3s ease;
}

/* Enhanced dark theme chart container */
.theme-dark .chart-container {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

/* Table containers with modern spacing */
.table-container {
    width: 49%;
    display: inline-block;
    vertical-align: top;
    margin-bottom: var(--space-6);
}

.table-container:first-child {
    margin-right: 2%;
}

/* Modern tab styling */
.dash-tabs {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    margin-bottom: var(--space-6);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Enhanced dark theme tab styling */
.theme-dark .dash-tabs {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.dash-tabs .dash-tab {
    background: transparent;
    border: none;
    padding: var(--space-4) var(--space-6);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid transparent;
}

.dash-tabs .dash-tab:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.dash-tabs .dash-tab--selected {
    background-color: var(--primary-50);
    color: var(--primary-700);
    border-bottom-color: var(--primary-500);
    font-weight: 600;
}

/* Loading spinner styling */
.dash-loading {
    color: var(--primary-500) !important;
}

/* Status text styling */
.status-text {
    color: var(--neutral-600);
    font-size: 0.875rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .kpi-card {
        width: 49%;
        margin-bottom: var(--space-4);
    }
    
    .table-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: var(--space-6);
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .kpi-card {
        width: 100%;
        margin-bottom: var(--space-4);
    }
    
    .filter-section {
        padding: var(--space-4);
    }
    
    .dash-tabs .dash-tab {
        padding: var(--space-3) var(--space-4);
        font-size: 0.8rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--space-2);
    }
    
    .kpi-card {
        padding: var(--space-4);
    }
    
    .filter-section {
        padding: var(--space-3);
    }
    
    .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
    .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
        padding: var(--space-2) var(--space-3) !important;
        font-size: 0.75rem;
    }
}

/* Tab content styling */
.tab-content {
    padding-top: var(--space-2);
}

/* Ensure consistent spacing in tab content */
.tab-content > div {
    margin-bottom: 0;
}

/* ==================== DASHBOARD COMPONENT CLASSES ==================== */

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--neutral-200) 100%);
    transition: background 0.3s ease;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    padding: 20px;
    transition: all 0.3s ease;
}

/* Filter Container */
.filter-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 var(--shadow-color);
    transition: all 0.3s ease;
}

.theme-dark .filter-container {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

/* Filter Label */
.filter-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

/* Section Title */
.section-title {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Status Footer */
.status-footer {
    margin-top: 32px;
    margin-bottom: 16px;
}

.status-toggle {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-toggle-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.status-collapse {
    padding: 16px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--border-color);
    border-top: none;
    transition: all 0.3s ease;
}

/* User Info */
.user-info {
    margin-right: 12px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

/* Logout Link */
.logout-link {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.theme-dark .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-dark .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Beta Badge */
.beta-badge {
    background: #FF9900;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 12px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Disclaimer Text */
.disclaimer-text {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 8px;
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

/* Custom Date Container */
.custom-date-container {
    margin-top: 16px;
}

/* Data Status Display */
.data-status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

/* Additional modern touches */
.dash-graph {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Custom scrollbar for webkit browsers */
:::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

:::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
}

:::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: var(--radius-sm);
}

:::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

/* Focus states for accessibility */
button:focus,
.Select-control:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Animation for smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Additional dark theme enhancements */
.theme-dark {
    /* Less intense dark background */
    background-color: var(--bg-secondary) !important;
}

.theme-dark #main-container {
    background-color: var(--bg-secondary) !important;
}

/* Enhanced dark theme for all cards and containers */
.theme-dark .dash-table-container,
.theme-dark .chart-container,
.theme-dark .dash-tabs,
.theme-dark .filter-section {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

/* Dark theme status section */
.theme-dark #data-status {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-tertiary) !important;
}

/* Dark theme for Plotly charts */
.theme-dark .dash-graph {
    background: var(--bg-primary) !important;
    border-radius: var(--radius-lg);
}

/* Plotly dark theme styling */
.theme-dark .js-plotly-plot .plotly {
    background: var(--bg-primary) !important;
}

.theme-dark .js-plotly-plot .plotly .main-svg {
    background: var(--bg-primary) !important;
}

.theme-dark .js-plotly-plot .bg {
    fill: var(--bg-primary) !important;
}

.theme-dark .js-plotly-plot text {
    fill: var(--text-primary) !important;
}

.theme-dark .js-plotly-plot .xgrid,
.theme-dark .js-plotly-plot .ygrid {
    stroke: var(--border-color) !important;
}

/* Ensure graphs are visible */
.dash-graph,
.js-plotly-plot {
    background: transparent !important;
}
