/* ===== DASHBOARD - STO TRIP MANAGER ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS VARIABLES (Dark Mode - Default) ===== */
:root {
    --dash-bg: #0a0a1a;
    --dash-surface: #111128;
    --dash-surface-2: #16163a;
    --dash-surface-3: #1c1c4a;
    --dash-border: rgba(255, 255, 255, 0.06);
    --dash-border-hover: rgba(255, 255, 255, 0.12);
    --dash-text: #f1f5f9;
    --dash-text-secondary: #94a3b8;
    --dash-text-muted: #64748b;
    --dash-primary: #6366f1;
    --dash-primary-hover: #4f46e5;
    --dash-primary-light: rgba(99, 102, 241, 0.12);
    --dash-primary-glow: rgba(99, 102, 241, 0.3);
    --dash-success: #22c55e;
    --dash-success-light: rgba(34, 197, 94, 0.12);
    --dash-warning: #f59e0b;
    --dash-warning-light: rgba(245, 158, 11, 0.12);
    --dash-danger: #ef4444;
    --dash-danger-light: rgba(239, 68, 68, 0.12);
    --dash-info: #3b82f6;
    --dash-info-light: rgba(59, 130, 246, 0.12);
    --dash-cyan: #06b6d4;
    --dash-cyan-light: rgba(6, 182, 212, 0.12);
    --dash-violet: #8b5cf6;
    --dash-violet-light: rgba(139, 92, 246, 0.12);
    --dash-sidebar-width: 260px;
    --dash-header-height: 64px;
    --dash-radius: 14px;
    --dash-radius-sm: 10px;
    --dash-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== CSS VARIABLES (Light Mode) ===== */
[data-theme="light"] {
    --dash-bg: #f1f5f9;
    --dash-surface: #ffffff;
    --dash-surface-2: #f8fafc;
    --dash-surface-3: #e2e8f0;
    --dash-border: rgba(0, 0, 0, 0.08);
    --dash-border-hover: rgba(0, 0, 0, 0.15);
    --dash-text: #0f172a;
    --dash-text-secondary: #475569;
    --dash-text-muted: #94a3b8;
    --dash-primary: #6366f1;
    --dash-primary-hover: #4f46e5;
    --dash-primary-light: rgba(99, 102, 241, 0.1);
    --dash-primary-glow: rgba(99, 102, 241, 0.2);
    --dash-success: #16a34a;
    --dash-success-light: rgba(22, 163, 74, 0.1);
    --dash-warning: #d97706;
    --dash-warning-light: rgba(217, 119, 6, 0.1);
    --dash-danger: #dc2626;
    --dash-danger-light: rgba(220, 38, 38, 0.1);
    --dash-info: #2563eb;
    --dash-info-light: rgba(37, 99, 235, 0.1);
    --dash-cyan: #0891b2;
    --dash-cyan-light: rgba(8, 145, 178, 0.1);
    --dash-violet: #7c3aed;
    --dash-violet-light: rgba(124, 58, 237, 0.1);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body.dash-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dash-bg);
    color: var(--dash-text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ========================================
   SIDEBAR
   ======================================== */
.dash-sidebar {
    width: var(--dash-sidebar-width);
    height: 100vh;
    background: var(--dash-surface);
    border-right: 1px solid var(--dash-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    transition: var(--dash-transition);
}

/* Sidebar Brand */
.dash-sidebar-brand {
    height: var(--dash-header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--dash-border);
    flex-shrink: 0;
}

.dash-sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--dash-primary-glow);
}

.dash-sidebar-logo svg {
    width: 20px;
    height: 20px;
    color: white;
}

.dash-sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.dash-sidebar-brand-title {
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--dash-text);
    line-height: 1.2;
}

.dash-sidebar-brand-sub {
    font-size: 0.499rem;
    color: var(--dash-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar Navigation */
.dash-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.dash-nav-section {
    margin-bottom: 1.5rem;
}

.dash-nav-section-title {
    font-size: 0.688rem;
    font-weight: 600;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--dash-radius-sm);
    color: var(--dash-nav-text, var(--dash-text-secondary));
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--dash-transition);
    position: relative;
    margin-bottom: 2px;
}

