/* ============================================
   RentCar Pro — Styles
   ============================================ */

:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: rgba(255,255,255,0.07);
    --body-bg: #f3f4f6;
    --card-radius: 10px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--body-bg); color: #1f2937; }

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width .25s ease;
    overflow: hidden;
}

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
}
.sidebar-brand i { font-size: 1.4rem; color: var(--primary); flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-section {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: #6b7280;
    padding: 16px 10px 6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: .9rem;
    transition: all .15s;
    white-space: nowrap;
}
.nav-item i { font-size: 1.05rem; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.user-info { display: flex; align-items: center; gap: 8px; color: #d1d5db; font-size: .85rem; white-space: nowrap; overflow: hidden; }
.user-info i { font-size: 1.1rem; flex-shrink: 0; }
.btn-logout { color: #6b7280; text-decoration: none; font-size: 1.1rem; }
.btn-logout:hover { color: #ef4444; }

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}
.main-content.expanded { margin-left: 60px; }

/* ========== TOPBAR ========== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-weight: 600; color: #374151; font-size: .95rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ========== PAGE CONTENT ========== */
.page-content { padding: 24px; }

/* ========== CARDS ========== */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
    font-size: .95rem;
}

/* ========== STAT CARDS ========== */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #1d4ed8; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-label { font-size: .8rem; color: #6b7280; margin-bottom: 2px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #111827; }

/* ========== TABLES ========== */
.table { font-size: .88rem; }
.table th { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; border-bottom-width: 1px; }
.table-hover tbody tr:hover { background: #f9fafb; }

/* ========== BADGES ========== */
.badge { font-weight: 500; font-size: .75rem; }

/* ========== FORMS ========== */
.form-label { font-weight: 500; font-size: .88rem; color: #374151; }
.form-control, .form-select { font-size: .9rem; border-color: #d1d5db; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.form-section { background: #f9fafb; border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.form-section-title { font-weight: 600; color: #374151; font-size: .9rem; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ========== BUTTONS ========== */
.btn { font-size: .88rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ========== VEHICLE CARD ========== */
.vehicle-card {
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: box-shadow .2s;
}
.vehicle-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.vehicle-card-img {
    height: 160px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.vehicle-card-img img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card-img i { font-size: 4rem; color: #d1d5db; }
.vehicle-card-body { padding: 14px 16px; }
.vehicle-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.vehicle-card-sub { font-size: .8rem; color: #6b7280; margin-bottom: 10px; }
.vehicle-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: #6b7280; }
.vehicle-card-footer { padding: 10px 16px; border-top: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }

/* ========== PROGRESS / KM ========== */
.km-bar { height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.km-bar-fill { height: 100%; background: var(--primary); border-radius: 99px; }

/* ========== ALERTE DOC ========== */
.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.doc-row:last-child { border-bottom: none; }

/* ========== LOGIN ========== */
.login-page { min-height: 100vh; background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h1 { font-size: 1.4rem; font-weight: 700; margin-top: 8px; }
.login-logo p { color: #6b7280; font-size: .85rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stat-card { padding: 14px; }
}
