/* Radilux design system: styles for the admin area (admin dashboard, users,
   categories, SEO tools, messages, AI settings, contact). Tokens and base
   components live in rl.css. No colour literals here: tokens only. */

/* ── Page frame ───────────────────────────────────────────────────────── */
.rl-adm { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.rl-adm--narrow { max-width: 720px; margin-inline: auto; width: 100%; }
.rl-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.rl-page-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rl-crumb { font-size: .86rem; }
.rl-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rl-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* ── Stat tiles and link tiles ────────────────────────────────────────── */
.rl-stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } /* candidate for rl.css */
.rl-stat-card { padding: 14px 16px; border: 1px solid var(--rl-line); border-radius: var(--rl-radius); background: var(--rl-surface); }
.rl-tile-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.rl-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.rl a.rl-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--rl-line); border-radius: var(--rl-radius); background: var(--rl-surface); color: var(--rl-ink); text-decoration: none; }
.rl a.rl-tile:hover { border-color: var(--rl-accent); text-decoration: none; }
.rl-tile-title { font-family: var(--rl-font-display); font-weight: 650; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.rl-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; } /* candidate for rl.css */
.rl-form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rl-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rl-form-actions--end { justify-content: flex-end; }
.rl-inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.rl-scope label { margin: 0; } /* Bootstrap reboot gives labels a bottom margin */
.rl-field--auto { max-width: 220px; }
.rl-nowrap { white-space: nowrap; }
.rl-select--auto, .rl-input--auto { width: auto; }
.rl-filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rl-filter-bar .rl-field { flex: 1 1 180px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.rl-table--compact th, .rl-table--compact td { padding: 7px 12px; }
.rl-table td.rl-actions, .rl-table th.rl-actions { text-align: right; white-space: nowrap; }
.rl-actions > * + * { margin-left: 6px; }
.rl-cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-scroll { max-height: 380px; overflow: auto; }
.rl-table-wrap.rl-scroll th { position: sticky; top: 0; }
.rl-wrap-anywhere { overflow-wrap: anywhere; }
/* Email column of the users table: wide enough for a normal address on one
   line; a very long one still breaks instead of widening the table forever
   (break-word, unlike anywhere, does not shrink the column to one letter). */
.rl-cell-email { min-width: 13rem; overflow-wrap: break-word; }
/* SEO page: Google's coverage wording under the status badge. */
.seo-coverage { display: block; margin-top: 3px; max-width: 18rem; }
.rl-row-off td { color: var(--rl-muted); }

/* ── Selectable text (replaces copy buttons) ──────────────────────────── */
.rl-select-all { user-select: all; -webkit-user-select: all; } /* candidate for rl.css */
.rl-pre { margin: 0; padding: 12px 14px; border: 1px solid var(--rl-line); border-radius: var(--rl-radius-sm); background: var(--rl-sunken); color: var(--rl-ink); font: .84rem/1.55 var(--rl-font-report); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.rl-code { font-family: var(--rl-font-report); font-size: .84rem; }

/* ── Link tabs / filter chips (server-rendered state) ─────────────────── */
.rl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rl a.rl-chip, .rl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--rl-line-strong); border-radius: 999px; background: var(--rl-surface); color: var(--rl-ink-2); font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.rl a.rl-chip:hover { background: var(--rl-sunken); text-decoration: none; }
.rl a.rl-chip[aria-current="true"], .rl a.rl-chip[aria-current="page"] { background: var(--rl-accent-soft); border-color: var(--rl-accent-line); color: var(--rl-accent); }

/* ── Radio tabs (pure CSS panels): .rl-rtabs > input + label pairs, then panels ── */
.rl-rtabs { display: flex; flex-wrap: wrap; gap: 0 2px; border-bottom: 1px solid var(--rl-line); }
.rl-rtabs > input { position: absolute; opacity: 0; pointer-events: none; }
.rl-rtabs > label { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--rl-muted); font-weight: 600; font-size: .9rem; cursor: pointer; }
.rl-rtabs > input:checked + label { color: var(--rl-accent); border-bottom-color: var(--rl-accent); }
.rl-rtabs > input:focus-visible + label { outline: 2px solid var(--rl-focus); outline-offset: -2px; }
.rl-rpanel { display: none; }
.rl-rtabs-box:has(.rl-rtabs > input:nth-of-type(1):checked) > .rl-rpanel:nth-of-type(1),
.rl-rtabs-box:has(.rl-rtabs > input:nth-of-type(2):checked) > .rl-rpanel:nth-of-type(2),
.rl-rtabs-box:has(.rl-rtabs > input:nth-of-type(3):checked) > .rl-rpanel:nth-of-type(3) { display: flex; flex-direction: column; gap: 12px; }

/* ── Key/value list ───────────────────────────────────────────────────── */
.rl-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.rl-kv dt { color: var(--rl-muted); font-size: .86rem; }
.rl-kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── Two-pane layout (list + detail) ──────────────────────────────────── */
.rl-panes { display: grid; gap: 16px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
@media (max-width: 900px) { .rl-panes { grid-template-columns: minmax(0, 1fr); } }

/* ── Compatibility: pages of this area shown inside a still-legacy shell.
   The Tailwind preflight (injected after rl.css) resets button backgrounds
   with the same specificity as .rl-btn; restate them one step stronger. ── */
.rl-scope .rl-btn { background: var(--rl-surface); }
.rl-scope .rl-btn--primary { background: var(--rl-accent); }
.rl-scope .rl-btn--quiet { background: transparent; }
.rl-scope .rl-btn:hover { background: var(--rl-sunken); }
.rl-scope .rl-btn--primary:hover { background: var(--rl-accent-hover); }
.rl-scope .rl-btn--danger:hover { background: var(--rl-danger-soft); }
.rl-scope .rl-card-head h2 { margin: 0; }
.rl-nav-icon .rl-badge { margin-left: 4px; }

/* ── Messages and contact ── */
.rl-msg-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rl-msg-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.rl-msg-row-name { font-weight: 500; }
.rl a.rl-msg-row { border-left: 3px solid transparent; }
.rl a.rl-msg-row--unread { border-left-color: var(--rl-warn); }
.rl-msg-row--unread .rl-msg-row-name { font-weight: 700; }
.rl-msg-body { font-family: var(--rl-font); font-size: .95rem; }
#messageDetail { min-width: 0; }

/* ── Radio tabs as a fieldset (admin usage details) ── */
fieldset.rl-rtabs { border-width: 0 0 1px; border-style: solid; border-color: var(--rl-line); padding: 0; margin: 0; min-inline-size: 0; }

/* ── SEO tools ── */
.rl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--rl-ink-2); }
.rl-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--rl-accent); }

/* Two side-by-side tables (Analytics page detail), one column on phones. */
.rl-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
