/* ═══════════════════════════════════════════════════════════
   VELOCITY MOTORSPORTS — DASHBOARD 1
   Premium automotive customer dashboard
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-body: #0c0f14;
    --bg-sidebar: #101419;
    --bg-card: #151a22;
    --bg-card-hover: #1a2030;
    --bg-header: rgba(16, 20, 25, 0.85);
    --bg-input: rgba(255,255,255,0.04);
    --bg-welcome: linear-gradient(135deg, #0e2a3a 0%, #0f1923 40%, #151a22 100%);
    --text-primary: #f0f0f0;
    --text-secondary: #8b95a5;
    --text-muted: #5a6474;
    --accent: #D90429;
    --accent-glow: rgba(217, 4, 41, 0.25);
    --green: #06d6a0;
    --blue: #00b4d8;
    --orange: #f77f00;
    --red: #d90429;
    --border: rgba(255,255,255,0.06);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 72px;
    --header-h: 70px;
    --font: 'Copperplate Gothic Light', 'Copperplate', 'Copperplate Gothic', sans-serif;
    --font-display: 'Copperplate Gothic Light', 'Copperplate', 'Copperplate Gothic', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
input { font-family: inherit; }

/* ═══════════ SIDEBAR ═══════════ */
.db-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition), transform var(--transition);
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 28px;
    border-bottom: 1px solid var(--border);
    min-height: 80px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-logo:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}
.sidebar-logo-img { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(217, 4, 41, 0.4)); }
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 0;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition);
}
.sidebar-brand-main {
    font-family: 'Showcard Gothic', 'Impact', 'Arial Black', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    line-height: 1;
}
.sidebar-brand-accent {
    font-family: 'Showcard Gothic', 'Impact', 'Arial Black', sans-serif;
    font-size: 0.52rem;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--text-muted);
    line-height: 1;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 10px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Sidebar collapsed */
.db-sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.db-sidebar.collapsed .sidebar-brand-text,
.db-sidebar.collapsed .sidebar-link span,
.db-sidebar.collapsed .sidebar-badge { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }
.db-sidebar.collapsed .sidebar-link { justify-content: center; padding: 12px; }
.db-sidebar.collapsed .sidebar-logo { justify-content: center; padding: 20px 10px 28px; }

/* Tooltip for collapsed */
.db-sidebar.collapsed .sidebar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 99;
}
.db-sidebar.collapsed .sidebar-link:hover::after { opacity: 1; }


/* ═══════════ MAIN CONTENT ═══════════ */
.db-main {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition), width var(--transition);
    padding-bottom: 2rem;
    overflow-x: hidden;
}
.db-sidebar.collapsed ~ .db-main { margin-left: var(--sidebar-w-collapsed); width: calc(100% - var(--sidebar-w-collapsed)); }


/* ═══════════ HEADER ═══════════ */
.db-header {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--header-h);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.db-header-left { display: flex; align-items: center; gap: 16px; }
.db-header-right { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.06); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.db-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 18px;
    width: 340px;
    transition: border-color var(--transition);
}
.db-search:focus-within { border-color: var(--accent); }
.db-search svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.db-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
}
.db-search input::placeholder { color: var(--text-muted); }

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition);
    position: relative;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.06); }
.header-icon-btn svg { width: 18px; height: 18px; }

.notification-btn .notif-dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: background var(--transition);
}
.header-user:hover { background: rgba(255,255,255,0.04); }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.header-user-info { display: flex; flex-direction: column; }
.header-user-name { font-size: 0.85rem; font-weight: 600; }
.header-user-role { font-size: 0.7rem; color: var(--orange); font-weight: 500; }
.user-dropdown-arrow { width: 14px; height: 14px; color: var(--text-muted); }


/* ═══════════ WELCOME BANNER ═══════════ */
.db-welcome {
    margin: 24px 28px 0;
    padding: 28px 32px;
    background: var(--bg-welcome);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    overflow: hidden;
}
.db-welcome::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-content { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; z-index: 1; }
.welcome-greeting { color: var(--text-secondary); font-size: 0.95rem; }
.welcome-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 2px;
}
.welcome-status { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.85rem; margin-top: 6px; }
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }

.welcome-quick-stats { display: flex; gap: 12px; z-index: 1; }
.quick-stat {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}
.quick-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.quick-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.quick-stat.accent .quick-stat-value { color: var(--green); }

