/* ============================================================
   FleetManager Pro — Stylesheet
   ============================================================ */

:root {
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-w:    220px;
    --sidebar-bg:   #1e293b;
    --topbar-h:     54px;
    --radius:       8px;
    --shadow:       0 1px 4px rgba(0,0,0,.08);
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: .875rem;
    background: #f4f6f9;
    color: #1e293b;
}

a { color: var(--primary); }

/* ── Layout wrapper ───────────────────────────────────────── */
#wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-column: column;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .2s;
}

/* ── Sidebar Brand ───────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.1rem 1.1rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand .brand-name {
    font-weight: 800;
    font-size: .95rem;
    color: #fff;
    letter-spacing: -.01em;
}
.sidebar-brand .brand-ver {
    font-size: .62rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ── Nav ─────────────────────────────────────────────────── */
.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: .75rem .7rem;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav li { margin-bottom: 1px; }

.sidebar-nav .nav-section {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem .4rem .3rem;
    font-size: .61rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    font-weight: 700;
}
.sidebar-nav .nav-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.06);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .48rem .75rem;
    border-radius: 7px;
    color: #94a3b8;
    text-decoration: none;
    font-size: .81rem;
    font-weight: 500;
    transition: background .12s, color .12s, border-color .12s;
    border-left: 2px solid transparent;
}
.sidebar-nav a .nav-icon {
    width: 18px; text-align: center; flex-shrink: 0;
    font-size: .9rem; opacity: .8;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.06);
    color: #e2e8f0;
    border-left-color: rgba(255,255,255,.15);
}
.sidebar-nav a.active {
    background: rgba(37,99,235,.18);
    color: #93c5fd;
    border-left-color: #3b82f6;
    font-weight: 600;
}
.sidebar-nav a.active .nav-icon { opacity: 1; }

