/* ============================================================================
   Mailflow-Mon — Authenticated v2 atoms
   Loaded from layout/base.twig on every authenticated page.

   These are the *new* compound components introduced in the v2 mockups
   (dashboard.html / monitors.html / monitor-detail.html / alerts.html /
   settings.html). They build on the foundation tokens in ravenhub-tokens.css
   and the primitive atoms in app.css (.rh-card, .rh-btn, .rh-table, etc.).

   Naming convention: every selector is prefixed `.rh-` to avoid collision
   with the per-page mockup CSS that used unprefixed names (.stat, .kpi, ...).
   ============================================================================ */


/* ── page head ───────────────────────────────────────────────────────────── */
.rh-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--rh-s-5);
    margin-bottom: var(--rh-s-6);
    flex-wrap: wrap;
}
.rh-page-head-body { min-width: 0; }
.rh-page-head h1 {
    font-family: var(--rh-font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -.015em;
    margin: 0 0 4px;
    line-height: var(--rh-lh-snug);
}
.rh-page-head .rh-page-sub {
    margin: 0;
    color: var(--rh-fg-muted);
    font-size: var(--rh-t-sm);
}
.rh-page-actions {
    display: flex;
    gap: var(--rh-s-2);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}


/* ── announcement banner (info / warning / danger / success) ─────────────── */
.rh-banner-v2 {
    display: flex;
    gap: var(--rh-s-3);
    align-items: flex-start;
    padding: var(--rh-s-3) var(--rh-s-4);
    border: 1px solid;
    border-radius: var(--rh-r-md);
    margin-bottom: var(--rh-s-6);
    border-left-width: 3px;
}
.rh-banner-v2 > i { font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.rh-banner-v2 h4 {
    margin: 0 0 3px;
    font-family: var(--rh-font-display);
    font-size: var(--rh-t-sm);
    font-weight: 600;
}
.rh-banner-v2 p { margin: 0; color: var(--rh-fg-muted); font-size: var(--rh-t-sm); }

.rh-banner-v2.is-info    { border-color: rgba(74, 180, 255, .32); background: linear-gradient(135deg, rgba(74, 180, 255, .10), transparent); }
.rh-banner-v2.is-info > i, .rh-banner-v2.is-info { border-left-color: var(--rh-info); }
.rh-banner-v2.is-info > i  { color: var(--rh-info); }

.rh-banner-v2.is-warning { border-color: rgba(247, 181, 0, .32); background: linear-gradient(135deg, rgba(247, 181, 0, .10), transparent); border-left-color: var(--rh-warning); }
.rh-banner-v2.is-warning > i { color: var(--rh-warning); }

.rh-banner-v2.is-danger  { border-color: rgba(255, 77, 109, .32); background: linear-gradient(135deg, rgba(255, 77, 109, .10), transparent); border-left-color: var(--rh-danger); }
.rh-banner-v2.is-danger > i  { color: var(--rh-danger); }

.rh-banner-v2.is-success { border-color: rgba(45, 212, 127, .32); background: linear-gradient(135deg, rgba(45, 212, 127, .10), transparent); border-left-color: var(--rh-success); }
.rh-banner-v2.is-success > i { color: var(--rh-success); }


/* ── stat card with radial glow (dashboard + monitor list) ───────────────── */
.rh-stat-card-v2 {
    background: var(--rh-bg-elev1);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    padding: var(--rh-s-5);
    position: relative;
    overflow: hidden;
}
.rh-stat-card-v2::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(101, 0, 205, .18), transparent 70%);
    top: -34px;
    right: -34px;
    pointer-events: none;
}
.rh-stat-card-v2 .rh-stat-label {
    font-size: var(--rh-t-xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rh-fg-faint);
    margin: 0 0 var(--rh-s-2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.rh-stat-card-v2 .rh-stat-label i { font-size: 14px; }
.rh-stat-card-v2 .rh-stat-val {
    font-family: var(--rh-font-display);
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1;
}
.rh-stat-card-v2 .rh-stat-val .frac { color: var(--rh-fg-faint); font-size: 16px; font-weight: 500; margin-left: 4px; }
.rh-stat-card-v2 .rh-stat-val.is-success { color: var(--rh-success); }
.rh-stat-card-v2 .rh-stat-val.is-info    { color: var(--rh-info); }
.rh-stat-card-v2 .rh-stat-val.is-warning { color: var(--rh-warning); }
.rh-stat-card-v2 .rh-stat-val.is-danger  { color: var(--rh-danger); }
.rh-stat-card-v2 .rh-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--rh-s-3);
    font-size: 12px;
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
}
.rh-stat-card-v2 .rh-stat-trend.is-up   { color: var(--rh-success); }
.rh-stat-card-v2 .rh-stat-trend.is-down { color: var(--rh-danger); }