.welcome-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all var(--transition);
    white-space: nowrap;
    z-index: 1;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.welcome-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.welcome-cta svg { width: 18px; height: 18px; }


/* ═══════════ METRIC CARDS ═══════════ */
.db-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 24px 28px 0;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.metric-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent);
}
.metric-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.metric-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: rgba(var(--accent), 0.1);
    flex-shrink: 0;
}
.metric-icon { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.metric-icon svg { width: 22px; height: 22px; }
.metric-info { flex: 1; }
.metric-label { display: block; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.metric-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}
.metric-value.date-val { font-size: 1.4rem; }
.metric-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.metric-trend svg { width: 14px; height: 14px; }
.metric-trend.up { color: var(--green); background: rgba(6,214,160,0.1); }
.metric-trend.down { color: var(--green); background: rgba(6,214,160,0.1); }
.metric-trend.neutral { color: var(--orange); background: rgba(247,127,0,0.1); }


/* ═══════════ QUICK ACTION CARDS ═══════════ */
.db-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 28px 0;
}
.qa-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
}
.qa-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.12); box-shadow: var(--shadow); }
.qa-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(0,180,216,0.12);
    color: var(--blue);
    flex-shrink: 0;
}
.qa-icon svg { width: 20px; height: 20px; }
.qa-icon.completed { background: rgba(6,214,160,0.12); color: var(--green); }
.qa-icon.upcoming { background: rgba(247,127,0,0.12); color: var(--orange); }
.qa-icon.saved { background: rgba(217,4,41,0.12); color: var(--red); }

.qa-info h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.qa-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.qa-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.qa-sub svg { width: 14px; height: 14px; color: var(--green); }


/* ═══════════ SHARED CARD STYLES ═══════════ */
.db-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.card-badge.good { background: rgba(6,214,160,0.12); color: var(--green); }
.card-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(217,4,41,0.3);
    transition: all var(--transition);
}
.card-action-btn:hover { background: var(--accent); color: #fff; }
.card-action-btn svg { width: 14px; height: 14px; }


/* ═══════════ CHARTS ROW ═══════════ */
.db-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px 28px 0;
}
.chart-card.wide { min-height: 360px; }

.chart-tabs { display: flex; gap: 4px; background: var(--bg-input); border-radius: 8px; padding: 3px; }
.chart-tab {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all var(--transition);
}
.chart-tab.active { background: var(--accent); color: #fff; }
.chart-tab:hover:not(.active) { color: var(--text-primary); }

.chart-container { position: relative; width: 100%; height: 220px; margin-bottom: 12px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

.chart-legend { display: flex; gap: 20px; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }


/* ── GAUGE ── */
.gauge-container { display: flex; justify-content: center; margin-bottom: 16px; }
.gauge-svg { width: 200px; }
.gauge-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; fill: var(--text-primary); }
.gauge-label { font-size: 0.65rem; fill: var(--green); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }

.health-details { display: flex; flex-direction: column; gap: 10px; }
.health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
}
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.health-item span:nth-child(2) { flex: 1; color: var(--text-secondary); }
.health-val { font-weight: 700; font-family: var(--font-display); }


/* ═══════════ SPLIT ROW (Vehicles + Appointments) ═══════════ */
.db-split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 28px 0;
}

/* ── Vehicles ── */
.vehicle-list { display: flex; flex-direction: column; gap: 14px; }
.vehicle-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.vehicle-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.vehicle-item.active-vehicle { border-color: rgba(217,4,41,0.2); background: rgba(217,4,41,0.04); }
.vehicle-img-wrap {
    width: 90px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.vehicle-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-info { flex: 1; }
.vehicle-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.vehicle-plate { font-size: 0.75rem; color: var(--accent); font-weight: 700; letter-spacing: 1px; backdrop-filter: none; }
.vehicle-meta { display: flex; gap: 14px; margin-top: 6px; }
.vehicle-meta span { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-muted); }
.vehicle-meta svg { width: 13px; height: 13px; }
.vehicle-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    white-space: nowrap;
}
.vehicle-status.active { color: var(--accent); background: rgba(217,4,41,0.1); }