/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: .85rem .9rem;
}
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .6rem;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    margin-bottom: .6rem;
}
.sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 9px;
    color: #fff;
    font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.user-name  { color: #e2e8f0; font-size: .79rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .1rem .4rem;
    border-radius: 4px;
    margin-top: .1rem;
}
.sidebar-user-actions { display: flex; gap: .4rem; }
.sidebar-action-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: .3rem;
    padding: .32rem .4rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 500;
    text-decoration: none;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,.1);
    transition: background .12s, color .12s;
}
.sidebar-action-btn:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.sidebar-action-logout { border-color: rgba(220,38,38,.35); color: #fca5a5; }
.sidebar-action-logout:hover { background: rgba(220,38,38,.2); color: #fca5a5; border-color: #dc2626; }

/* ── Top bar ──────────────────────────────────────────────── */
#page-content-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky; top: 0; z-index: 100;
}
.topbar .btn-toggle {
    background: none; border: 1px solid #e2e8f0;
    border-radius: 6px; padding: .3rem .5rem;
    cursor: pointer; color: #64748b; line-height: 1;
}
.topbar .btn-toggle:hover { background: #f1f5f9; }
.topbar .breadcrumb { margin: 0; padding: 0; background: none; font-size: .8rem; flex: 1; }
.topbar .breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }
.topbar .breadcrumb-item a { color: #64748b; text-decoration: none; }
.topbar .breadcrumb-item.active { color: #1e293b; font-weight: 500; }

/* ── Page content area ────────────────────────────────────── */
.page-body,
#page-content-wrapper .container-fluid { padding: 1.25rem; flex: 1; }

/* Flash alerts inside page-body */
.flash-zone { margin-bottom: 1rem; }
.flash-zone .alert { border-radius: var(--radius); font-size: .83rem; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.1rem;
}
.page-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex; align-items: center; gap: .4rem;
}
.page-header h4 i { color: var(--primary); }
.page-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #dbeafe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ── Row action buttons ───────────────────────────────────── */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.action-buttons .btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: .85rem;
}
.action-divider {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    margin: 0 .1rem;
}

/* ── Welcome banner ───────────────────────────────────────── */
.welcome-banner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.welcome-banner h5 { margin: 0; font-weight: 700; font-size: 1rem; }
.welcome-banner p  { margin: 0; color: #64748b; font-size: .8rem; }

/* ── KPI cards ────────────────────────────────────────────── */
.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.kpi-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.kpi-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.kpi-icon.green  { background: #dcfce7; color: #16a34a; }
.kpi-icon.orange { background: #ffedd5; color: #ea580c; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.teal   { background: #ccfbf1; color: #0d9488; }
.kpi-icon.red    { background: #fee2e2; color: #dc2626; }

/* ── Manager KPI cards ───────────────────────────────────── */
.kpi-card-manager {
    border-radius: var(--radius);
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}
.kpi-card-manager:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.1) !important;
}

/* ── Admin KPI cards ─────────────────────────────────────── */
.admin-kpi-card {
    border-radius: var(--radius);
    border-left-width: 3px !important;
    border-left-style: solid !important;
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}
.admin-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1) !important;
}

.kpi-body { min-width: 0; }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: #0f172a; }
.kpi-label { font-size: .72rem; color: #64748b; margin-top: 2px; white-space: nowrap; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: .7rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: #0f172a;
    display: flex; align-items: center; gap: .4rem;
}
.card-header i { color: var(--primary); }
.card-body { padding: 1rem; }

/* ── Cartão de funcionário (employee badge) ──────────────────── */
.employee-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    padding-top: .9rem;
}
.employee-card__hole {
    width: 38px; height: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin: 0 auto .6rem;
}
.employee-card__header {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--badge-color, var(--primary));
    padding-bottom: .6rem;
    border-bottom: 1px dashed #e2e8f0;
}
.employee-card__body {
    text-align: center;
    padding: 1rem 1rem .25rem;
}
.employee-card__photo {
    width: 78px; height: 78px;
    margin: 0 auto .65rem;
    border-radius: 50%;
    background: var(--badge-color, var(--primary));
    color: #fff;
    font-size: 1.7rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--badge-color, var(--primary)), 0 4px 14px rgba(0,0,0,.15);
}
.employee-card__name { font-weight: 700; margin-bottom: .35rem; }
.employee-card__role { font-size: .7rem; }
.employee-card__id {
    margin-top: .5rem;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #64748b;
}
.employee-card__divider {
    border-top: 1px dashed #e2e8f0;
    margin: .85rem 0;
}
.employee-card__details {
    text-align: left;
    display: flex; flex-direction: column; gap: .4rem;
    font-size: .8rem;
    color: #475569;
    padding-bottom: .9rem;
}
.employee-card__details i { width: 18px; color: var(--badge-color, var(--primary)); margin-right: .4rem; }
.employee-card__barcode {
    height: 16px;
    margin: .25rem 1.25rem 1rem;
    border-radius: 2px;
    background-image: repeating-linear-gradient(90deg,
        #1e293b 0 1px, transparent 1px 3px,
        #1e293b 3px 5px, transparent 5px 6px,
        #1e293b 6px 6.5px, transparent 6.5px 9px,
        #1e293b 9px 10px, transparent 10px 13px,
        #1e293b 13px 13.5px, transparent 13.5px 16px
    );
    opacity: .5;
}
.employee-card {
    transition: box-shadow .15s, transform .15s;
}
.employee-card:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

/* ── List groups ──────────────────────────────────────────── */
.list-group-item-action {
    border-left: 3px solid transparent;
    transition: background .12s, border-left-color .12s;
}
.list-group-item-action:hover {
    background: #f8fafc;
    border-left-color: var(--primary);
}

