/* ── Page title ── */
.dashboard-welcome {
    padding-top: 50px;
    text-align: center;
}

.dashboard-welcome h1 {
    font-size: 56px;
    margin: 5px;
}

.dashboard-welcome p {
    font-size: 24px;
    margin: 5px;
    color: #555;
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    padding: 36px 50px 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    padding: 10px 36px 10px 14px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #1a1a1a;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    min-width: 220px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.filter-group select:focus {
    outline: none;
    border-color: #e2a45a;
    box-shadow: 0 0 0 3px rgba(226,164,90,0.15);
}

/* Custom date inputs — hidden by default, shown via JS */
.custom-range {
    display: none;
}

input[type="date"] {
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    cursor: pointer;
}

input[type="date"]:focus {
    outline: none;
    border-color: #e2a45a;
    box-shadow: 0 0 0 3px rgba(226,164,90,0.15);
}

.filter-apply-btn {
    padding: 10px 28px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    background-color: #e2a45a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.filter-apply-btn:hover {
    background-color: #c98c3e;
}

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
}

.kpi-sub {
    font-size: 13px;
    color: #999;
}

@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 20px 0;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ── DB error banner ── */
.db-error-banner {
    margin: 16px 50px 0;
    padding: 12px 18px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
}

/* ── Charts Grid ── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 32px 50px 50px;
}

/* A wide card spans both columns */
.chart-block.wide {
    grid-column: 1 / -1;
}

.chart-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-block-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.chart-subtitle {
    font-size: 13px;
    color: #999;
}

/* Placeholder until real charts are wired in */
.chart-placeholder {
    flex: 1;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e5e5e5;
    margin: 16px;
    border-radius: 8px;
    color: #bbb;
    font-size: 15px;
}

.chart-block.wide .chart-placeholder {
    min-height: 320px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
        padding: 24px 20px 40px;
    }

    .chart-block.wide {
        grid-column: 1;
    }

    .filter-bar {
        padding: 28px 20px 0;
    }

    .filter-group select {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-welcome h1 { font-size: 36px; }
    .dashboard-welcome p  { font-size: 18px; }

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

    .filter-apply-btn {
        width: 100%;
    }
}
