/* path: assets/css/dashboard.css */

.dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-card,
.chart-card {
    animation: dashboardEnter 0.5s ease both;
    animation-delay: var(--animation-delay, 0s);
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.dashboard-card {
    display: grid;
    gap: 12px;
    min-height: 132px;
    padding: 20px;
}

.dashboard-card span {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-card strong {
    color: var(--color-text);
    font-size: 30px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.dashboard-card a {
    align-self: end;
    font-weight: 700;
}

.dashboard-grid > .dashboard-card:nth-child(1),
.chart-grid > .chart-card:nth-child(1) {
    --animation-delay: 0s;
}

.dashboard-grid > .dashboard-card:nth-child(2),
.chart-grid > .chart-card:nth-child(2) {
    --animation-delay: 0.2s;
}

.dashboard-grid > .dashboard-card:nth-child(3),
.chart-grid > .chart-card:nth-child(3) {
    --animation-delay: 0.4s;
}

.dashboard-grid > .dashboard-card:nth-child(4),
.chart-grid > .chart-card:nth-child(4) {
    --animation-delay: 0.6s;
}

.dashboard-grid > .dashboard-card:nth-child(5),
.chart-grid > .chart-card:nth-child(5) {
    --animation-delay: 0.8s;
}

.dashboard-grid > .dashboard-card:nth-child(6),
.chart-grid > .chart-card:nth-child(6) {
    --animation-delay: 1s;
}

.dashboard-grid > .dashboard-card:nth-child(7),
.chart-grid > .chart-card:nth-child(7) {
    --animation-delay: 1.2s;
}

.dashboard-grid > .dashboard-card:nth-child(8),
.chart-grid > .chart-card:nth-child(8) {
    --animation-delay: 1.4s;
}

.dashboard-grid > .dashboard-card:nth-child(9),
.chart-grid > .chart-card:nth-child(9) {
    --animation-delay: 1.6s;
}

.dashboard-grid > .dashboard-card:nth-child(10),
.chart-grid > .chart-card:nth-child(10) {
    --animation-delay: 1.8s;
}

.chart-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
    min-height: 360px;
    padding: 20px;
}

.chart-card h2 {
    font-size: 17px;
    line-height: 1.35;
    margin: 0 0 16px;
}

.chart-card canvas {
    display: block;
    height: 280px;
    max-height: 280px;
    width: 100%;
}

.chart-card:only-child,
.chart-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.chart-empty {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-muted);
    display: flex;
    font-weight: 700;
    height: 280px;
    justify-content: center;
    text-align: center;
}

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

@media (max-width: 640px) {
    .dashboard-card {
        min-height: 112px;
    }

    .dashboard-card strong {
        font-size: 25px;
    }

    .chart-card {
        min-height: 320px;
        padding: 16px;
    }

    .chart-card canvas,
    .chart-empty {
        height: 240px;
        max-height: 240px;
    }
}
