/* AuDHD staging — admin pages (audit / system status / settings / users / comfort)
   Loaded after app.css and the other audhd-*.css files via index.html.
   Lives in web-staging only; never deployed to prod. */

/* ──────────────────────────────────────────────────────────────────────
   T4.13 — /audit grouped + coalesced rendering
   ────────────────────────────────────────────────────────────────────── */

/* Section divider rows. Span the full table width with a slim, calm header
   that breaks the 40-row sea into Vandaag / Gisteren / Eerder deze week /
   {Maand jaar} chunks. Calm, never sticky — a sticky header would amplify
   the scan-tax. */
.audit-table--grouped .ah-section-divider td {
    background: transparent;
    color: var(--color-text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 18px 12px 8px;
    border-bottom: 1px solid var(--color-line);
}

.audit-table--grouped .ah-section-divider:first-child td {
    padding-top: 6px;
}

.ah-section-divider--mobile {
    color: var(--color-text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 14px 12px 6px;
}

/* Two-line timestamp: absolute (HH:MM) on top, relative (X min geleden)
   muted underneath. Both render on every row so the user can scan either
   axis. tabular-nums keeps "12:08 / 1 min geleden" stacked aligned. */
.ah-time-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
}

.ah-time-stack .ah-time-abs {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ah-time-stack .ah-time-rel,
.ah-time-rel {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

/* Coalesced cluster summary — single row standing in for many. */
.audit-table--grouped .ah-cluster-row td {
    background: rgba(255, 255, 255, 0.025);
}

.ah-cluster-expand {
    margin-left: 8px;
    background: transparent;
    border: 0;
    color: var(--color-accent, #4ea1ff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

.ah-cluster-expand:hover,
.ah-cluster-expand:focus-visible {
    background: rgba(78, 161, 255, 0.12);
    outline: none;
}

.ah-cluster-head td {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    padding: 8px 12px;
    border-top: 1px solid var(--color-line);
    border-bottom: 1px dashed var(--color-line);
}

.ah-cluster-head--mobile {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 6px 0;
}

.audit-table--grouped .ah-cluster-child td:first-child {
    padding-left: 28px;
}

.audit-table--grouped .ah-cluster-child td {
    background: rgba(255, 255, 255, 0.018);
}

.ah-cluster-card {
    border-left: 3px solid var(--color-accent, #4ea1ff);
}

/* "Geen gegevens" pill replaces dual em-dash columns when both ISP and
   Locatie are null. One muted chip, no scan tax. */
.ah-empty-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ──────────────────────────────────────────────────────────────────────
   T4.15 — Settings danger zone (Verwijder behind Geavanceerd)
   ────────────────────────────────────────────────────────────────────── */

.ah-danger-zone {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px dashed rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ah-danger-zone-label {
    color: rgba(239, 110, 110, 0.85);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ah-danger-zone-hint {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.ah-danger-zone-confirm-text {
    color: var(--color-text);
    font-size: 0.88rem;
}

.ah-danger-zone-confirm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────
   T4.17 — /gebruikers Bewerken affordance
   ────────────────────────────────────────────────────────────────────── */

.ah-user-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ah-user-row-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.ah-user-row-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 160ms ease, color 160ms ease;
}

.ah-user-row:hover .ah-user-row-edit,
.ah-user-row:focus-visible .ah-user-row-edit,
.ah-user-row.selected .ah-user-row-edit {
    background: rgba(78, 161, 255, 0.16);
    color: var(--color-accent, #4ea1ff);
}

.ah-user-row-edit-chevron {
    font-size: 1.05rem;
    line-height: 1;
}

/* ──────────────────────────────────────────────────────────────────────
   T4.18 — /comfort desktop styling
   ────────────────────────────────────────────────────────────────────── */

/* The .domain-preview rules in app.css are wrapped in @media (max-width:1100px)
   so on desktop the cards have no styling at all — broken anchor underlines,
   no spacing, "22°CInlaat" runs together because the value/label spans are
   inline by default. Mirror the mobile styling here, scaled for desktop. */
@media (min-width: 1101px) {
    .comfort-desktop-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        margin-top: 16px;
    }

    .comfort-desktop-grid .domain-preview {
        display: grid;
        gap: 12px;
        padding: 20px;
        border: 1px solid var(--color-line);
        border-radius: 18px;
        background: var(--color-bg-alt);
        text-decoration: none;
        color: var(--color-text);
        cursor: pointer;
        transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
    }

    .comfort-desktop-grid .domain-preview:hover,
    .comfort-desktop-grid .domain-preview:focus-visible {
        border-color: var(--color-line-strong, rgba(255, 255, 255, 0.18));
        background: rgba(255, 255, 255, 0.03);
        outline: none;
    }

    .comfort-desktop-grid .domain-preview-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .comfort-desktop-grid .domain-preview-icon {
        display: inline-grid;
        place-items: center;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .comfort-desktop-grid .domain-preview-icon svg {
        width: 22px;
        height: 22px;
    }

    .comfort-desktop-grid .domain-preview-title {
        font-family: 'Sora', sans-serif;
        font-size: 1.02rem;
        font-weight: 700;
        letter-spacing: -0.03em;
        flex: 1 1 0;
        min-width: 0;
    }

    .comfort-desktop-grid .domain-preview-chevron {
        color: var(--color-text-muted);
        font-size: 1.3rem;
        font-weight: 700;
        flex-shrink: 0;
    }

    .comfort-desktop-grid .domain-preview-summary {
        color: var(--color-text-soft, var(--color-text-muted));
        font-size: 0.88rem;
        margin: 0;
        line-height: 1.4;
    }

    /* Stats row — display:flex with gap fixes the "22°CInlaat" run-together
       bug (spans were defaulting to inline display with no whitespace). */
    .comfort-desktop-grid .domain-preview-stats {
        display: flex;
        gap: 18px;
        flex-wrap: wrap;
    }

    .comfort-desktop-grid .domain-preview-stat {
        display: grid;
        gap: 2px;
    }

    .comfort-desktop-grid .domain-preview-stat-value {
        font-size: 1.15rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.02em;
        color: var(--color-text);
    }

    .comfort-desktop-grid .domain-preview-stat-label {
        color: var(--color-text-muted);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
}