/* ── status dot (with optional glow) ─────────────────────────────────────── */
.rh-status-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rh-fg-faint);
    display: inline-block;
    vertical-align: middle;
}
.rh-status-dot.up        { background: var(--rh-success); box-shadow: 0 0 8px rgba(45, 212, 127, .55); }
.rh-status-dot.degraded  { background: var(--rh-warning); box-shadow: 0 0 8px rgba(247, 181, 0, .55); }
.rh-status-dot.down      { background: var(--rh-danger);  box-shadow: 0 0 8px rgba(255, 77, 109, .55); }
.rh-status-dot.paused    { background: var(--rh-fg-faint); box-shadow: none; }
.rh-status-dot.maintenance { background: var(--rh-info); box-shadow: 0 0 8px rgba(74, 180, 255, .55); }
.rh-status-dot.pending   { background: var(--rh-warning); box-shadow: none; }
.rh-status-dot--sm       { width: 7px; height: 7px; }
.rh-status-dot--lg       { width: 12px; height: 12px; }


/* ── public chip (broadcast pill, used wherever a monitor exposes a status page) */
.rh-public-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: var(--rh-r-pill);
    background: rgba(101, 0, 205, .18);
    color: var(--rh-purple-glow);
    border: 1px solid rgba(101, 0, 205, .45);
    text-decoration: none;
    line-height: 1.4;
}
.rh-public-chip i { font-size: 11px; }


/* ── filter chip row (monitors list, admin user list) ────────────────────── */
.rh-filter-row {
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
    flex-wrap: wrap;
    margin-bottom: var(--rh-s-4);
}
.rh-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--rh-r-pill);
    background: var(--rh-bg-inset);
    border: 1px solid var(--rh-border);
    color: var(--rh-fg-muted);
    font-size: var(--rh-t-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--rh-dur-fast), border-color var(--rh-dur-fast), color var(--rh-dur-fast);
    text-decoration: none;
}
.rh-filter-chip:hover { background: var(--rh-bg-elev1); color: var(--rh-fg); }
.rh-filter-chip.is-active {
    background: rgba(101, 0, 205, .20);
    border-color: rgba(101, 0, 205, .50);
    color: var(--rh-fg);
}
.rh-filter-chip .count {
    font-family: var(--rh-font-mono);
    font-size: var(--rh-t-xs);
    color: var(--rh-fg-faint);
    padding: 0 6px;
    background: rgba(255, 255, 255, .04);
    border-radius: var(--rh-r-pill);
}
.rh-filter-chip.is-active .count { color: var(--rh-purple-glow); }


/* ── refresh countdown chip ──────────────────────────────────────────────── */
.rh-countdown-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 5px 12px;
    border-radius: var(--rh-r-pill);
    background: var(--rh-bg-inset);
    border: 1px solid var(--rh-border);
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
    font-size: var(--rh-t-xs);
}
.rh-countdown-chip .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--rh-success);
    box-shadow: 0 0 6px rgba(45, 212, 127, .6);
    animation: rh-pulse-soft 1.6s ease-in-out infinite;
}
@keyframes rh-pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}


