/* Fleet Tracking Platform - Professional UI */

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

:root {
    --sidebar-w: 56px;
    --sidebar-expanded: 220px;
    --header-h: 56px;
    --accent: #4f6ef7;
    --accent-light: #eef2ff;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --orange: #f97316;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-800: #374151;
    --gray-700: #4b5563;
    --gray-600: #6b7280;
    --gray-500: #9ca3af;
    --gray-400: #d1d5db;
    --gray-300: #e5e7eb;
    --gray-200: #f3f4f6;
    --gray-100: #f9fafb;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    font-size: 13px;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-expanded);
    height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s;
}

.sidebar-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    border-bottom: 1px solid var(--gray-800);
}

.sidebar-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}

.sidebar-header i { color: var(--accent); font-size: 18px; }

.sidebar .form-select {
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    color: var(--gray-400);
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 5px;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 8px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.12s;
    white-space: nowrap;
}

.sidebar-nav li a:hover {
    background: var(--gray-900);
    color: var(--gray-300);
}

.sidebar-nav li.active a {
    background: var(--accent);
    color: var(--white);
}

.sidebar-nav li a i {
    width: 18px;
    margin-right: 9px;
    font-size: 12px;
    text-align: center;
}

.sidebar-nav li a .badge {
    margin-left: auto;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
}

.sidebar-nav .nav-section {
    padding: 14px 10px 4px;
    font-size: 9.5px;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--gray-800);
}

.user-info {
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== MAIN ===== */
.main-content {
    margin-left: var(--sidebar-expanded);
    min-height: 100vh;
    padding: 20px;
}

.topbar {
    display: none;
    background: var(--white);
    padding: 12px 16px;
    margin: -20px -20px 16px;
    border-bottom: 1px solid var(--gray-300);
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.page-header h1 i {
    color: var(--accent);
    margin-right: 6px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--gray-300);
    transition: border-color 0.15s;
}

.stat-card:hover { border-color: var(--accent); }

.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ===== MAP ===== */
.map-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-300);
}

#map { height: 460px; width: 100%; }
.map-fullscreen #map { height: calc(100vh - 60px); }

/* ===== VEHICLE LIST ===== */
.vehicle-list {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.vehicle-list .p-3 { padding: 10px 12px !important; }

.vehicle-item {
    padding: 9px 12px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: background 0.1s;
}

.vehicle-item:last-child { border-bottom: none; }
.vehicle-item:hover { background: var(--gray-100); }

.vehicle-item.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 9px;
}

.vehicle-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vehicle-info { flex: 1; min-width: 0; }

.vehicle-info .name {
    font-weight: 600;
    font-size: 12px;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-info .details {
    font-size: 10.5px;
    color: var(--gray-600);
    margin-top: 1px;
}

/* ===== TABLES ===== */
.data-table {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    overflow: hidden;
}

.data-table table { margin: 0; }

.data-table th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 10.5px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--gray-300);
}

.data-table td {
    padding: 9px 12px;
    font-size: 12.5px;
    vertical-align: middle;
    border-color: var(--gray-200);
}

.data-table tbody tr:hover { background: var(--gray-100); }

/* ===== BADGES ===== */
.alarm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: white;
}

/* ===== BUTTONS ===== */
.btn {
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 7px 14px;
}

.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #4059d4; border-color: #4059d4; }
.btn-sm { font-size: 11px; padding: 4px 9px; }
.btn-outline-primary { color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); color: white; }

/* ===== FORMS ===== */
.form-control, .form-select {
    font-size: 12.5px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    padding: 7px 10px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79,110,247,0.12);
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 3px;
}

/* ===== MODAL ===== */
.modal-content {
    border-radius: 10px;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-lg);
}
.modal-header { padding: 14px 18px; border-color: var(--gray-200); }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 18px; }
.modal-footer { padding: 10px 18px; border-color: var(--gray-200); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 12px; }
    .topbar { display: flex; }
    #map { height: 280px; }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.online-pulse { animation: pulse 2s infinite; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 2px; }
.sidebar ::-webkit-scrollbar-thumb { background: var(--gray-700); }

/* ===== LOGIN PAGE ===== */
.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-300);
}
.login-card h2 { font-size: 18px; font-weight: 700; color: var(--dark); }