/* ── Appointments ── */
.appointments-list { display: flex; flex-direction: column; gap: 14px; }
.appointment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.appointment-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.appt-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(217,4,41,0.08);
    border: 1px solid rgba(217,4,41,0.15);
    flex-shrink: 0;
}
.appt-day { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--accent); }
.appt-month { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.appt-info { flex: 1; }
.appt-info h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.appt-vehicle, .appt-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.appt-vehicle svg, .appt-time svg { width: 12px; height: 12px; }
.appt-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.appt-status.confirmed { background: rgba(6,214,160,0.12); color: var(--green); }
.appt-status.pending { background: rgba(247,127,0,0.12); color: var(--orange); }


/* ═══════════ SERVICE HISTORY TABLE ═══════════ */
.table-card { padding: 24px; margin: 20px 28px 0; }
.table-controls { display: flex; align-items: center; gap: 12px; }
.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 14px;
}
.table-search svg { width: 14px; height: 14px; color: var(--text-muted); }
.table-search input { background: none; border: none; outline: none; color: var(--text-primary); font-size: 0.82rem; width: 160px; }
.table-search input::placeholder { color: var(--text-muted); }

.table-responsive { overflow-x: auto; }
.db-table {
    width: 100%;
    border-collapse: collapse;
}
.db-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.db-table td {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.db-table tbody tr { transition: background var(--transition); }
.db-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.db-table td strong { color: var(--text-primary); }

.tech-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tech-cell img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.table-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}
.table-badge.completed { background: rgba(6,214,160,0.12); color: var(--green); }
.table-badge.pending { background: rgba(247,127,0,0.12); color: var(--orange); }
.table-badge.cancelled { background: rgba(217,4,41,0.12); color: var(--red); }


/* ═══════════ TRIPLE ROW (Donut + Activity + Loyalty) ═══════════ */
.db-triple-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px 28px 0;
}

/* ── Donut Chart ── */
.donut-container { display: flex; justify-content: center; margin-bottom: 20px; }
.donut-svg { width: 180px; height: 180px; }
.donut-total { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; fill: var(--text-primary); }
.donut-label { font-size: 0.6rem; fill: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.donut-segment { transition: stroke-dasharray 1s ease; }

.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.donut-legend-item span {
    width: 10px; height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Activity Feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.activity-item:hover { background: rgba(255,255,255,0.02); }
.activity-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.activity-icon svg { width: 16px; height: 16px; }
.activity-content p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; }
.activity-content strong { color: var(--text-primary); }
.activity-time { font-size: 0.7rem; color: var(--text-muted); }

/* ── Loyalty Card ── */
.loyalty-card { text-align: center; }
.loyalty-ring-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.loyalty-ring { width: 140px; height: 140px; }
.loyalty-points { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; fill: var(--text-primary); }
.loyalty-label { font-size: 0.6rem; fill: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }
.loyalty-progress { transition: stroke-dashoffset 1.5s ease; }

.loyalty-tier { margin-bottom: 20px; }
.tier-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 6px;
}
.tier-badge.gold { background: linear-gradient(135deg, #f77f00, #fca311); color: #1a1a1a; }
.loyalty-tier p { font-size: 0.8rem; color: var(--text-muted); }

.loyalty-perks { display: flex; flex-direction: column; gap: 8px; }
.perk {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    justify-content: center;
}
.perk svg { width: 16px; height: 16px; color: var(--accent); }


/* ═══════════ FOOTER ═══════════ */
.db-footer {
    margin-top: auto;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.db-footer-links { display: flex; gap: 20px; }
.db-footer-links a { color: var(--text-muted); transition: color var(--transition); }
.db-footer-links a:hover { color: var(--text-primary); }


/* ═══════════ ANIMATIONS ═══════════ */

/* ── PAGE SYSTEM ── */
.db-page { display: none; animation: pageFadeIn 0.4s ease both; }
.db-page.active { display: block; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
    margin-bottom: 4px;
}
.page-title-bar h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── VEHICLE GRID (Vehicles Page) ── */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: 24px;
    padding: 20px 28px 0;
}
.vehicle-detail-card { padding: 0; overflow: hidden; }
.vdc-image { position: relative; height: 200px; overflow: hidden; }
.vdc-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.vehicle-detail-card:hover .vdc-image img { transform: scale(1.05); }
.vdc-badge {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
}
.vdc-badge.primary { background: var(--accent-glow); color: var(--accent); }
.vdc-body { padding: 20px 24px 24px; }
.vdc-body h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.vdc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.vdc-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
}
.vdc-stat svg { width: 14px; height: 14px; color: var(--text-muted); }
.vdc-health-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}
.vdc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── APPOINTMENT TIMELINE (Appointments Page) ── */
.appt-full-list { margin: 20px 28px 0; }
.appt-timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 28px; }
.appt-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-marker {
    position: absolute;
    left: -28px;
    top: 20px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    z-index: 2;
}
.timeline-marker.confirmed { background: var(--green); box-shadow: 0 0 10px rgba(6,214,160,0.4); }
.timeline-marker.pending { background: var(--orange); box-shadow: 0 0 10px rgba(247,127,0,0.4); }
.timeline-marker.done { background: var(--blue); }
.timeline-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.timeline-card:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
.timeline-item.past .timeline-card { opacity: 0.5; }
.appt-right {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.appt-cost { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-primary); }