/* ── tiny uptime bar (monitors list — 24×N cells per row) ────────────────── */
.rh-uptime-bar {
    display: flex;
    gap: 2px;
    align-items: center;
    height: 14px;
}
.rh-uptime-bar > span {
    flex: 1;
    height: 100%;
    border-radius: 1px;
    background: var(--rh-bg-inset);
}
.rh-uptime-bar > span.up   { background: var(--rh-success); }
.rh-uptime-bar > span.w    { background: var(--rh-warning); }
.rh-uptime-bar > span.d    { background: var(--rh-danger);  }
.rh-uptime-bar > span.n    { background: rgba(255, 255, 255, .04); }


/* ── 30/90-day uptime grid (monitor detail + public status) ──────────────── */
.rh-uptime-grid {
    display: grid;
    grid-template-columns: repeat(var(--uptime-cols, 30), 1fr);
    gap: 3px;
    margin: var(--rh-s-3) 0;
}
.rh-uptime-grid .uc {
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    background: var(--rh-success);
    transition: transform var(--rh-dur-fast);
}
.rh-uptime-grid .uc:hover { transform: scaleY(1.18); }
.rh-uptime-grid .uc.w { background: var(--rh-warning); }
.rh-uptime-grid .uc.d { background: var(--rh-danger);  }
.rh-uptime-grid .uc.n { background: rgba(255, 255, 255, .05); }
.rh-uptime-grid-legend {
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
    font-size: var(--rh-t-xs);
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
}
.rh-uptime-grid-legend .swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    vertical-align: middle;
}


/* ── underline tab bar (monitor detail) ──────────────────────────────────── */
.rh-tabbar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--rh-border);
    margin-bottom: var(--rh-s-5);
    overflow-x: auto;
    scrollbar-width: thin;
}
.rh-tabbar a, .rh-tabbar button {
    padding: 10px 16px;
    color: var(--rh-fg-faint);
    font-weight: 500;
    font-size: var(--rh-t-sm);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    cursor: pointer;
    white-space: nowrap;
}
.rh-tabbar a:hover, .rh-tabbar button:hover {
    color: var(--rh-fg);
    text-decoration: none;
}
.rh-tabbar a.is-active, .rh-tabbar button.is-active {
    color: var(--rh-fg);
    border-bottom-color: var(--rh-purple-glow);
}
.rh-tabbar .badge-count {
    background: var(--rh-bg-inset);
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: var(--rh-r-pill);
    margin-left: 4px;
}


/* ── range tabs (small pill group inside cards) ──────────────────────────── */
.rh-range-tabs {
    display: inline-flex;
    gap: 2px;
    background: var(--rh-bg-inset);
    padding: 3px;
    border-radius: 7px;
    border: 1px solid var(--rh-border);
}
.rh-range-tab {
    padding: 4px 10px;
    font-size: 11.5px;
    color: var(--rh-fg-faint);
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--rh-font-mono);
    background: transparent;
    border: 0;
    line-height: 1.4;
}
.rh-range-tab.is-active { background: var(--rh-bg-elev2); color: var(--rh-fg); }
.rh-range-tab:hover { color: var(--rh-fg); }


/* ── monitor card (dashboard 3-up grid) ──────────────────────────────────── */
.rh-monitor-card {
    background: var(--rh-bg-elev1);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    padding: var(--rh-s-4) var(--rh-s-5);
    transition: border-color var(--rh-dur-fast);
    text-decoration: none;
    color: inherit;
    display: block;
}
.rh-monitor-card:hover { border-color: var(--rh-border-strong); text-decoration: none; }
.rh-monitor-card.is-disabled {
    cursor: default;
    border-style: dashed;
    opacity: .65;
    text-align: center;
}
.rh-monitor-card.is-disabled:hover { border-color: var(--rh-border); }

