:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #eef2f6;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
}

body.dark-mode {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #1e293b;
    --text-dark: #f1f5f9;
    --text-light: #94a3b8;
    --white: #0f172a;
    --border: #334155;
    background-color: #020617;
}

body.dark-mode .card, 
body.dark-mode .sidebar, 
body.dark-mode .stat-card,
body.dark-mode .modal-container,
body.dark-mode .btn-icon {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode th {
    background-color: #0f172a;
    color: #cbd5e1;
}

body.dark-mode .icon-box.blue { background: rgba(67, 97, 238, 0.2); }
body.dark-mode .icon-box.green { background: rgba(16, 185, 129, 0.2); }
body.dark-mode .icon-box.orange { background: rgba(245, 158, 11, 0.2); }
body.dark-mode .icon-box.purple { background: rgba(139, 92, 246, 0.2); }

body.dark-mode .status-badge.available { background: rgba(16, 185, 129, 0.2); }
body.dark-mode .status-badge.rented { background: rgba(245, 158, 11, 0.2); }

body.dark-mode .action-btn.rent { background: rgba(67, 97, 238, 0.2); border-color: transparent; }
body.dark-mode .action-btn.return { background: rgba(16, 185, 129, 0.2); border-color: transparent; }
body.dark-mode .action-btn.delete { background: rgba(239, 68, 68, 0.2); border-color: transparent; }

body.dark-mode input, 
body.dark-mode select {
    background-color: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--secondary);
    color: var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.breadcrumbs {
    color: var(--text-light);
    font-size: 0.9rem;
}

.breadcrumbs .current {
    color: var(--text-dark);
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: white;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--secondary);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-box.blue { background: #eff6ff; color: var(--primary); }
.icon-box.green { background: #ecfdf5; color: var(--success); }
.icon-box.orange { background: #fff7ed; color: var(--warning); }
.icon-box.purple { background: #f5f3ff; color: #8b5cf6; }

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Table Card */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    width: 280px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

.vehicle-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vehicle-icon {
    width: 36px;
    height: 36px;
    background: var(--secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.vehicle-text {
    display: flex;
    flex-direction: column;
}

.vehicle-brand {
    font-weight: 600;
    color: var(--text-dark);
}

.vehicle-type {
    font-size: 0.8rem;
    color: var(--text-light);
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-badge.available {
    background: #ecfdf5;
    color: var(--success);
}

.status-badge.rented {
    background: #fff7ed;
    color: var(--warning);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.action-btn.rent {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

.action-btn.rent:hover {
    background: #dbeafe;
}

.action-btn.return {
    background: #f0fdf4;
    color: var(--success);
    border-color: #bbf7d0;
}

.action-btn.return:hover {
    background: #dcfce7;
}

.action-btn.delete {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
    margin-left: 0.5rem;
}

.action-btn.delete:hover {
    background: #fee2e2;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-dark);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--secondary);
}

/* Views & Utilities */
.hidden {
    display: none !important;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-container {
    padding: 1.5rem;
    height: 300px;
    position: relative;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-body {
    padding: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.setting-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.setting-select {
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#logoutBtn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    margin-left: auto;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

#logoutBtn:hover {
    background: var(--secondary);
    color: var(--danger);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100%;
        z-index: 100;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