/* ── TABLE FILTER ── */
.table-filter {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 14px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}
.table-filter option { background: var(--bg-card); }

/* ── ANALYTICS BARS ── */
.analytics-bars { display: flex; flex-direction: column; gap: 16px; }
.a-bar-item { display: flex; align-items: center; gap: 12px; }
.a-bar-label { font-size: 0.82rem; color: var(--text-secondary); min-width: 100px; }
.a-bar-track { flex: 1; height: 10px; background: rgba(255,255,255,0.04); border-radius: 10px; overflow: hidden; }
.a-bar-fill { height: 100%; border-radius: 10px; transition: width 1s ease; }
.a-bar-val { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); min-width: 36px; text-align: right; }

/* ── ANALYTICS VEHICLE COMPARE ── */
.analytics-vehicle-compare { display: flex; flex-direction: column; gap: 16px; }
.avc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
}
.avc-item img { width: 60px; height: 40px; border-radius: var(--radius-xs); object-fit: cover; }
.avc-info { flex: 1; }
.avc-info h4 { font-size: 0.9rem; font-weight: 600; }
.avc-info span { font-size: 0.78rem; color: var(--text-muted); }
.avc-ring { position: relative; width: 50px; height: 50px; }
.avc-ring svg { width: 100%; height: 100%; }
.avc-ring span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 0.7rem; font-weight: 700; }

/* ── MONTHLY COMPARISON ── */
.month-compare { display: flex; flex-direction: column; gap: 14px; }
.mc-row { display: flex; align-items: center; gap: 12px; }
.mc-row > span:first-child { font-size: 0.82rem; color: var(--text-secondary); min-width: 130px; }
.mc-row > span:last-child { font-size: 0.85rem; font-weight: 700; min-width: 50px; text-align: right; }
.mc-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.04); border-radius: 10px; overflow: hidden; }
.mc-bar > div { height: 100%; border-radius: 10px; transition: width 1s ease; }

