/* ==========================================================================
   SETUP SUPERVISION V2 — Dashboard / Cartes API / Alertes
   ========================================================================== */

.supervision-content-inner {
    max-width: none;
    height: 100%;
}

.supervision-empty-state {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.supervision-empty-state::before {
    content: "";
    position: absolute;
    inset: 7% 10%;
    background: none;
    pointer-events: none;
}

.supervision-empty-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.supervision-empty-icon-shell {
    width: 190px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.supervision-empty-icon-img {
    width: 190px;
    height: 190px;
    display: block;
    object-fit: contain;
}

.supervision-empty-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
}

.supervision-empty-text {
    max-width: 430px;
    margin: 12px 0 28px;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 400;
    color: #6b7280;
}

.supervision-empty-cta {
    min-height: 42px;
    padding: 11px 20px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 500;
    gap: 7px;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    color: #ffffff !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.supervision-empty-cta:visited,
.supervision-empty-cta:hover,
.supervision-empty-cta:active,
.supervision-empty-cta:focus,
.supervision-empty-cta:focus-visible {
    color: #ffffff !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.supervision-empty-cta span,
.supervision-empty-cta svg {
    background: transparent !important;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none !important;
}

.supervision-empty-cta::selection,
.supervision-empty-cta span::selection,
.supervision-empty-cta svg::selection {
    background: transparent;
    color: inherit;
}

.supervision-empty-cta svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.supervision-empty-cta:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.supervision-empty-cta--blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.supervision-empty-cta--blue:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.supervision-empty-cta--purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 8px 22px rgba(109, 40, 217, 0.24);
}

.supervision-empty-cta--purple:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

@media (max-width: 768px) {
    .supervision-empty-state::before {
        inset: 10% 2%;
    }

    .supervision-empty-stage {
        max-width: 100%;
        padding: 0 12px;
    }

    .supervision-empty-text {
        max-width: 100%;
    }
}

/* ==========================================================================
   ALERTES PAGE (v2) — Liste + filtres + cartes (Phase 2)
   ==========================================================================
   Utilise les classes du registre API (.api-registry-toolbar, .api-period-*)
   pour la coherence visuelle. Style propre uniquement pour la liste, les
   compteurs d'en-tete et les cartes d'alerte.
   ========================================================================== */

.alerts-page .v2-content-inner {
    flex: 0 0 auto;
    min-height: 0;
}

.alerts-page.v2-content {
    overflow-y: auto;
}

/* Compteurs d'en-tete (a cote du titre) */
.alerts-counters {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.alerts-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

.alerts-counter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alerts-counter--critical .alerts-counter-dot { background: #dc2626; }
.alerts-counter--warning  .alerts-counter-dot { background: #d97706; }
.alerts-counter--info     .alerts-counter-dot { background: #2563eb; }

.alerts-counter-value {
    font-weight: 700;
    color: #111827;
}

.alerts-counter-label {
    color: #6b7280;
    font-weight: 500;
    text-transform: lowercase;
}

/* Toolbar : recherche en input texte */
.alerts-toolbar-search {
    flex: 1 1 240px;
}

.alerts-search-input {
    background-image: none;
    padding-right: 12px;
    min-width: 220px;
}

/* Liste des alertes */
.alerts-list-section {
    margin-top: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alerts-card {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.alerts-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border-color: #d1d5db;
}

.alerts-card-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.alerts-card--critical { border-left: 3px solid #dc2626; }
.alerts-card--critical .alerts-card-dot { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16); }

.alerts-card--warning  { border-left: 3px solid #d97706; }
.alerts-card--warning  .alerts-card-dot { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16); }

.alerts-card--info     { border-left: 3px solid #2563eb; }
.alerts-card--info     .alerts-card-dot { background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }

.alerts-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.alerts-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.alerts-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.alerts-card-severity {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.alerts-card-severity--critical { background: #fee2e2; color: #b91c1c; }
.alerts-card-severity--warning  { background: #fef3c7; color: #b45309; }
.alerts-card-severity--info     { background: #dbeafe; color: #1d4ed8; }

.alerts-card-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.alerts-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.alerts-card-time {
    font-weight: 600;
    color: #475569;
}

.alerts-card-sep {
    color: #cbd5e1;
}

.alerts-card-api {
    color: #111827;
    font-weight: 600;
}

.alerts-card-endpoint {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11.5px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 6px;
    color: #1f2937;
}

.alerts-card-count strong {
    color: #111827;
    font-weight: 700;
}

.alerts-card-link {
    align-self: center;
    color: #2563eb;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 4px;
    transition: color 0.15s ease;
}

.alerts-card-link:hover,
.alerts-card-link:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Skeleton loader */
.alerts-card-skeleton {
    background: #ffffff;
    border-color: #f1f5f9;
    border-left: 3px solid #f1f5f9;
}

.alerts-card-skeleton .alerts-card-dot {
    background: #e2e8f0;
    box-shadow: none;
}

.alerts-skeleton-line {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: alertsPulse 1.5s ease-in-out infinite;
}

.alerts-skeleton-line.title { width: 50%; height: 14px; }
.alerts-skeleton-line.desc  { width: 80%; }
.alerts-skeleton-line.meta  { width: 32%; }

@keyframes alertsPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state (filtres) */
.alerts-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 24px;
    background: #ffffff;
    border: 1px dashed #e5e7eb;
    border-radius: 14px;
    gap: 12px;
}

.alerts-empty-icon {
    color: #10b981;
    margin-bottom: 4px;
}

.alerts-empty-error .alerts-empty-icon {
    color: #b45309;
}

.alerts-empty-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.alerts-empty-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #6b7280;
    max-width: 480px;
}

@media (max-width: 720px) {
    .alerts-card {
        grid-template-columns: 12px 1fr;
    }

    .alerts-card-link {
        grid-column: 2;
        align-self: flex-start;
        margin-top: 4px;
    }

    .alerts-counters {
        gap: 8px;
    }

    .alerts-counter {
        padding: 6px 10px;
        font-size: 11px;
    }
}
