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

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

:root {
    --header-blue: #1e3a6f;
    --primary-blue: #2563EB;
    --stat-blue: #1e4a8a;
    --stat-orange: #f97316;
    --bg-gray: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #1a1a1a;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-blue);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem;
    border-radius: 8px;
}

.logo-text h1 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
}

.logo-text p {
    font-size: 0.8125rem;
    opacity: 0.9;
}

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

.trip-badge {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-weight: 500;
}

.team-badge {
    background: var(--stat-orange);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

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

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

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-info h3 .unit {
    font-size: 1.125rem;
    font-weight: 500;
}

.stat-info p {
    font-size: 0.6875rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Filters */
.filters-bar {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--text-dark);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.select-box {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.search-box {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 200px;
    font-family: 'Montserrat', sans-serif;
}

.search-box::placeholder {
    color: var(--text-light);
}

/* Advanced Filters */
.advanced-filters {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    display: none;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.advanced-filters.show {
    display: flex;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
}

.filter-group input {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    width: 120px;
    font-family: 'Montserrat', sans-serif;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-apply {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.btn-reset {
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

/* Insights */
.insights-section {
    margin-bottom: 1.5rem;
}

.section-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon {
    font-size: 1.5rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.insight-card {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
}

.insight-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.insight-icon-box.blue {
    background: rgba(37, 99, 235, 0.1);
}

.insight-icon-box.orange {
    background: rgba(249, 115, 22, 0.1);
}

.insight-icon-box.green {
    background: rgba(16, 185, 129, 0.1);
}

.insight-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.insight-card p {
    font-size: 0.875rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Charts */
.charts-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.chart-box.wide {
    grid-column: span 2;
}

.chart-box h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.chart-desc {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

canvas {
    max-height: 280px !important;
    width: 100% !important;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 0.75rem;
}

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

.data-table th {
    background: var(--bg-gray);
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

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

/* Trips */
.trips-section {
    margin-bottom: 2rem;
}

.trips-subtitle {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.trips-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

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

.trips-table th {
    background: var(--header-blue);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
}

.trips-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.trips-table tr:hover {
    background: var(--bg-gray);
}

.loading {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-gray);
}

.ranking-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: var(--header-blue);
    color: white;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

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

    .chart-box.wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .select-box,
    .search-box {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

html {
    scroll-behavior: smooth;
}
