.dashboard-header {
    align-items: center;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-metric,
.dashboard-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-metric {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 14px;
}

.dashboard-metric-top,
.dashboard-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-metric-top {
    margin-bottom: 2px;
}

.dashboard-panel-title {
    line-height: 1.2;
}

.dashboard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid #d8e3e7;
    border-radius: 8px;
    background: #f6fafb;
    color: var(--primary);
}

.dashboard-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.dashboard-metric.highlight .dashboard-icon {
    border-color: #c6e4da;
    background: var(--success-bg);
    color: var(--success);
}

.dashboard-metric.attention .dashboard-icon {
    border-color: #efd59b;
    background: var(--warning-bg);
    color: var(--warning);
}

.dashboard-metric.warning .dashboard-icon {
    border-color: #efc1ba;
    background: var(--danger-bg);
    color: var(--danger);
}

.dashboard-metric-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.dashboard-metric strong {
    color: var(--text);
    font-size: 25px;
    line-height: 1.1;
}

.dashboard-metric small {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-metric.highlight {
    border-color: #b7ded8;
    background: linear-gradient(180deg, #f7fdfb 0%, #ffffff 100%);
}

.dashboard-metric.highlight strong {
    color: var(--success);
}

.dashboard-metric.attention {
    border-color: #f2d28a;
    background: #fffdf7;
}

.dashboard-metric.warning {
    border-color: #f0c3bd;
    background: #fffafa;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.dashboard-panel {
    overflow: hidden;
}

.dashboard-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-muted);
}

.dashboard-panel-head h2 {
    margin: 0;
    font-size: 17px;
}

.dashboard-panel-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-list {
    display: grid;
}

.dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 68px;
    padding: 12px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--line-soft);
}

.dashboard-row:hover {
    background: var(--table-row-hover);
    text-decoration: none;
}

.dashboard-row:last-child {
    border-bottom: 0;
}

.dashboard-row span {
    min-width: 0;
}

.dashboard-row strong,
.dashboard-row small {
    display: block;
}

.dashboard-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-row-end {
    flex: 0 0 auto;
    text-align: right;
}

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

.dashboard-breakdown div {
    min-height: 86px;
    padding: 16px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.dashboard-breakdown div:nth-child(2n) {
    border-right: 0;
}

.dashboard-breakdown div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.dashboard-breakdown span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-breakdown strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.dashboard-empty {
    margin: 0;
    border: 0;
    border-radius: 0;
}

@media (max-width: 1050px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .dashboard-header {
        align-items: stretch;
    }

    .dashboard-metrics,
    .dashboard-breakdown {
        grid-template-columns: 1fr;
    }

    .dashboard-breakdown div,
    .dashboard-breakdown div:nth-child(2n),
    .dashboard-breakdown div:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .dashboard-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-row-end {
        text-align: left;
    }
}