.rh-monitor-head {
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
    margin-bottom: 6px;
}
.rh-monitor-label {
    font-weight: 600;
    font-size: var(--rh-t-sm);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rh-monitor-addr {
    font-family: var(--rh-font-mono);
    font-size: 11.5px;
    color: var(--rh-fg-faint);
    margin-bottom: var(--rh-s-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rh-monitor-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rh-monitor-rtt {
    font-family: var(--rh-font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--rh-info);
}
.rh-monitor-rtt.warn { color: var(--rh-warning); }
.rh-monitor-rtt.bad  { color: var(--rh-danger);  }
.rh-monitor-rtt.muted { color: var(--rh-fg-faint); }
.rh-monitor-uptime { text-align: right; }
.rh-monitor-uptime strong {
    display: block;
    font-family: var(--rh-font-display);
    font-size: 16px;
    color: var(--rh-success);
    font-weight: 600;
    line-height: 1;
}
.rh-monitor-uptime .lbl {
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rh-fg-faint);
}
.rh-monitor-spark { margin-top: var(--rh-s-2); height: 24px; line-height: 0; }
.rh-monitor-spark svg { display: block; width: 100%; height: 100%; }


/* ── activity row (dashboard right column) ───────────────────────────────── */
.rh-activity { display: grid; gap: 0; }
.rh-act {
    display: flex;
    align-items: center;
    gap: var(--rh-s-3);
    padding: 11px 0;
    border-bottom: 1px solid var(--rh-border);
}
.rh-act:last-child { border-bottom: none; }
.rh-act-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rh-fg-faint);
}
.rh-act-dot.success { background: var(--rh-success); box-shadow: 0 0 8px rgba(45, 212, 127, .5); }
.rh-act-dot.warning { background: var(--rh-warning); }
.rh-act-dot.danger  { background: var(--rh-danger);  box-shadow: 0 0 8px rgba(255, 77, 109, .5); }
.rh-act-dot.info    { background: var(--rh-info); }
.rh-act-body { flex: 1; min-width: 0; }
.rh-act-title {
    font-size: 13.5px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rh-act-meta {
    font-size: 11.5px;
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
    margin-top: 2px;
}
.rh-act-time {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--rh-fg-faint);
    font-family: var(--rh-font-mono);
}


/* ── summary card (monitor detail hero with gradient + glow) ─────────────── */
.rh-summary-card {
    background: linear-gradient(135deg, rgba(101, 0, 205, .18), rgba(101, 0, 205, .02));
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-r-lg);
    padding: var(--rh-s-6) var(--rh-s-7, 28px);
    margin-bottom: var(--rh-s-5);
    display: flex;
    align-items: flex-start;
    gap: var(--rh-s-6);
    flex-wrap: wrap;
}
.rh-summary-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--rh-grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(101, 0, 205, .55);
}
.rh-summary-body { flex: 1; min-width: 0; }
.rh-summary-meta {
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.rh-summary-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border-radius: var(--rh-r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid;
}
.rh-summary-status.is-operational  { background: rgba(45, 212, 127, .14); border-color: rgba(45, 212, 127, .32); color: var(--rh-success); }
.rh-summary-status.is-degraded     { background: rgba(247, 181, 0, .14); border-color: rgba(247, 181, 0, .32); color: var(--rh-warning); }
.rh-summary-status.is-down         { background: rgba(255, 77, 109, .14); border-color: rgba(255, 77, 109, .32); color: var(--rh-danger); }
.rh-summary-status.is-paused       { background: rgba(255, 255, 255, .06); border-color: var(--rh-border-strong); color: var(--rh-fg-muted); }
.rh-summary-status.is-maintenance  { background: rgba(74, 180, 255, .14); border-color: rgba(74, 180, 255, .32); color: var(--rh-info); }
.rh-summary-status.is-pending      { background: rgba(247, 181, 0, .14); border-color: rgba(247, 181, 0, .32); color: var(--rh-warning); }
.rh-summary-card h1 {
    font-family: var(--rh-font-display);
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -.015em;
}
.rh-summary-card p { margin: 0; color: var(--rh-fg-muted); font-size: 13.5px; }
.rh-summary-addr { font-family: var(--rh-font-mono); color: var(--rh-fg-muted); }
.rh-summary-actions {
    display: flex;
    gap: var(--rh-s-2);
    flex-shrink: 0;
    flex-wrap: wrap;
}


/* ── KPI cell (monitor detail) ───────────────────────────────────────────── */
.rh-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--rh-s-4);
    margin-bottom: var(--rh-s-6);
}
.rh-kpi {
    background: var(--rh-bg-elev1);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    padding: var(--rh-s-4) var(--rh-s-5);
}
.rh-kpi-label {
    font-size: var(--rh-t-xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rh-fg-faint);
    margin-bottom: 6px;
}
.rh-kpi-val {
    font-family: var(--rh-font-display);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1;
}
.rh-kpi-val.is-success { color: var(--rh-success); }
.rh-kpi-val.is-info    { color: var(--rh-info); }
.rh-kpi-val.is-warning { color: var(--rh-warning); }
.rh-kpi-val.is-danger  { color: var(--rh-danger); }
.rh-kpi-val .unit { color: var(--rh-fg-faint); font-size: 15px; font-weight: 500; margin-left: 2px; }
.rh-kpi-sub {
    font-size: 11.5px;
    color: var(--rh-fg-faint);
    margin-top: var(--rh-s-2);
    font-family: var(--rh-font-mono);
}
@media (max-width: 1100px) { .rh-kpis { grid-template-columns: repeat(2, 1fr); } }