/* ── MESSAGES PAGE ── */
.messages-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    padding: 20px 28px 0;
    min-height: 500px;
}
.msg-sidebar-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.msg-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.msg-search svg { width: 16px; height: 16px; color: var(--text-muted); }
.msg-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
}
.msg-list { flex: 1; overflow-y: auto; }
.msg-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.msg-item:hover { background: rgba(255,255,255,0.03); }
.msg-item.active { background: rgba(217,4,41,0.06); border-left: 3px solid var(--accent); }
.msg-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-avatar-system {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(247,127,0,0.12); color: var(--orange); flex-shrink: 0;
}
.msg-avatar-system svg { width: 18px; height: 18px; }
.msg-preview { flex: 1; min-width: 0; }
.msg-preview h4 { font-size: 0.85rem; font-weight: 600; display: flex; justify-content: space-between; }
.msg-preview h4 .msg-time { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); }
.msg-preview p { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-unread {
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.msg-chat-card { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.chat-header img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.chat-header h4 { font-size: 0.9rem; }
.chat-header span { font-size: 0.75rem; color: var(--green); }
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.chat-msg.received {
    background: rgba(255,255,255,0.04);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.chat-msg.sent {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.chat-time { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }
.chat-msg.sent .chat-time { color: rgba(255,255,255,0.6); }
.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.chat-input input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 18px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-send {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    border-radius: 50%;
    transition: all var(--transition);
}
.chat-send:hover { transform: scale(1.1); }
.chat-send svg { width: 16px; height: 16px; color: #fff; }

/* ── SETTINGS PAGE ── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 28px 0;
}
.settings-section { display: flex; flex-direction: column; }
.settings-profile-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.settings-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.form-group input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--accent); }

.settings-toggles { display: flex; flex-direction: column; gap: 4px; }
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.setting-row h4 { font-size: 0.9rem; font-weight: 600; }
.setting-row p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.toggle-switch { position: relative; width: 46px; height: 24px; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.payment-methods { display: flex; flex-direction: column; gap: 14px; }
.payment-card {
    padding: 20px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(217,4,41,0.15) 0%, rgba(0,180,216,0.08) 100%);
    border: 1px solid rgba(217,4,41,0.2);
    position: relative;
}
.payment-card.secondary-payment {
    background: rgba(255,255,255,0.02);
    border-color: var(--border);
}
.pc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pc-top svg { width: 24px; height: 24px; color: var(--text-muted); }
.pc-type { font-size: 0.75rem; font-weight: 800; letter-spacing: 2px; color: var(--text-muted); }
.pc-number { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: 3px; display: block; margin-bottom: 12px; }
.pc-bottom { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
.pc-default {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
}
.add-payment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition);
    cursor: pointer;
    background: none;
}
.add-payment-btn:hover { border-color: var(--accent); color: var(--accent); }
.add-payment-btn svg { width: 16px; height: 16px; }

.danger-zone { border-color: rgba(217,4,41,0.2); }
.danger-zone .card-header h2 { color: var(--red); }
.danger-btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: rgba(217,4,41,0.1);
    color: var(--red);
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid rgba(217,4,41,0.3);
    transition: all var(--transition);
    cursor: pointer;
}
.danger-btn:hover { background: var(--red); color: #fff; }


@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes countUp {
    from { opacity: 0; }
    to { opacity: 1; }
}

.db-welcome { animation: fadeInUp 0.6s ease both; }
.metric-card { animation: fadeInUp 0.6s ease both; }
.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

.qa-card { animation: fadeInUp 0.6s ease both; }
.qa-card:nth-child(1) { animation-delay: 0.15s; }
.qa-card:nth-child(2) { animation-delay: 0.25s; }
.qa-card:nth-child(3) { animation-delay: 0.35s; }
.qa-card:nth-child(4) { animation-delay: 0.45s; }

.db-card { animation: fadeInUp 0.6s ease both; animation-delay: 0.2s; }


/* ═══════════ RTL SUPPORT ═══════════ */
html[dir="rtl"] .db-sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--border); }
html[dir="rtl"] .db-main { margin-left: 0; margin-right: var(--sidebar-w); }
html[dir="rtl"] .db-sidebar.collapsed ~ .db-main { margin-left: 0; margin-right: var(--sidebar-w-collapsed); }
html[dir="rtl"] .sidebar-link svg { margin-right: 0; }
html[dir="rtl"] .sidebar-badge { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .db-sidebar.collapsed .sidebar-link::after { left: auto; right: calc(100% + 12px); }
html[dir="rtl"] .db-header { direction: rtl; }
html[dir="rtl"] .db-search { direction: ltr; }
html[dir="rtl"] .header-user { direction: rtl; }
html[dir="rtl"] .stat-spark { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .table-responsive { direction: ltr; }
html[dir="rtl"] .db-footer { direction: rtl; }


/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1200px) {
    .db-metrics { grid-template-columns: repeat(2, 1fr); }
    .db-quick-actions { grid-template-columns: repeat(2, 1fr); }
    .db-triple-row { grid-template-columns: 1fr 1fr; }
    .db-triple-row .loyalty-card { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
    .db-sidebar { transform: translateX(-100%); }
    .db-sidebar.open { transform: translateX(0); }
    html[dir="rtl"] .db-sidebar { transform: translateX(100%); }
    html[dir="rtl"] .db-sidebar.open { transform: translateX(0); }
    .db-main { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; }
    .db-charts-row { grid-template-columns: 1fr; }
    .db-split-row { grid-template-columns: 1fr; }
    .db-search { width: 220px; }
    .messages-layout { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .db-metrics { grid-template-columns: 1fr 1fr; }
    .db-quick-actions { grid-template-columns: 1fr 1fr; }
    .db-triple-row { grid-template-columns: 1fr; }
    .db-welcome { flex-direction: column; align-items: flex-start; gap: 16px; }
    .welcome-content { flex-direction: column; gap: 16px; }
    .db-header { padding: 0 16px; }
    .db-search { display: none; }
    .header-user-info { display: none; }
    .db-welcome, .db-metrics, .db-quick-actions, .db-charts-row, .db-split-row, .db-triple-row { padding-left: 16px; padding-right: 16px; margin-left: 0; margin-right: 0; }
    .table-card { margin-left: 16px; margin-right: 16px; }
    .vehicle-grid { padding: 16px; }
    .page-title-bar { padding: 16px 16px 0; }
    .appt-full-list { margin: 16px; }
    .messages-layout { padding: 16px; min-height: 400px; }
    .settings-grid { padding: 16px; }
    .vdc-stats { grid-template-columns: 1fr; }
    .chat-msg { max-width: 85%; }
    .welcome-cta { padding: 12px 20px; font-size: 0.85rem; }
    .welcome-name { font-size: 1.5rem; }
    .metric-card { padding: 16px; gap: 10px; }
    .metric-icon { width: 42px; height: 42px; }
    .metric-value { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .db-metrics { grid-template-columns: 1fr; }
    .db-quick-actions { grid-template-columns: 1fr; }
    .welcome-quick-stats { flex-direction: row; flex-wrap: wrap; }
    .welcome-quick-stats .quick-stat { flex: 1; min-width: 80px; padding: 10px 14px; }
    .quick-stat-value { font-size: 1.2rem; }
    .db-welcome { margin: 16px 16px 0; padding: 20px; }
    .welcome-name { font-size: 1.3rem; }
    .welcome-cta { width: 100%; justify-content: center; }
    .db-header { height: auto; min-height: var(--header-h); padding: 8px 16px; }
    .metric-card { padding: 14px; }
    .metric-value { font-size: 1.15rem; }
    .metric-label { font-size: 0.7rem; }
}

/* ═══════════════════════════════════════════════════════════
   LIGHT THEME — Dashboard 1
   ═══════════════════════════════════════════════════════════ */
.theme-light {
    --bg-body: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fa;
    --bg-header: rgba(255, 255, 255, 0.92);
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-welcome: linear-gradient(135deg, #e8f4fd 0%, #f0f6ff 40%, #ffffff 100%);
    --text-primary: #0c0f14;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.theme-light body {
    background: var(--bg-body);
    color: var(--text-primary);
}

/* Sidebar */
.theme-light .db-sidebar {
    background: var(--bg-sidebar);
    border-right-color: var(--border);
}
.theme-light .sidebar-logo {
    border-bottom-color: var(--border);
}
.theme-light .sidebar-link {
    color: var(--text-secondary);
}
.theme-light .sidebar-link:hover,
.theme-light .sidebar-link.active {
    background: rgba(217, 4, 41, 0.06);
    color: var(--accent);
}
.theme-light .sidebar-footer {
    border-top-color: var(--border);
}

/* Header */
.theme-light .db-header {
    background: var(--bg-header);
    border-bottom-color: var(--border);
}
.theme-light .db-search {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-primary);
}
.theme-light .db-search input {
    color: var(--text-primary);
}
.theme-light .db-search input::placeholder {
    color: var(--text-muted);
}
.theme-light .header-icon-btn {
    color: var(--text-secondary);
}
.theme-light .header-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}
.theme-light .header-user-name {
    color: var(--text-primary);
}
.theme-light .header-user-role {
    color: var(--text-muted);
}

/* Main content */
.theme-light .db-main {
    background: var(--bg-body);
}
.theme-light .db-content {
    background: var(--bg-body);
}

/* Welcome banner */
.theme-light .db-welcome {
    background: var(--bg-welcome);
    border-color: var(--border);
}
.theme-light .welcome-name {
    color: #0c0f14;
}
.theme-light .welcome-sub {
    color: var(--text-secondary);
}
.theme-light .quick-stat-label {
    color: var(--text-muted);
}
.theme-light .quick-stat-value {
    color: var(--text-primary);
}

/* Cards */
.theme-light .metric-card,
.theme-light .db-card,
.theme-light .action-card {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: var(--shadow);
}
.theme-light .metric-card:hover,
.theme-light .action-card:hover {
    background: var(--bg-card-hover);
}
.theme-light .metric-value {
    color: var(--text-primary);
}
.theme-light .metric-label {
    color: var(--text-muted);
}
.theme-light .metric-change {
    background: rgba(6, 214, 160, 0.1);
}

/* Tables */
.theme-light .db-table th {
    background: #f7f8fa;
    color: var(--text-muted);
    border-bottom-color: var(--border);
}
.theme-light .db-table td {
    border-bottom-color: var(--border);
    color: var(--text-primary);
}
.theme-light .db-table tr:hover td {
    background: #f5f7fa;
}

/* Section headings */
.theme-light .db-section-title {
    color: var(--text-primary);
}
