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

:root {
    --primary: #1A56DB;
    --accent: #0EA5E9;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #64748B;
    --font-family: 'Cairo', sans-serif;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --transition-speed: 0.35s;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary: #3B82F6;
    --accent: #38BDF8;
    --success: #34D399;
    --danger: #F87171;
    --warning: #FBBF24;
    --bg: #0F172A;
    --surface: #1E293B;
    --border: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --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.5);
}

body, html {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    height: 100vh;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* ── Sidebar ── */
.sidebar {
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    transition: width var(--transition-speed) ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 1000;
}

.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Inner layout */
.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: var(--sidebar-width);
    transition: width var(--transition-speed) ease;
}

.sidebar-collapsed .sidebar-inner {
    width: var(--sidebar-collapsed-width);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    min-height: 70px;
    transition: padding var(--transition-speed) ease;
}

.sidebar-collapsed .sidebar-brand {
    padding: 1.25rem 0;
    justify-content: center;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(26,86,219,0.25);
}

.brand-text {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    white-space: nowrap;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-collapsed .brand-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

/* Navigation */
.sidebar-nav {
    padding: 1rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.75rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nav-text {
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.nav-link:hover {
    color: var(--primary);
    background-color: rgba(26, 86, 219, 0.07);
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(26,86,219,0.08);
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(26, 86, 219, 0.1);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    transition: padding var(--transition-speed) ease;
}

.sidebar-collapsed .sidebar-footer {
    padding: 0.75rem 0;
}

/* ── Main Content ── */
.main-content {
    transition: margin-left var(--transition-speed) ease;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.main-content-collapsed {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* ── Top Navbar ── */
.top-navbar {
    background-color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* ── KPI Cards ── */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -4px rgba(0,0,0,0.08);
}

/* ── Connection Dots ── */
.connection-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
}

.dot-connected { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-disconnected { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ── Highlight Animation ── */
.new-record-highlight {
    animation: highlightFade 3s ease-out;
}

@keyframes highlightFade {
    0% { background-color: rgba(16, 185, 129, 0.3); }
    100% { background-color: transparent; }
}

/* ── Mobile Sidebar ── */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    animation: fadeIn 0.25s ease;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: var(--surface);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .top-navbar {
        padding: 0.75rem 1rem;
    }

    .top-navbar h4 {
        font-size: 1.1rem;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .main-content-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (min-width: 768px) {
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        display: none !important;
    }
}

/* ── Dark Mode Transitions for Components ── */
[data-theme="dark"] .top-navbar {
    background-color: rgba(30, 41, 59, 0.85);
}

[data-theme="dark"] .kpi-card {
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .kpi-card:hover {
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .nav-link:hover {
    background-color: rgba(59, 130, 246, 0.12);
    box-shadow: 0 2px 6px rgba(59,130,246,0.12);
}

[data-theme="dark"] .nav-link.active {
    background-color: rgba(59, 130, 246, 0.18);
    box-shadow: inset 3px 0 0 var(--primary);
}

[data-theme="dark"] .brand-icon {
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(148,163,184,0.3) 50%, var(--border) 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: skeletonShimmer 1.5s infinite;
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 120px;
    width: 100%;
    margin-bottom: 1rem;
}

.skeleton-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

/* ── Connection Banner ── */
.connection-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    animation: bannerSlideDown 0.3s ease;
}

.connection-banner.disconnected {
    background-color: var(--danger);
    color: #fff;
}

.connection-banner.reconnecting {
    background-color: var(--warning);
    color: #000;
}

@keyframes bannerSlideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

/* ── Notification Dropdown ── */
.notification-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1030;
    overflow: hidden;
    animation: dropdownFade 0.2s ease;
}

.notification-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    transition: background 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(26, 86, 219, 0.05);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Sparkline ── */
.sparkline-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
}

.sparkline-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    background: var(--primary);
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sparkline-bar:hover {
    opacity: 1;
}

/* ── Activity Feed ── */
.activity-feed {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Search Panel ── */
.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ── Print Styles ── */
@media print {
    .sidebar,
    .mobile-sidebar,
    .mobile-sidebar-overlay,
    .top-navbar,
    .connection-banner,
    .btn,
    .search-panel {
        display: none !important;
    }

    .main-content,
    .main-content-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .kpi-card {
        box-shadow: none !important;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .row {
        display: flex;
        flex-wrap: wrap;
    }

    .col-md-3 {
        width: 25%;
    }

    .col-md-4 {
        width: 33.33%;
    }

    .col-md-6 {
        width: 50%;
    }

    .col-12 {
        width: 100%;
    }
}

/* ── Error Boundary ── */
.error-boundary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.error-boundary-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-boundary h3 {
    margin-bottom: 0.5rem;
}

.error-boundary p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border);
    transform: scale(1.05);
}

/* ── Table Responsive ── */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Depot Summary Card ── */
.depot-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.depot-summary-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    flex-shrink: 0;
}

.depot-summary-rank.gold { background: linear-gradient(135deg, #F59E0B, #D97706); }
.depot-summary-rank.silver { background: linear-gradient(135deg, #9CA3AF, #6B7280); }
.depot-summary-rank.bronze { background: linear-gradient(135deg, #B45309, #92400E); }
.depot-summary-rank.other { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.depot-summary-info {
    flex: 1;
}

.depot-summary-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.depot-summary-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Radzen Dark Overrides ── */
[data-theme="dark"] .rz-datatable,
[data-theme="dark"] .rz-paginator {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .rz-datatable .rz-datatable-thead th {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .rz-datatable .rz-datatable-tbody td {
    border-color: var(--border);
}

[data-theme="dark"] .rz-chart {
    background: var(--surface);
    border-radius: 12px;
}

[data-theme="dark"] .rz-inputtext {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .rz-datepicker {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

/* ── Fix RadzenDatePicker Width & Double Border ── */
.rz-calendar {
    display: flex !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    background: var(--surface) !important;
    overflow: hidden;
    align-items: stretch;
}
.rz-calendar .rz-inputtext {
    flex: 1;
    width: 100%;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}
.rz-calendar .rz-datepicker-trigger, .rz-calendar .rz-button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    border-radius: 0 !important;
}
[dir="rtl"] .rz-calendar .rz-button {
    border-right: 1px solid var(--border) !important;
}
[dir="ltr"] .rz-calendar .rz-button {
    border-left: 1px solid var(--border) !important;
}
[data-theme="dark"] .rz-calendar {
    border-color: var(--border) !important;
    background: var(--surface) !important;
}
[data-theme="dark"] .rz-calendar .rz-inputtext {
    color: var(--text) !important;
}

/* ── Trend Indicators ── */
.trend-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

/* ── Heatmap Calendar ── */
.heatmap-container {
    overflow-x: auto;
    padding: 0.5rem 0;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.heatmap-legend-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.heatmap-grid {
    display: flex;
    gap: 3px;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    transition: transform 0.15s ease;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.heatmap-empty {
    opacity: 0.7;
}

/* ── Floating Action Button ── */
.fab-container {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(26,86,219,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(26,86,219,0.45);
}

.fab-item {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.fab-container.open .fab-item {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-item:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

/* ── Slide-over Detail Panel ── */
.detail-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1060;
    animation: fadeIn 0.2s ease;
}

.detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    z-index: 1070;
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

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

.detail-panel-body {
    padding: 1.25rem;
}

.detail-field {
    margin-bottom: 1rem;
}

.detail-field-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-field-value {
    font-size: 1rem;
    font-weight: 500;
}

/* ── Bulk Actions Toolbar ── */
.bulk-toolbar {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ── Keyboard Shortcut Badge ── */
.kbd-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 0.15rem 0.4rem;
    background: var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--text-muted);
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

/* ── Import Drop Zone ── */
.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--surface);
}

.import-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(26, 86, 219, 0.05);
}

.import-dropzone-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ── Trash Bin Styles ── */
.trash-bin-card {
    opacity: 0.85;
    background: repeating-linear-gradient(
        45deg,
        var(--surface),
        var(--surface) 10px,
        rgba(239, 68, 68, 0.03) 10px,
        rgba(239, 68, 68, 0.03) 20px
    );
}

/* ── Chart Animation Toggle ── */
.animation-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.animation-toggle input {
    accent-color: var(--primary);
}

/* ── Image Upload ── */
.upload-container {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg);
    cursor: pointer;
    position: relative;
}

.upload-container:hover {
    border-color: var(--primary);
    background: rgba(26, 86, 219, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.img-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.btn-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.upload-container.uploading {
    opacity: 0.6;
    pointer-events: none;
}

/* ── Page Transitions ── */
main {
    animation: fadeInPage 0.4s ease-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ══════════════════════════════════════════
   WAVE 4 — Premium Features
   ══════════════════════════════════════════ */

/* ── Command Palette ── */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    animation: fadeIn 0.15s ease;
}

.command-palette {
    position: fixed;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    width: 580px;
    max-width: 92vw;
    max-height: 65vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: commandPaletteSlideIn 0.2s ease;
}

@keyframes commandPaletteSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.command-palette-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.command-palette-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    font-family: var(--font-family);
}

.command-palette-input::placeholder {
    color: var(--text-muted);
}

.command-palette-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 400px;
}

.command-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
    font-weight: 600;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.command-item:hover,
.command-item.active {
    background: rgba(26, 86, 219, 0.08);
}

[data-theme="dark"] .command-item:hover,
[data-theme="dark"] .command-item.active {
    background: rgba(59, 130, 246, 0.15);
}

.command-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 86, 219, 0.08);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.command-item.active .command-item-icon {
    background: var(--primary);
    color: #fff;
}

.command-item-content {
    flex: 1;
    min-width: 0;
}

.command-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-searching,
.command-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.command-palette-footer {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.command-palette-footer kbd {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    margin: 0 0.15rem;
    background: var(--border);
    border-radius: 3px;
    font-family: monospace;
}

/* ── Global Search Trigger Button ── */
.global-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    font-family: var(--font-family);
}

.global-search-trigger:hover {
    border-color: var(--primary);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
}

.global-search-trigger .kbd-shortcut {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
}

/* ── Breadcrumb Navigation ── */
.breadcrumb-nav {
    font-size: 0.8rem;
}

.breadcrumb-nav .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    content: "\f054";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.55rem;
    color: var(--text-muted);
    vertical-align: middle;
}

[dir="rtl"] .breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    content: "\f053";
}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-nav .breadcrumb-item.active {
    color: var(--text);
    font-weight: 600;
}

/* ── Keyboard Shortcuts Help ── */
.shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.15s ease;
}

.shortcuts-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 92vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    animation: commandPaletteSlideIn 0.2s ease;
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.shortcuts-body {
    padding: 1rem 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.shortcuts-section {
    margin-bottom: 1.25rem;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.shortcut-keys kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.2rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ── Hourly Chart Styles ── */
.hourly-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding: 0.5rem 0;
}

.hourly-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 3px 3px 0 0;
    min-width: 8px;
    transition: opacity 0.2s ease;
    position: relative;
    cursor: pointer;
}

.hourly-bar:hover {
    opacity: 0.8;
}

.hourly-bar-label {
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Enhanced Print Styles (W4) ── */
@media print {
    .command-palette-overlay,
    .command-palette,
    .shortcuts-overlay,
    .shortcuts-modal,
    .breadcrumb-nav,
    .global-search-trigger,
    .fab-container,
    .lock-screen {
        display: none !important;
    }

    .kpi-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .row.g-4 {
        page-break-inside: avoid;
    }

    h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* ── Template Download Button (BulkImport W4) ── */
.template-download-card {
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.05), rgba(14, 165, 233, 0.05));
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.template-download-card:hover {
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.1), rgba(14, 165, 233, 0.1));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ── Import Progress Bar ── */
.import-progress {
    margin-top: 1rem;
}

.import-progress .progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.import-progress .progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

/* ── Day×Hour Heatmap Matrix ── */
.heatmap-table td.heatmap-matrix-cell {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    min-width: 28px;
}

.heatmap-table td.heatmap-matrix-cell:hover {
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(26,86,219,0.35);
    z-index: 1;
    position: relative;
}

[data-theme="dark"] .heatmap-table td.heatmap-matrix-cell {
    border-color: var(--border) !important;
}

[data-theme="dark"] .heatmap-table thead th,
[data-theme="dark"] .heatmap-table tfoot td {
    background: var(--surface) !important;
    color: var(--text-muted) !important;
}

/* ── Intelligence Widget Utilities ── */
.animate-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.letter-spacing-1 {
    letter-spacing: 0.05em;
}

/* ── Pulse Card Hover (Fleet Pulse) ── */
.pulse-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* ── Version Info Badge ── */
.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