/* ── small caps card title (with icon) ───────────────────────────────────── */
.rh-card-head-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--rh-s-3);
    gap: var(--rh-s-3);
    flex-wrap: wrap;
}
/* When .rh-card-head-v2 is dropped directly inside .rh-card (i.e. the
   template skips the .rh-card-body wrapper because the content below is a
   chart / grid / activity feed that wants its own layout), give the head
   the same horizontal padding rh-card-body would have provided. Otherwise
   the title sits flush against the card border. */
.rh-card > .rh-card-head-v2 {
    padding: var(--rh-s-5) var(--rh-s-5) 0;
}
/* Same problem for the body-less content siblings — chart canvases, uptime
   grids, activity feeds, server-rendered SVGs. Pad them so they line up
   under the head and don't kiss the card edge. */
.rh-card > .rh-uptime-grid,
.rh-card > .rh-uptime-grid-legend,
.rh-card > .rh-activity,
.rh-card > .chart-container,
.rh-card > svg,
.rh-card > .rh-config-row {
    padding-left: var(--rh-s-5);
    padding-right: var(--rh-s-5);
}
.rh-card > .rh-uptime-grid:last-child,
.rh-card > .rh-uptime-grid-legend:last-child,
.rh-card > .rh-activity:last-child,
.rh-card > .chart-container:last-child,
.rh-card > svg:last-child,
.rh-card > .rh-config-row:last-child {
    padding-bottom: var(--rh-s-5);
}
.rh-card-title-v2 {
    font-family: var(--rh-font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--rh-fg-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
}
.rh-card-title-v2 i { color: var(--rh-purple-glow); font-size: 16px; }


/* ── result row status (mono dot + label) ────────────────────────────────── */
.rh-r-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--rh-font-mono);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.rh-r-status.ok   { color: var(--rh-success); }
.rh-r-status.warn { color: var(--rh-warning); }
.rh-r-status.bad  { color: var(--rh-danger); }
.rh-r-status.muted { color: var(--rh-fg-faint); }
.rh-r-status .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}


/* ── auth badges (SPF / DKIM / DMARC pass-fail-none mini) ────────────────── */
.rh-auth-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rh-auth-badges > span {
    font-family: var(--rh-font-mono);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: .04em;
}
.rh-auth-badges .pass { background: rgba(45, 212, 127, .18); color: var(--rh-success); }
.rh-auth-badges .fail { background: rgba(255, 77, 109, .18); color: var(--rh-danger); }
.rh-auth-badges .none { background: rgba(255, 255, 255, .06); color: var(--rh-fg-faint); }