.dash-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--dash-text);
}

.dash-nav-item.active {
    background: var(--dash-primary-light);
    color: var(--dash-primary);
}

.dash-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--dash-primary);
    border-radius: 0 3px 3px 0;
}

.dash-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.dash-nav-item.active svg {
    opacity: 1;
}

.dash-nav-badge {
    margin-left: auto;
    background: var(--dash-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.688rem;
    font-weight: 700;
    line-height: 1.4;
}

/* Sidebar Footer / User */
.dash-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--dash-border);
    flex-shrink: 0;
}

.dash-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--dash-radius-sm);
    cursor: pointer;
    transition: var(--dash-transition);
}

.dash-user-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dash-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.dash-user-info {
    flex: 1;
    min-width: 0;
}

.dash-user-name {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--dash-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-user-role {
    font-size: 0.688rem;
    color: var(--dash-text-muted);
}

.dash-logout-btn {
    background: none;
    border: none;
    color: var(--dash-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: var(--dash-transition);
    display: flex;
    align-items: center;
}

.dash-logout-btn:hover {
    background: var(--dash-danger-light);
    color: var(--dash-danger);
}

.dash-logout-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* --- HEADER --- */
.dash-header {
    height: var(--dash-header-height);
    background: var(--dash-surface);
    border-bottom: 1px solid var(--dash-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.dash-menu-toggle {
    display: none;  /* hidden on desktop — shown on mobile via media query */
    background: none;
    border: none;
    color: var(--dash-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.dash-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dash-menu-toggle svg {
    width: 22px;
    height: 22px;
}

.dash-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dash-header-text, var(--dash-text));
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.dash-header-btn {
    background: none;
    border: 1px solid var(--dash-border);
    color: var(--dash-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--dash-radius-sm);
    transition: var(--dash-transition);
    display: flex;
    align-items: center;
    position: relative;
}

.dash-header-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--dash-border-hover);
    color: var(--dash-text);
}

.dash-header-btn svg {
    width: 18px;
    height: 18px;
}

.dash-header-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--dash-danger);
    border-radius: 50%;
    border: 2px solid var(--dash-surface);
}

.dash-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius-sm);
    padding: 0 0.875rem;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
    width: 240px;
}

.dash-search-box:focus-within {
    border-color: var(--dash-primary);
    box-shadow: 0 0 0 3px var(--dash-primary-light);
    width: 380px;
}

.dash-search-box svg.search-icon {
    width: 16px;
    height: 16px;
    color: var(--dash-text-muted);
    flex-shrink: 0;
}

.dash-search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--dash-text);
    font-size: 0.813rem;
    font-family: 'Inter', sans-serif;
    padding: 8px 0;
    flex: 1;
    width: 100%;
}

.dash-search-input::placeholder {
    color: var(--dash-text-muted);
}