/* ── Tables ───────────────────────────────────────────────── */
.table { margin: 0; }
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 600;
    padding: .7rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.table tbody td {
    padding: .65rem 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fafc; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    font-size: .68rem;
    font-weight: 600;
    padding: .28em .6em;
    border-radius: 4px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn { border-radius: 6px; font-size: .82rem; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: .3rem .6rem; font-size: .78rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 6px;
    border-color: #e2e8f0;
    font-size: .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-label { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }

/* ── Avatars ──────────────────────────────────────────────── */
.avatar-sm {
    width: 30px; height: 30px;
    background: #dbeafe; color: #1d4ed8;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .72rem; flex-shrink: 0;
}
.avatar-lg {
    width: 64px; height: 64px;
    background: var(--primary); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.5rem;
}

/* ── Vehicle icon ─────────────────────────────────────────── */
.vehicle-icon-circle {
    width: 44px; height: 44px;
    background: #dbeafe; color: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}

/* Vehicle list */
.vehicles-page {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}
.operations-page {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}
.vehicles-header p {
    font-size: .82rem;
    margin-top: .2rem;
}
.operations-header p {
    font-size: .82rem;
    margin-top: .2rem;
}
.fleet-stat-card {
    min-height: 82px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: .95rem 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    box-shadow: var(--shadow);
}
.fleet-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.fleet-stat-icon.blue { background: #dbeafe; color: #1d4ed8; }
.fleet-stat-icon.green { background: #dcfce7; color: #15803d; }
.fleet-stat-icon.amber { background: #fef3c7; color: #b45309; }
.fleet-stat-icon.slate { background: #e2e8f0; color: #334155; }
.fleet-stat-value {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}
.fleet-stat-label {
    color: #64748b;
    font-size: .76rem;
    margin-top: .2rem;
    white-space: nowrap;
}
.filter-card .card-body {
    padding: .75rem;
}
.filter-card .input-group-text {
    background: #fff;
    color: #64748b;
    border-color: #e2e8f0;
}
.fleet-table-card .card-header {
    min-height: 46px;
}
.fleet-table th,
.fleet-table td {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}
.fleet-table tbody td {
    height: 56px;
}
.plate-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: .28rem .5rem;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a8a;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .04em;
}
.fleet-table-footer {
    margin: 0;
    border-top: 1px solid #f1f5f9;
}
.fleet-table-footer .dataTables_info,
.fleet-table-footer .dataTables_paginate {
    padding-top: .75rem;
    padding-bottom: .75rem;
}
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto .9rem;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.empty-state h5 {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.empty-state p {
    color: #64748b;
    font-size: .82rem;
    margin-bottom: 1rem;
}

/* ── Route timeline ───────────────────────────────────────── */
.route-timeline { padding-left: 1.5rem; position: relative; }
.route-timeline::before {
    content: '';
    position: absolute; left: 7px; top: 14px; bottom: 14px;
    width: 2px; background: #e2e8f0;
}
.route-point { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.route-point:last-child { margin-bottom: 0; }
.route-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px currentColor;
    flex-shrink: 0;
    margin-top: 3px;
    position: relative; left: -28px;
}
.route-label { margin-left: -14px; }
.route-label .point-type { font-size: .7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.route-label .point-name { font-weight: 600; color: #0f172a; }
.route-label .point-time { font-size: .75rem; color: #64748b; }

/* ── Login page ───────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg,#0f172a 0%,#1e3a8a 55%,#312e81 100%);
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    position: relative; overflow: hidden;
}
body.login-page::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 60% 70% at 85% 15%, rgba(37,99,235,.35) 0%, transparent 60%),
        radial-gradient(ellipse 45% 55% at 8% 90%, rgba(124,58,237,.22) 0%, transparent 55%);
}
.login-wrap {
    width: 100%; max-width: 400px; padding: 1rem;
    position: relative; z-index: 1;
}
.login-card {
    background: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06);
}
.login-top {
    background: linear-gradient(135deg,#2563eb,#1d4ed8 70%,#1e3a8a);
    padding: 2.25rem 1.5rem 1.75rem;
    text-align: center; color: #fff;
}
.login-top .login-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.55rem; margin-bottom: .85rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.login-top h1 { font-size: 1.35rem; font-weight: 800; margin: 0 0 .2rem; letter-spacing: -.01em; }
.login-top p  { margin: 0; font-size: .8rem; opacity: .8; }
.login-body   { padding: 1.75rem 1.5rem; }
.login-foot   { background: #f8fafc; border-top: 1px solid #e2e8f0; padding: .75rem 1rem; text-align: center; }

/* ── DataTables overrides ─────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e2e8f0; border-radius: 6px; padding: .3rem .6rem; font-size: .82rem;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #e2e8f0; border-radius: 6px; padding: .25rem .5rem; font-size: .82rem;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { font-size: .78rem; padding: .6rem 1rem; }
.dataTables_wrapper .paginate_button { border-radius: 5px !important; }

/* ── Misc ─────────────────────────────────────────────────── */
.font-monospace { font-family: 'Courier New', monospace; letter-spacing: .03em; }
.text-muted { color: #94a3b8 !important; }
hr { border-color: #f1f5f9; }

/* ── Print ────────────────────────────────────────────────── */
@media print {
    #sidebar, .topbar, .btn, .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
}

/* ── Vehicle cards (grid view) ────────────────────────────── */
.vehicle-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.vehicle-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .15s;
}
.vehicle-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.vehicle-card-photo {
    height: 165px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.vehicle-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.vehicle-card:hover .vehicle-card-photo img { transform: scale(1.04); }
.vehicle-card-photo-placeholder {
    color: #cbd5e1;
    font-size: 3rem;
}
.vehicle-card-status {
    position: absolute;
    top: .5rem;
    right: .5rem;
}
.vehicle-card-body {
    padding: .85rem 1rem .6rem;
    flex: 1;
}
.vehicle-card-plate {
    display: inline-flex;
    align-items: center;
    padding: .22rem .55rem;
    border: 1.5px solid #bfdbfe;
    border-radius: 5px;
    background: #eff6ff;
    color: #1e3a8a;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}
.vehicle-card-name {
    font-weight: 700;
    font-size: .97rem;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: .2rem;
}
.vehicle-card-meta {
    font-size: .75rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .6rem;
    margin-bottom: .5rem;
}
.vehicle-card-stats {
    display: flex;
    gap: 1rem;
    font-size: .75rem;
    color: #475569;
    border-top: 1px solid #f1f5f9;
    padding-top: .5rem;
    margin-top: .1rem;
}
.vehicle-card-stats span { display: flex; align-items: center; gap: .3rem; }
.vehicle-card-value {
    font-size: .75rem;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: .2rem .55rem;
    display: inline-flex;
    align-items: center;
    margin-top: .35rem;
}
.vehicle-card-footer {
    padding: .5rem 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
}
/* View toggle buttons */
.view-toggle .btn { padding: .3rem .55rem; }
.view-toggle .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Photo preview in forms */
.photo-preview-wrap { position: relative; display: inline-block; }
.photo-preview-wrap img { max-height: 140px; border-radius: var(--radius); border: 1px solid #e2e8f0; }

/* ── Sidebar collapsed (desktop) ──────────────────────────── */
@media (min-width: 769px) {
    #sidebar.collapsed { width: 56px; }
    #sidebar.collapsed .brand-text,
    #sidebar.collapsed .nav-section,
    #sidebar.collapsed .sidebar-nav a span:not(.nav-icon),
    #sidebar.collapsed .sidebar-user-info,
    #sidebar.collapsed .sidebar-user-actions { display: none !important; }
    #sidebar.collapsed .sidebar-brand { justify-content: center; padding: .85rem .5rem; }
    #sidebar.collapsed .sidebar-nav a { justify-content: center; padding: .5rem; border-left: none; }
    #sidebar.collapsed .sidebar-nav a .nav-icon { width: auto; }
    #sidebar.collapsed .sidebar-footer { padding: .6rem .5rem; }
    #sidebar.collapsed .sidebar-user-card { justify-content: center; background: transparent; padding: .3rem; }
    #sidebar.collapsed .sidebar-user-avatar { border-radius: 50%; }
}

/* ── Mobile sidebar backdrop ──────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
}
.sidebar-backdrop.show { display: block; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed; z-index: 999;
        transform: translateX(-100%); transition: transform .25s;
    }
    #sidebar.open { transform: translateX(0); }
    body.sidebar-open { overflow: hidden; }
    .kpi-value { font-size: 1.3rem; }
}
