/*
 * Écran Alertes : en-tête, filtres en pastilles et journal des alertes (spec design §3.5).
 * La barre colorée de chaque ligne reprend la couleur de la catégorie, le badge celle de la
 * sévérité — la couleur double toujours un libellé, elle ne le remplace jamais.
 */
.rb-alerts__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.rb-alerts__title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.rb-alerts__subtitle {
    margin: 7px 0 0;
    color: var(--rb-text-subdued);
    font-size: 14px;
}

.rb-alerts__button {
    padding: 9px 15px;
    color: var(--rb-text-secondary);
    font-family: var(--rb-font-sans);
    font-size: 12.5px;
    font-weight: 600;
    background-color: var(--rb-bg-inset);
    border: 1px solid var(--rb-border-chip);
    border-radius: var(--rb-radius-md);
    cursor: pointer;
}

.rb-alerts__button:hover {
    border-color: var(--rb-border-muted);
}

.rb-alerts__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.rb-alerts__categories,
.rb-alerts__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rb-alerts__category,
.rb-alerts__filter {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    color: var(--rb-text-muted);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    background-color: var(--rb-bg-inset);
    border: 1px solid var(--rb-border-chip);
    border-radius: var(--rb-radius-md);
}

.rb-alerts__category:hover,
.rb-alerts__filter:hover {
    color: var(--rb-text-muted);
    border-color: var(--rb-border-muted);
}

.rb-alerts__category--active,
.rb-alerts__filter--active {
    color: var(--rb-text-heading);
    font-weight: 700;
    background-color: rgb(95 227 245 / 7%);
    border-color: var(--rb-accent-cyan);
}

.rb-alerts__count {
    color: var(--rb-text-faint);
    font-family: var(--rb-font-mono);
    font-size: 10.5px;
}

.rb-alerts__panel {
    margin-top: 18px;
    background-color: var(--rb-bg-surface);
    border: 1px solid var(--rb-border-default);
    border-radius: 14px;
    overflow: hidden;
}

.rb-alerts__empty {
    margin: 0;
    padding: 64px 20px;
    color: var(--rb-text-muted);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.rb-alerts {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rb-alert {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--rb-border-row);
}

.rb-alert:last-child {
    border-bottom: 0;
}

.rb-alert:hover {
    background-color: var(--rb-bg-hover);
}

/* Ligne déjà vue : même structure, contraste abaissé. */
.rb-alert[data-seen="1"] .rb-alert__type {
    color: var(--rb-text-muted);
}

.rb-alert__bar {
    flex: none;
    align-self: stretch;
    width: 3px;
    background-color: var(--rb-accent-gray);
    border-radius: 2px;
}

.rb-alert--system .rb-alert__bar {
    background-color: var(--rb-accent-orange);
}

.rb-alert--market .rb-alert__bar {
    background-color: var(--rb-accent-cyan);
}

.rb-alert--cron .rb-alert__bar {
    background-color: var(--rb-accent-purple);
}

.rb-alert__body {
    flex: 1;
    min-width: 0;
}

.rb-alert__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rb-alert__category {
    color: var(--rb-accent-gray);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rb-alert--system .rb-alert__category {
    color: var(--rb-accent-orange);
}

.rb-alert--market .rb-alert__category {
    color: var(--rb-accent-cyan);
}

.rb-alert--cron .rb-alert__category {
    color: var(--rb-accent-purple);
}

.rb-alert__severity {
    margin: 0;
    padding: 3px 7px;
    color: var(--rb-text-faint);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background-color: rgb(92 110 140 / 8%);
    border: 1px solid rgb(92 110 140 / 33%);
    border-radius: var(--rb-radius-sm);
}

.rb-alert__severity[data-severity="CRITICAL"] {
    color: var(--rb-accent-red);
    background-color: rgb(255 107 107 / 8%);
    border-color: rgb(255 107 107 / 33%);
}

.rb-alert__date {
    margin: 0;
    color: var(--rb-text-ghost);
    font-family: var(--rb-font-mono);
    font-size: 10.5px;
}

.rb-alert__type {
    margin: 7px 0 0;
    color: var(--rb-text-heading);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
}

.rb-alert__reason,
.rb-alert__impact {
    max-width: 640px;
    margin: 6px 0 0;
    color: var(--rb-text-subdued);
    font-size: 12.5px;
    line-height: 1.55;
    text-wrap: pretty;
}

.rb-alert__footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 11px;
}

.rb-alert__action {
    margin: 0;
    color: var(--rb-accent-cyan);
    font-size: 12px;
    font-weight: 700;
}

.rb-alert__card {
    color: var(--rb-text-faint);
    font-family: var(--rb-font-mono);
    font-size: 11px;
    text-decoration: none;
}

.rb-alert__card:hover {
    color: var(--rb-text-secondary);
}

.rb-alert__status {
    margin: 6px 0 0;
    color: var(--rb-text-subdued);
    font-size: 12.5px;
}

.rb-alert__description {
    margin: 4px 0 0;
    color: var(--rb-text-faint);
    font-size: 12px;
    line-height: 1.5;
}

.rb-alert__summary {
    margin: 4px 0 0;
    color: var(--rb-text-secondary);
    font-size: 12.5px;
}

.rb-alert__sources {
    margin: 4px 0 0;
    padding-left: 16px;
    color: var(--rb-text-subdued);
    font-size: 12px;
}

.rb-alert__failure {
    margin-top: 8px;
    color: var(--rb-text-faint);
    font-size: 11.5px;
}

.rb-alert__failure summary {
    cursor: pointer;
}

.rb-alert__failure p {
    margin: 6px 0 0;
    font-family: var(--rb-font-mono);
    line-height: 1.55;
    word-break: break-word;
}

.rb-alert__mark-seen {
    flex: none;
    align-self: flex-start;
}

.rb-alert__mark-seen-button {
    padding: 0;
    color: var(--rb-text-faint);
    font-family: var(--rb-font-sans);
    font-size: 11.5px;
    background: none;
    border: 0;
    cursor: pointer;
}

.rb-alert__mark-seen-button:hover {
    color: var(--rb-text-muted);
}

.rb-alerts__pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    color: var(--rb-text-secondary);
    font-size: 12px;
}

.rb-alerts__pagination-link {
    color: var(--rb-accent-purple);
}
