:root {
    color-scheme: light;
}

.header-button,
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    border-radius: 0.65rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.header-button {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.header-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-button-light {
    background: #fff;
    color: #1d4ed8;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-field span {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-field select {
    width: 100%;
    min-height: 2.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.45rem 0.7rem;
    outline: none;
}

.filter-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.filter-button {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.filter-button-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.dashboard-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    border: 1px solid #cbd5e1;
    border-radius: 0.9rem;
    background: #e2e8f0;
    padding: 0.35rem;
}

.dashboard-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 700;
}

.dashboard-tab:hover,
.dashboard-tab.is-active {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.dashboard-card,
.metric-card {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-card {
    padding: 1rem;
}

.metric-card {
    position: relative;
    min-height: 8.5rem;
    overflow: hidden;
    padding: 1rem;
}

.metric-card-icon {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    border-radius: 0.7rem;
    background: #eff6ff;
    color: #2563eb;
}

.metric-card-value {
    margin-top: 0.75rem;
    color: #0f172a;
    font-family: Poppins, sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
    color: #2563eb;
}

.card-heading h2,
.section-title {
    color: #1e293b;
    font-family: Poppins, sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.card-heading p {
    color: #64748b;
    font-size: 0.75rem;
}

.chart-box {
    position: relative;
    height: 300px;
    min-width: 0;
}

.chart-box-large {
    height: 390px;
}

.heatmap-table,
.analysis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0.2rem;
    font-size: 0.75rem;
}

.heatmap-table th,
.analysis-table th {
    color: #475569;
    font-weight: 800;
    white-space: nowrap;
}

.heatmap-table td,
.analysis-table td {
    text-align: center;
}

.heat-cell {
    min-width: 2.5rem;
    border-radius: 0.35rem;
    padding: 0.4rem 0.25rem;
    color: #0f172a;
    font-weight: 700;
}

.analysis-table th,
.analysis-table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
}

.analysis-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    text-align: left;
}

@media (max-width: 640px) {
    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .header-actions .header-button {
        width: 100%;
    }

    #btn-filters {
        grid-column: span 2;
    }

    .filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions .filter-button {
        width: 100%;
    }

    .dashboard-card {
        padding: 0.75rem;
    }

    .chart-box,
    .chart-box-large {
        height: 300px;
    }
}