/* ── config row (right rail on monitor detail) ───────────────────────────── */
.rh-config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--rh-border);
    font-size: 13.5px;
    gap: var(--rh-s-3);
}
.rh-config-row:last-child { border-bottom: none; }
.rh-config-row > span { color: var(--rh-fg-faint); flex-shrink: 0; }
.rh-config-row > strong {
    font-family: var(--rh-font-mono);
    font-weight: 500;
    color: var(--rh-fg);
    font-size: 13px;
    text-align: right;
    word-break: break-all;
}


/* ── alerts-pill (right rail) ────────────────────────────────────────────── */
.rh-alerts-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--rh-r-pill);
    background: var(--rh-bg-inset);
    border: 1px solid var(--rh-border);
    font-size: 12px;
    color: var(--rh-fg-muted);
    margin-right: 6px;
    margin-bottom: 6px;
}
.rh-alerts-pill i { color: var(--rh-purple-glow); font-size: 13px; }


/* ── two-column page shell (alerts list+editor, settings nav+content) ────── */
.rh-split-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: var(--rh-s-5);
    align-items: flex-start;
}
.rh-split-3-7 {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--rh-s-6);
    align-items: flex-start;
}
@media (max-width: 1100px) {
    .rh-split-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .rh-split-3-7 { grid-template-columns: 1fr; }
}


/* ── settings sticky sub-nav ─────────────────────────────────────────────── */
.rh-settings-nav {
    position: sticky;
    top: var(--rh-s-6);
    background: var(--rh-bg-elev1);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    padding: var(--rh-s-2);
}
.rh-settings-nav h6 {
    font-size: var(--rh-t-xs);
    color: var(--rh-fg-faint);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin: var(--rh-s-3) var(--rh-s-2) var(--rh-s-2);
}
.rh-settings-nav h6:first-child { margin-top: var(--rh-s-1); }
.rh-settings-nav a {
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
    padding: 8px var(--rh-s-3);
    border-radius: var(--rh-r-sm);
    color: var(--rh-fg-muted);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    text-decoration: none;
}
.rh-settings-nav a:hover { background: rgba(255, 255, 255, .04); color: var(--rh-fg); text-decoration: none; }
.rh-settings-nav a.is-active {
    background: rgba(101, 0, 205, .18);
    color: var(--rh-fg);
    box-shadow: inset 2px 0 0 var(--rh-purple-glow);
}
.rh-settings-nav a.is-danger { color: var(--rh-danger); }
.rh-settings-nav a.is-danger:hover { background: rgba(255, 77, 109, .08); color: var(--rh-danger); }
.rh-settings-nav a i { width: 16px; text-align: center; }


/* ── search input ────────────────────────────────────────────────────────── */
.rh-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}
.rh-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rh-fg-faint);
    font-size: 14px;
    pointer-events: none;
}
.rh-search-wrap input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--rh-bg-inset);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-sm);
    color: var(--rh-fg);
    font-family: inherit;
    font-size: var(--rh-t-sm);
}
.rh-search-wrap input:focus {
    outline: none;
    border-color: rgba(101, 0, 205, .55);
    background: var(--rh-bg-base);
}


/* ── usage chip ─────────────────────────────────────────────────────────── */
.rh-usage-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--rh-r-pill);
    background: var(--rh-bg-inset);
    border: 1px solid var(--rh-border);
    font-family: var(--rh-font-mono);
    font-size: var(--rh-t-xs);
    color: var(--rh-fg-muted);
}


