.dash-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 0 28px;
}

.dash-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-title {
    margin: 0;
    font-size: 31px;
    line-height: 1.05;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.04em;
}

.dash-subtitle {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dash-kpi-card,
.dash-chart-panel,
.dash-health-panel,
.dash-alerts-panel {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.dash-kpi-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 166px;
}

.dash-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dash-kpi-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dash-kpi-icon svg {
    width: 22px;
    height: 22px;
}

.dash-kpi-icon.blue {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.dash-kpi-icon.green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.dash-kpi-icon.violet {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
}

.dash-kpi-icon.orange {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
}

.dash-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dash-kpi-chip.placeholder {
    color: #94a3b8;
}

.dash-kpi-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-kpi-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.dash-kpi-value-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-kpi-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.04em;
}

.dash-kpi-value.placeholder {
    color: #94a3b8;
}

.dash-kpi-unit {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 2px;
}

.dash-kpi-meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.dash-kpi-meta strong {
    color: #111827;
    font-weight: 700;
}

.dash-chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: stretch;
}

.dash-chart-panel,
.dash-health-panel,
.dash-alerts-panel {
    padding: 22px 22px 20px;
}

.dash-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dash-panel-header h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}

.dash-panel-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.dash-legend {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.dash-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dash-legend-dot.web {
    background: #3b82f6;
}

.dash-legend-dot.api {
    background: #10b981;
}

.dash-chart-canvas-wrap {
    position: relative;
    min-height: 320px;
}

.dash-chart-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 320px !important;
}

.dash-no-data-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.78) 100%);
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

.dash-section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dash-section-link:hover {
    color: #1d4ed8;
}

.dash-health-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash-health-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-health-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dash-health-label {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.dash-health-value {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.dash-health-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.dash-health-fill {
    height: 100%;
    border-radius: inherit;
}

.dash-health-fill.green {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.dash-health-fill.orange {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.dash-health-fill.red {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.dash-health-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dash-muted {
    font-size: 12px;
    color: #6b7280;
}

.dash-muted strong {
    color: #111827;
}

.dash-status-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.dash-alerts-panel {
    min-height: 228px;
}

.dash-alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dash-alerts-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-alerts-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #ffffff;
}

.dash-alerts-icon svg {
    width: 20px;
    height: 20px;
}

.dash-alerts-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.dash-alerts-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dash-alerts-badge.is-empty {
    background: #f1f5f9;
    color: #64748b;
}

.dash-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid #eef2f7;
}

.dash-alert-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.dash-alert-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-alert-dot.critical {
    background: #ef4444;
}

.dash-alert-dot.warning {
    background: #f59e0b;
}

.dash-alert-dot.info {
    background: #3b82f6;
}

.dash-alert-copy {
    min-width: 0;
}

.dash-alert-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.dash-alert-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #64748b;
}

.dash-alert-time {
    margin-top: 6px;
    display: inline-block;
    font-size: 12px;
    color: #94a3b8;
}

.dash-empty-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 116px;
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed #dbe4ef;
    background: #f8fafc;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .dash-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-chart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dash-shell {
        gap: 18px;
    }

    .dash-title {
        font-size: 26px;
    }

    .dash-kpi-row {
        grid-template-columns: 1fr;
    }

    .dash-kpi-card,
    .dash-chart-panel,
    .dash-health-panel,
    .dash-alerts-panel {
        padding: 18px;
        border-radius: 16px;
    }

    .dash-kpi-card {
        min-height: 0;
    }

    .dash-kpi-value {
        font-size: 30px;
    }

    .dash-panel-header,
    .dash-alerts-header,
    .dash-health-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .dash-chart-canvas-wrap,
    .dash-chart-canvas-wrap canvas {
        min-height: 260px;
        height: 260px !important;
    }
}

/* Lien "Voir toutes les alertes" sous la liste des alertes recentes */
.dash-alerts-see-all {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

.dash-alerts-see-all a {
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.dash-alerts-see-all a:hover,
.dash-alerts-see-all a:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}
