/* Fleet Management Dashboard - Abu Dhabi Government Theme */

:root {
    /* Abu Dhabi Government Red & Gold Theme - Matching Logo Colors */
    --primary-burgundy: #c8102e;
    --secondary-burgundy: #9e0b23;
    --accent-gold: #d4af37;
    --light-burgundy: #fff5f7;
    --hover-gold: #b8982f;
    --white: #ffffff;
    --gray-50: #f7fafc;
    --gray-100: #f5f6f6;
    --gray-200: #f0f0f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #444;
    --gray-700: #262626;
    --gray-800: #1a202c;
    --success: #38a169;
    --success-light: #c6f6d5;
    --warning: #dd6b20;
    --warning-light: #feebc8;
    --danger: #e53e3e;
    --danger-light: #fed7d7;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Legacy variable mappings for compatibility */
    --primary-blue: var(--primary-burgundy);
    --secondary-blue: var(--secondary-burgundy);
    --accent-blue: var(--accent-gold);
    --light-blue: var(--light-burgundy);
    --hover-blue: var(--hover-gold);
}

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

body {
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-700);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    color: var(--gray-700);
    position: fixed;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar.hidden {
    transform: translateX(280px);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--gray-800);
}

.sidebar-header .subtitle {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.nav-links {
    list-style: none;
    padding: 12px 0;
}

.nav-links li {
    margin: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-links li a {
    color: var(--gray-600);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-links li:hover {
    background-color: var(--gray-100);
}

.nav-links li:hover a {
    color: var(--primary-burgundy);
}

.nav-links li.active {
    background: linear-gradient(90deg, rgba(200, 16, 46, 0.1) 0%, rgba(200, 16, 46, 0.05) 100%);
    border-right: 3px solid var(--primary-burgundy);
}

.nav-links li.active a {
    color: var(--primary-burgundy);
    font-weight: 600;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.footer-branding {
    text-align: center;
}

.footer-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 4px 0;
}

.footer-subtitle {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0 0 6px 0;
    font-weight: 500;
}

.footer-version {
    font-size: 10px;
    color: var(--gray-400);
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    margin-right: 280px;
    min-height: 100vh;
    transition: margin-right 0.3s ease;
    background-color: var(--gray-50);
}

body.sidebar-hidden .main-content {
    margin-right: 0;
}

/* Header */
.header {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-600);
    cursor: pointer;
}

.header h1 {
    font-size: 24px;
    color: var(--primary-blue);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.header-emblem {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.user-info span {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--gray-300);
}

.stat-card.wide {
    grid-column: span 2;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--light-blue);
    color: var(--accent-blue);
}

.stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.orange {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-info h3 {
    font-size: 28px;
    color: var(--gray-800);
    font-weight: 700;
}

.stat-info p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 5px;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.chart-container {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    color: var(--gray-800);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 280px;
    width: 100% !important;
    height: auto !important;
}

/* Recent Section */
.recent-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.recent-fines, .recent-vehicles {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.recent-fines h3, .recent-vehicles h3 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.recent-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item-info .title {
    font-weight: 500;
    color: var(--gray-700);
}

.recent-item-info .subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.recent-item-amount {
    font-weight: 600;
    color: var(--danger);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: var(--primary-blue);
    font-size: 20px;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-600);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.section-actions input[type="text"] {
    padding: 10px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    width: 220px;
    transition: border-color 0.2s ease;
}

.section-actions input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

thead {
    background: var(--primary-blue);
    color: var(--white);
}

th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--gray-50);
}

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

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.in-service {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.inactive {
    background: var(--gray-200);
    color: var(--gray-600);
}

.status-badge.paid {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.unpaid {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.disputed {
    background: var(--warning-light);
    color: var(--warning);
}

/* Action Buttons */
.btn-action {
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn-action.view {
    background: var(--light-blue);
    color: var(--accent-blue);
}

.btn-action.view:hover {
    background: var(--accent-blue);
    color: var(--white);
}

/* Fines Summary */
.fines-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.summary-card {
    background: var(--white);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 10px;
    align-items: center;
}

.summary-card .label {
    color: var(--gray-500);
    font-size: 14px;
}

.summary-card .value {
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-800);
}

.summary-card.unpaid .value {
    color: var(--danger);
}

.summary-card.paid .value {
    color: var(--success);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.chart-card.large {
    grid-column: span 2;
    min-height: 420px;
}

.chart-card h3 {
    color: var(--gray-800);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
}

.chart-card canvas {
    flex: 1;
    max-height: 320px;
    width: 100% !important;
    height: auto !important;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.report-card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.report-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
}

.report-icon.pdf {
    background: var(--danger-light);
    color: var(--danger);
}

.report-icon.excel {
    background: var(--success-light);
    color: var(--success);
}

.report-card h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 18px;
}

.report-card p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--hover-blue);
    filter: brightness(0.9);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #2f855a;
    filter: brightness(0.9);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--gray-600);
}

.modal-content h2 {
    color: var(--primary-blue);
    margin-bottom: 25px;
    padding-right: 40px;
}

.vehicle-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    padding: 15px;
    background: var(--gray-50);
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.detail-item span {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.vehicle-fines-list {
    margin-top: 25px;
}

.vehicle-fines-list h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 16px;
}

.fine-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 10px;
}

.fine-item:last-child {
    margin-bottom: 0;
}

.fine-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fine-type {
    font-weight: 500;
    color: var(--gray-700);
}

.fine-date {
    font-size: 13px;
    color: var(--gray-500);
}

.fine-amount {
    font-weight: 600;
    color: var(--danger);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.large {
        grid-column: span 1;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .stat-card.wide {
        grid-column: span 1;
    }

    .dashboard-charts,
    .recent-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-box input {
        width: 200px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-group select,
    .section-actions input[type="text"] {
        width: 100%;
    }

    .vehicle-details {
        grid-template-columns: 1fr;
    }

    .fines-summary {
        flex-direction: column;
    }

    .summary-card {
        width: 100%;
        justify-content: space-between;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }
}