/* ── danger zone card ───────────────────────────────────────────────────── */
.rh-danger-zone {
    background: linear-gradient(135deg, rgba(255, 77, 109, .08), transparent);
    border: 1px solid rgba(255, 77, 109, .32);
    border-radius: var(--rh-r-md);
    padding: var(--rh-s-5);
}
.rh-danger-zone h3 {
    font-family: var(--rh-font-display);
    font-size: var(--rh-t-md);
    color: var(--rh-danger);
    margin: 0 0 var(--rh-s-2);
    display: flex;
    align-items: center;
    gap: var(--rh-s-2);
}


/* ── notice card (info / warn / danger) — used in settings ───────────────── */
.rh-notice {
    border: 1px solid;
    border-left-width: 3px;
    border-radius: var(--rh-r-sm);
    padding: var(--rh-s-3);
    display: flex;
    align-items: flex-start;
    gap: var(--rh-s-2);
    font-size: var(--rh-t-sm);
}
.rh-notice > i { margin-top: 2px; flex-shrink: 0; }
.rh-notice.is-info    { border-color: rgba(74, 180, 255, .32); background: rgba(74, 180, 255, .06); }
.rh-notice.is-info > i { color: var(--rh-info); }
.rh-notice.is-warn    { border-color: rgba(247, 181, 0, .32); background: rgba(247, 181, 0, .06); }
.rh-notice.is-warn > i { color: var(--rh-warning); }
.rh-notice.is-danger  { border-color: rgba(255, 77, 109, .32); background: rgba(255, 77, 109, .06); }
.rh-notice.is-danger > i { color: var(--rh-danger); }


/* ── responsive — collapse stat grids on small screens ──────────────────── */
@media (max-width: 1100px) {
    .rh-stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .rh-stat-grid-4 { grid-template-columns: 1fr; }
    .rh-page-head { flex-direction: column; align-items: flex-start; }
    .rh-page-actions { width: 100%; }
}


/* ── read-only demo banner (body.is-demo) ────────────────────────────────
   Rendered above the topbar on every /demo/* page. The "is-demo" body
   class also gates the JS submit-interceptor in layout/base.twig. */
.rh-demo-banner {
    background: linear-gradient(135deg, rgba(247, 181, 0, .18), rgba(247, 181, 0, .06));
    border-bottom: 1px solid rgba(247, 181, 0, .35);
    color: var(--rh-fg);
    padding: 10px var(--rh-s-6);
    display: flex;
    align-items: center;
    gap: var(--rh-s-3);
    font-size: var(--rh-t-sm);
    flex-wrap: wrap;
}
.rh-demo-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--rh-r-pill);
    background: var(--rh-warning);
    color: var(--rh-bg-deepest);
    font-family: var(--rh-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.rh-demo-copy { color: var(--rh-fg-muted); }
.rh-demo-copy a { color: var(--rh-warning); font-weight: 600; text-decoration: none; }
.rh-demo-copy a:hover { text-decoration: underline; }

/* On demo pages, visually mute every action-style button and form-submit so
   it's obvious nothing will actually happen on click. The submit-interceptor
   JS still fires regardless of styling. */
body.is-demo .rh-btn-danger,
body.is-demo .rh-btn-primary,
body.is-demo button[type="submit"]:not(.rh-allow-on-demo) {
    opacity: .6;
    cursor: not-allowed;
}
body.is-demo .rh-btn-danger:hover,
body.is-demo .rh-btn-primary:hover,
body.is-demo button[type="submit"]:not(.rh-allow-on-demo):hover {
    opacity: .6;
}

/* Sticky toast surfaced by the demo submit-interceptor in layout/base.twig
   when the visitor tries to submit a state-changing form. Replaces the
   blocking native `alert()` we used to fire. Auto-hides after ~3 seconds. */
.rh-demo-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 12px);
    background: var(--rh-bg-elev2);
    color: var(--rh-fg);
    border: 1px solid var(--rh-border-strong);
    border-left: 3px solid var(--rh-warning);
    border-radius: var(--rh-r-md);
    padding: 12px 18px;
    font-size: var(--rh-t-sm);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    max-width: 420px;
}
.rh-demo-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