.dash-search-shortcut {
    font-size: 0.65rem;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    color: var(--dash-text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    transition: opacity 0.2s;
    font-weight: 600;
}

.dash-search-box:focus-within .dash-search-shortcut {
    opacity: 0;
    pointer-events: none;
}

/* Floating SAP Search Dropdown */
.dash-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 480px;
    max-height: 480px;
    background: rgba(23, 28, 41, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none; /* Controlled by JS show class */
    flex-direction: column;
    z-index: 10000;
    overflow-y: auto;
    animation: search-fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .dash-search-dropdown {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.dash-search-dropdown.show {
    display: flex;
}

/* Dropdown Sections */
.search-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dash-border);
}

.search-section:last-child {
    border-bottom: none;
}

.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.688rem;
    font-weight: 700;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-section-header button {
    background: none;
    border: none;
    color: var(--dash-primary);
    font-size: 0.688rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.search-section-header button:hover {
    color: var(--dash-primary-hover);
    text-decoration: underline;
}

/* Results List */
.search-results-list {
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--dash-text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.813rem;
    outline: none;
}

.search-result-item:hover,
.search-result-item.focused {
    background: var(--dash-primary-light);
    color: var(--dash-primary);
}

.search-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--dash-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    color: var(--dash-text-muted);
}

.search-result-item:hover .search-item-icon,
.search-result-item.focused .search-item-icon {
    background: rgba(255, 255, 255, 0.08);
    color: var(--dash-primary);
}

.search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-item-title {
    font-weight: 600;
    color: var(--dash-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.search-result-item:hover .search-item-title,
.search-result-item.focused .search-item-title {
    color: var(--dash-primary);
}

.search-item-subtitle {
    font-size: 0.75rem;
    color: var(--dash-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .highlight {
    color: var(--dash-primary);
    font-weight: 700;
    background: rgba(99, 102, 241, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

/* Empty State */
.search-empty-state {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--dash-text-muted);
    font-size: 0.813rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.search-empty-state svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
    margin-bottom: 0.25rem;
}

/* Skeleton Loading State */
.search-skeleton-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
}

.search-skeleton-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--dash-border);
    animation: search-pulse 1.5s infinite ease-in-out;
}

.search-skeleton-line-1 {
    height: 12px;
    width: 40%;
    background: var(--dash-border);
    border-radius: 4px;
    margin-bottom: 6px;
    animation: search-pulse 1.5s infinite ease-in-out;
}

.search-skeleton-line-2 {
    height: 9px;
    width: 70%;
    background: var(--dash-border);
    border-radius: 4px;
    animation: search-pulse 1.5s infinite ease-in-out;
}

@keyframes search-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

@keyframes search-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .dash-search-box:focus-within {
        width: calc(100vw - 80px);
    }
    .dash-search-dropdown {
        width: calc(100vw - 80px);
        right: auto;
        left: -40px;
    }
}

/* --- CONTENT AREA --- */
.dash-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* --- WELCOME BANNER --- */
.dash-welcome {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--dash-radius);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    animation: dash-fadeUp 0.5s ease-out;
}

.dash-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.dash-welcome-content {
    position: relative;
    z-index: 1;
}

.dash-welcome h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
    background: linear-gradient(135deg, var(--dash-text), #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dash-welcome p {
    color: var(--dash-text-secondary);
    font-size: 0.938rem;
    line-height: 1.6;
}

.dash-welcome-time {
    margin-top: 0.75rem;
    font-size: 0.813rem;
    color: var(--dash-text-muted);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dash-welcome-time svg {
    width: 14px;
    height: 14px;
}

@keyframes dash-fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- STAT CARDS GRID --- */
.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dash-stat-card {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--dash-transition);
    animation: dash-fadeUp 0.5s ease-out;
    animation-fill-mode: both;
}

.dash-stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.dash-stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.dash-stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.dash-stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.dash-stat-card:hover {
    border-color: var(--dash-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.dash-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.dash-stat-card.primary::after {
    background: linear-gradient(90deg, var(--dash-primary), var(--dash-violet));
}

.dash-stat-card.success::after {
    background: linear-gradient(90deg, var(--dash-success), #34d399);
}

.dash-stat-card.warning::after {
    background: linear-gradient(90deg, var(--dash-warning), #fbbf24);
}

.dash-stat-card.info::after {
    background: linear-gradient(90deg, var(--dash-info), var(--dash-cyan));
}

.dash-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-stat-icon svg {
    width: 22px;
    height: 22px;
}

.dash-stat-icon.primary {
    background: var(--dash-primary-light);
    color: var(--dash-primary);
}

.dash-stat-icon.success {
    background: var(--dash-success-light);
    color: var(--dash-success);
}

.dash-stat-icon.warning {
    background: var(--dash-warning-light);
    color: var(--dash-warning);
}

.dash-stat-icon.info {
    background: var(--dash-info-light);
    color: var(--dash-info);
}

.dash-stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.dash-stat-trend svg {
    width: 12px;
    height: 12px;
}

.dash-stat-trend.up {
    background: var(--dash-success-light);
    color: var(--dash-success);
}

.dash-stat-trend.down {
    background: var(--dash-danger-light);
    color: var(--dash-danger);
}

.dash-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dash-text);
    line-height: 1;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.dash-stat-label {
    font-size: 0.813rem;
    color: var(--dash-text-muted);
    font-weight: 500;
}

/* --- TWO COLUMN SECTION --- */
.dash-grid-two {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* --- PANEL / TABLE CARD --- */
.dash-panel {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
    animation: dash-fadeUp 0.5s ease-out 0.25s;
    animation-fill-mode: both;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--dash-border);
}

.dash-panel-title {
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--dash-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-panel-title svg {
    width: 18px;
    height: 18px;
    color: var(--dash-primary);
}

.dash-panel-actions {
    display: flex;
    gap: 0.5rem;
}

.dash-panel-action-btn {
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border);
    color: var(--dash-text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--dash-transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash-panel-action-btn:hover {
    border-color: var(--dash-primary);
    color: var(--dash-primary);
}

.dash-panel-action-btn svg {
    width: 14px;
    height: 14px;
}

/* --- TABLE --- */
.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    background: var(--dash-surface-2);
    padding: 0.75rem 1.25rem;
    font-size: 0.688rem;
    font-weight: 700;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--dash-border);
}

.dash-table td {
    padding: 0.875rem 1.25rem;
    font-size: 0.838rem;
    color: var(--dash-text-secondary);
    border-bottom: 1px solid var(--dash-border);
    white-space: nowrap;
}

.dash-table tbody tr {
    transition: background 0.2s ease;
}

.dash-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table-sto {
    font-weight: 600;
    color: var(--dash-text);
}

.dash-table-route {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dash-table-route svg {
    width: 14px;
    height: 14px;
    color: var(--dash-text-muted);
}

/* Status Badges */
.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.dash-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-badge.in-transit {
    background: var(--dash-info-light);
    color: var(--dash-info);
}

.dash-badge.in-transit::before {
    background: var(--dash-info);
}

.dash-badge.delivered {
    background: var(--dash-success-light);
    color: var(--dash-success);
}

.dash-badge.delivered::before {
    background: var(--dash-success);
}

.dash-badge.pending {
    background: var(--dash-warning-light);
    color: var(--dash-warning);
}

.dash-badge.pending::before {
    background: var(--dash-warning);
}

.dash-badge.cancelled {
    background: var(--dash-danger-light);
    color: var(--dash-danger);
}

.dash-badge.cancelled::before {
    background: var(--dash-danger);
}

.dash-badge.scheduled {
    background: var(--dash-violet-light);
    color: var(--dash-violet);
}

.dash-badge.scheduled::before {
    background: var(--dash-violet);
}

/* --- ACTIVITY / TIMELINE --- */
.dash-activity-list {
    padding: 1.25rem 1.5rem;
}

.dash-activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    position: relative;
}

.dash-activity-item:not(:last-child) {
    border-bottom: 1px solid var(--dash-border);
}

.dash-activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
}

.dash-activity-dot.primary {
    background: var(--dash-primary);
    box-shadow: 0 0 8px var(--dash-primary-glow);
}

.dash-activity-dot.success {
    background: var(--dash-success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.dash-activity-dot.warning {
    background: var(--dash-warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.dash-activity-dot.danger {
    background: var(--dash-danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.dash-activity-dot.info {
    background: var(--dash-info);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.dash-activity-content {
    flex: 1;
    min-width: 0;
}

.dash-activity-text {
    font-size: 0.813rem;
    color: var(--dash-text-secondary);
    line-height: 1.5;
}

.dash-activity-text strong {
    color: var(--dash-text);
    font-weight: 600;
}

.dash-activity-time {
    font-size: 0.688rem;
    color: var(--dash-text-muted);
    margin-top: 2px;
}

/* --- QUICK ACTIONS PANEL --- */
.dash-quick-actions {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.dash-quick-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius-sm);
    color: var(--dash-text-secondary);
    text-decoration: none;
    font-size: 0.838rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--dash-transition);
    font-family: 'Inter', sans-serif;
}

.dash-quick-btn:hover {
    background: var(--dash-surface-3);
    border-color: var(--dash-border-hover);
    color: var(--dash-text);
    transform: translateX(4px);
}

.dash-quick-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.dash-quick-btn:hover svg {
    opacity: 1;
}

.dash-quick-btn .dash-quick-arrow {
    margin-left: auto;
    opacity: 0;
    transition: var(--dash-transition);
}

.dash-quick-btn:hover .dash-quick-arrow {
    opacity: 0.5;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .dash-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .dash-sidebar.open {
        left: 0;
    }

    .dash-menu-toggle {
        display: flex;
    }

    .dash-content {
        padding: 1.25rem;
    }

    .dash-stats-grid {
        grid-template-columns: 1fr;
    }

    .dash-header {
        padding: 0 1.25rem;
    }

    .dash-search-box {
        display: none;
    }

    .dash-welcome {
        padding: 1.5rem;
    }

    .dash-welcome h2 {
        font-size: 1.25rem;
    }
}

/* Sidebar overlay on mobile */
.dash-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.dash-sidebar-overlay.show {
    display: block;
}

/* ===== LIGHT MODE OVERRIDES ===== */
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .dash-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .dash-user-card:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .dash-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .dash-header-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .dash-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dash-stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dash-sidebar-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Theme toggle button */
.dash-theme-toggle {
    background: none;
    border: 1px solid var(--dash-border);
    color: var(--dash-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--dash-radius-sm);
    transition: var(--dash-transition);
    display: flex;
    align-items: center;
}

.dash-theme-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--dash-primary);
    color: var(--dash-primary);
}

.dash-theme-toggle svg {
    width: 18px;
    height: 18px;
}

.dash-theme-toggle .theme-icon-moon,
.dash-theme-toggle .theme-icon-sun {
    display: none;
}

/* Dark mode: show sun icon (to switch to light) */
.dash-theme-toggle .theme-icon-sun {
    display: block;
}

.dash-theme-toggle .theme-icon-moon {
    display: none;
}

/* Light mode: show moon icon (to switch to dark) */
[data-theme="light"] .dash-theme-toggle .theme-icon-sun {
    display: none;
}

[data-theme="light"] .dash-theme-toggle .theme-icon-moon {
    display: block;
}

/* ============================================================
   SIDEBAR: Responsive & Mobile Support
   ============================================================ */

/* Mobile overlay */
.dash-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
    backdrop-filter: blur(2px);
    transition: var(--dash-transition);
}
.dash-sidebar-overlay.active {
    display: block;
}

/* Sidebar transition for collapse */
.dash-sidebar {
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Mobile: hide sidebar off-canvas by default */
@media (max-width: 991px) {
    .dash-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
        width: var(--dash-sidebar-width) !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
    }
    .dash-sidebar.mobile-open {
        transform: translateX(0);
    }
    .dash-sidebar.collapsed {
        width: var(--dash-sidebar-width) !important;
    }
    /* Show hamburger only on mobile */
    .dash-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet: smaller sidebar width */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --dash-sidebar-width: 230px;
    }
}

/* Small desktop: normal sidebar */
@media (min-width: 1200px) {
    :root {
        --dash-sidebar-width: 260px;
    }
}

/* Collapsed sidebar tooltip on hover (mini-mode) */
.dash-sidebar.collapsed .snav-section-toggle:hover::after,
.dash-sidebar.collapsed .snav-link:hover::after,
.dash-sidebar.collapsed .snav-sub-toggle:hover::after {
    content: attr(title);
    position: absolute;
    left: 72px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border);
    color: var(--dash-text);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 7px;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 500;
    pointer-events: none;
}
.dash-sidebar.collapsed .snav-section-toggle,
.dash-sidebar.collapsed .snav-link,
.dash-sidebar.collapsed .snav-sub-toggle {
    position: relative;
    overflow: visible;
}