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

/* Brand Overrides for consistency */
.bg-primary { background-color: var(--primary-color) !important; }
.text-primary { color: var(--primary-color) !important; }


:root {
    /* Professional Color Palette (Onyx & Teal) */
    --primary-color: #14b8a6;
    --primary-color-rgb: 20, 184, 166;
    --primary-hover: #0d9488;
    --secondary-color: #0f172a;
    --dark-navy: #0b0f1a;
    --success-color: #10b981;
    --info-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(20, 184, 166, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Deep Dark Mode */
body.dark-only {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-surface: #1e293b;

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);

    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #64748b;

    --border-color: #334155;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

    /* Dark mode card/hover shadows */
    --card-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.4);
    --hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --dark: #f1f5f9;
    --gray: #94a3b8;
}

/* ── KPI Cards Dark Mode ── */
body.dark-only .kpi-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--card-shadow);
}

body.dark-only .kpi-card:hover {
    background: #253248;
    border-color: var(--primary-color);
    box-shadow: var(--hover-shadow);
}

body.dark-only .kpi-label {
    color: var(--text-muted);
}

body.dark-only .kpi-number {
    color: var(--text-main);
}

body.dark-only .kpi-number.text-dark {
    color: var(--text-main) !important;
}

/* Keep colored KPI numbers vibrant in dark mode */
body.dark-only .kpi-number.text-primary { color: var(--primary-color) !important; }
body.dark-only .kpi-number.text-success { color: #34d399 !important; }
body.dark-only .kpi-number.text-danger  { color: #f87171 !important; }
body.dark-only .kpi-number.text-warning { color: #fbbf24 !important; }
body.dark-only .kpi-number.text-info    { color: #818cf8 !important; }

/* Soft badge backgrounds — slightly more opaque for contrast */
body.dark-only .bg-soft-primary { background: rgba(53, 191, 191, 0.18) !important; color: #5eead4 !important; }
body.dark-only .bg-soft-success { background: rgba(16, 185, 129, 0.18) !important; color: #34d399 !important; }
body.dark-only .bg-soft-danger  { background: rgba(239, 68, 68, 0.18) !important; color: #f87171 !important; }
body.dark-only .bg-soft-warning { background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; }
body.dark-only .bg-soft-info    { background: rgba(99, 102, 241, 0.18) !important; color: #a5b4fc !important; }

/* Icon wrapper in dark mode */
body.dark-only .kpi-icon-wrapper {
    background: rgba(53, 191, 191, 0.15);
}

/* Progress bars dark mode track */
body.dark-only .progress {
    background-color: #334155;
}

/* Badge text in dark */
body.dark-only .badge {
    border: none;
}

/* Nav tabs dark */
body.dark-only .nav-tabs .nav-link {
    color: var(--text-muted);
}
body.dark-only .nav-tabs .nav-link.active {
    color: var(--primary-color);
}

/* Nav pills dark */
body.dark-only .nav-pills-custom .nav-link {
    background: #334155;
    color: var(--text-muted);
}
body.dark-only .nav-pills-custom .nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Extra-small text */
body.dark-only .extra-small.text-muted {
    color: var(--text-muted) !important;
}

/* Loader */
body.dark-only .loader-wrapper {
    background: rgba(15, 23, 42, 0.9);
}

/* Date input */
body.dark-only input[type="date"].form-control {
    color: var(--text-muted);
}
body.dark-only .bg-light-date {
    background: #334155;
}

/* Transition hover */
body.dark-only .transition-hover:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Custom scrollbar */
body.dark-only .custom-scrollbar::-webkit-scrollbar-track {
    background: #1e293b;
}


/* Explicit dark-mode card/element overrides */
body.dark-only .card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main);
}

body.dark-only .card-header {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-main);
}

body.dark-only .card-body {
    color: var(--text-main);
}

body.dark-only .bg-white {
    background-color: var(--bg-card) !important;
}

body.dark-only .text-dark {
    color: var(--text-main) !important;
}

body.dark-only .text-muted {
    color: var(--text-muted) !important;
}

body.dark-only .border {
    border-color: var(--border-color) !important;
}

body.dark-only .table {
    color: var(--text-main);
}

body.dark-only .table thead th {
    color: var(--text-muted);
    border-color: var(--border-color);
}

body.dark-only .table tbody td {
    border-color: var(--border-color);
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Premium Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* KPI Cards Redesigned */
.kpi-row {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    padding: 0 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    height: 100%;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.kpi-card:hover .kpi-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.kpi-number {
    font-family: 'Lexend', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.kpi-text {
    font-family: 'Lexend', sans-serif;
    color: var(--secondary-color);
    font-weight: 700;
}

.trend-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Hero Section - Ultimate Premium SaaS Palette */
.dashboard-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #14b8a6 100%);
    padding: 3.5rem 0 6.5rem 0;
    position: relative;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    margin-bottom: 0;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
    overflow: hidden;
}

/* Dynamic Mesh / Glow effects */
.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.2) 0%, transparent 70%);
    transform: rotate(30deg);
    pointer-events: none;
    z-index: 1;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.hero-text-content {
    position: relative;
    z-index: 10;
}

.hero-text-content h6 {
    color: var(--primary-color);
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-text-content h2 {
    font-family: 'Lexend', sans-serif;
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.hero-text-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    font-weight: 400;
    max-width: 600px;
}

.hero-text-content p strong {
    color: #ffffff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 6px;
    margin-left: 5px;
}

/* Perfect Glassmorphism Refresh Button */
.btn-refresh {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    height: 52px;
    padding: 0 2.5rem !important;
    border-radius: 99px !important;
    font-weight: 600 !important;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 10;
}

.btn-refresh:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.btn-refresh i {
    font-size: 16px;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    padding: 6px;
}

/* Premium Entrance Animations */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text-content h6 {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-text-content h2 {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
}

.hero-text-content p {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
}

.btn-refresh {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
}

/* Utilities */
.bg-soft-primary {
    background: rgba(20, 184, 166, 0.1);
    color: var(--primary-color);
}

.bg-soft-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.bg-soft-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.bg-soft-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.bg-soft-info {
    background: rgba(14, 165, 233, 0.1);
    color: var(--info-color);
}

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

/* Table Improvements */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border-color);
}

.table> :not(caption)>*>* {
    padding: 1rem 1.5rem;
    border-bottom-width: 1px;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    background-color: rgba(241, 245, 249, 0.5);
    /* translucent header */
    border-bottom: 1px solid var(--border-color);
}

body.dark-only .table thead th {
    background-color: rgba(30, 41, 59, 0.5);
}

.table-hover tbody tr:hover {
    background-color: rgba(53, 191, 191, 0.03);
}

/* Custom Navigation Pills */
.nav-pills-custom .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
}

.nav-pills-custom .nav-link.active {
    background-color: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* =========================================
   STORE DETAILS VIEW (Additions)
   ========================================= */
.store-hero-card {
    background: linear-gradient(135deg, #14b8a6 0%, #0f172a 100%);
    border-radius: var(--radius-xl);
    padding: 30px;
    color: white;
    position: relative;
    z-index: 50; /* Ensure high z-index for stacking context */
    overflow: visible !important; /* Force dropdowns to show outside */
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
    margin-bottom: 24px;
}

.store-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    border-radius: var(--radius-xl); /* Ensure pattern respects corners */
}

.icon-box-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manager-chip {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 6px 16px 6px 6px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.manager-chip:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Dark Mode Overrides */
body.dark-only .store-hero-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: none;
    border: 1px solid #334155;
}

body.dark-only .manager-chip,
body.dark-only .icon-box-glass {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Missing Utilities for Director Action */
.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn-glass:hover, .btn-glass:focus {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.05);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.btn-icon {
    padding: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fix Hero Dropdown Visibility */
.store-hero-card .dropdown-menu {
    color: var(--text-main);
    background-color: var(--bg-card);
    z-index: 1050;
    position: absolute;
    top: 100%; /* Position right below button */
    right: 0;
    border: 1px solid var(--border-color);
    margin-top: 8px; /* Small gap */
    min-width: 180px;
    box-shadow: var(--shadow-lg);
}
.store-hero-card .dropdown-item {
    color: var(--text-main);
    padding: 8px 16px;
}
.store-hero-card .dropdown-item:hover {
    background-color: var(--bg-body);
    color: var(--primary-color);
}
.store-hero-card .dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 4px 16px;
}
.store-hero-card .dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* Fix Modal Select Input Visibility */
.modal-content .form-select,
.modal-content .form-control {
    color: var(--text-main) !important; /* Ensure text is dark in modals */
    background-color: var(--bg-surface) !important;
}
.modal-content .form-select option {
    color: var(--text-main);
}

/* --- Inline CSS from Dashboard --- */
.kpi-card .kpi-number,
.kpi-card .kpi-text {
    color: var(--primary-color) !important;
    transition: all 0.3s ease;
}

.kpi-card .bg-soft-primary {
    background-color: rgba(53, 191, 191, 0.08) !important;
    color: var(--primary-color) !important;
}

@keyframes kpi-glow {
    0% {
        box-shadow: 0 0 0 rgba(20, 184, 166, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.2);
    }
    100% {
        box-shadow: 0 0 0 rgba(20, 184, 166, 0);
    }
}

.kpi-card.updating {
    animation: kpi-glow 1.5s ease-out;
}

.kpi-number.animating {
    color: var(--primary-hover) !important;
    text-shadow: 0 0 10px rgba(53, 191, 191, 0.1);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ============================================================
   Dashboard Refinements (extracted from inline <style>)
   These override/extend the base dashboard styles above.
   ============================================================ */

/* Refined CSS Variables */
:root {
    --primary: #35bfbf;
    --primary-dark: #2ca0a0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #6366f1;
    --dark: #1e293b;
    --gray: #64748b;
    --light-bg: #f8fafc;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --hover-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
    --border-radius-card: 24px;
    --border-radius-element: 16px;
    --transition-default: all 0.2s ease;
}

body {
    background-color: #f1f5f9;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Enhanced loader */
.loader-wrapper {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

/* KPI Cards - Elegant & Airy */
.kpi-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: var(--border-radius-card);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition-default);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary);
    background: white;
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-element);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    background: rgba(53, 191, 191, 0.12);
    color: var(--primary-dark);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--gray);
    margin-bottom: 0.25rem;
    display: block;
}

.kpi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

/* Progress bars refined */
.progress {
    background-color: #e9eef3;
    border-radius: 100px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.progress-bar {
    transition: width 0.6s ease;
    border-radius: 100px;
}

/* Cards global */
.card {
    background: white;
    border: none;
    border-radius: var(--border-radius-card);
    box-shadow: var(--card-shadow);
    transition: var(--transition-default);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card:hover {
    box-shadow: var(--hover-shadow);
}
.card-header {
    background: white;
    border-bottom: 1px solid rgba(203, 213, 225, 0.4);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
}
.card-header h5 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.card-body {
    padding: 1.5rem;
}

/* Tables refined */
.table {
    --bs-table-hover-bg: rgba(53, 191, 191, 0.03);
}
.table thead th {
    background: transparent;
    color: var(--gray);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0.75rem;
}
.table tbody tr {
    border-bottom: 1px solid #edf2f7;
    transition: var(--transition-default);
}
.table tbody tr:last-child {
    border-bottom: none;
}
.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: #334155;
    font-size: 0.9rem;
}

/* Badges refined */
.badge {
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
}
.bg-soft-success { background: rgba(16, 185, 129, 0.12); color: #0b7f5c; }
.bg-soft-danger { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.bg-soft-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.bg-soft-info { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.bg-soft-primary { background: rgba(53, 191, 191, 0.12); color: #2a8585; }

/* Buttons refined */
.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 100px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(53, 191, 191, 0.2);
    transition: var(--transition-default);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
    box-shadow: 0 8px 18px rgba(53, 191, 191, 0.3);
}
.btn-outline-danger {
    border-radius: 100px;
    border-width: 1.5px;
    font-weight: 600;
}

/* Nav tabs elegant */
.nav-tabs .nav-link {
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--gray);
    padding: 0.5rem 1.2rem;
    transition: var(--transition-default);
    border-radius: 0;
    margin: 0 2px;
}
.nav-tabs .nav-link.active {
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary) !important;
    background: transparent;
}

/* Nav pills for performance top 5 */
.nav-pills-custom .nav-link {
    border-radius: 100px;
    font-size: 0.75rem;
    padding: 0.3rem 1rem;
    background: #f1f4f9;
    color: #475569;
    font-weight: 600;
    margin-left: 0.3rem;
}
.nav-pills-custom .nav-link.active {
    background: var(--primary);
    color: white;
}

/* Priority feed pulse */
.pulse-danger {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }

/* Small text utilities */
.extra-small { font-size: 0.65rem; }
.mini-label { font-size: 0.6rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.02em; }

/* Custom scroll for verbatims */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* Transition hover */
.transition-hover { transition: var(--transition-default); }
.transition-hover:hover { background: #fafdff; transform: translateX(4px); }

/* Date input refinement */
input[type="date"].form-control {
    color: var(--gray);
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    border: none;
    background: transparent;
}
.bg-light-date {
    background: #f1f4f9;
    border-radius: 100px;
    padding: 0.2rem 0.5rem;
}

/* ============================================================
   Volume Chart Filters Refinement
   ============================================================ */
.volume-filter-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.volume-date-range {
    background: #f1f5f9;
    height: 42px;
    border-radius: 100px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.volume-date-range input[type="date"] {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    color: var(--gray);
    font-weight: 500;
    width: 120px;
    height: 100%;
}
.volume-date-range input[type="date"]:focus {
    outline: none;
    box-shadow: none;
}

.btn-volume-filter {
    background: #2dd4bf; /* Lighter teal to match image */
    color: white;
    border: none;
    height: 42px;
    border-radius: 100px;
    padding: 0 1.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-default);
}
.btn-volume-filter:hover {
    background: #14b8a6;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(45, 212, 191, 0.3);
    color: white;
}

.volume-nav-pills {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.volume-nav-pills .nav-link {
    background: #f8fafc; /* Very light gray */
    color: var(--gray);
    height: 42px;
    border-radius: 100px;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-default);
    margin: 0;
    border: none;
}
.volume-nav-pills .nav-link:hover {
    background: #e2e8f0;
    color: var(--dark);
}
.volume-nav-pills .nav-link.active {
    background: #2dd4bf; /* Match filter button */
    color: white;
    box-shadow: 0 4px 10px rgba(45, 212, 191, 0.3);
}

body.dark-only .volume-date-range,
body.dark-only .volume-nav-pills .nav-link {
    background: #1e293b;
    color: #cbd5e1;
}
body.dark-only .volume-nav-pills .nav-link:hover {
    background: #334155;
    color: #fff;
}
body.dark-only .volume-nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
}
body.dark-only .volume-date-range input[type="date"] {
    color: #cbd5e1;
}
body.dark-only .volume-date-range input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}