/* =====================================================================
   CloudWRT Admin · Design system
   ---------------------------------------------------------------------
   A refined dark "network operations console" aesthetic. Deep graphite
   surfaces, hairline borders, a single warm amber accent for actionable
   moments, and a typography pairing (Bricolage / Hanken / JetBrains Mono)
   designed to feel professional but never generic.
   ===================================================================== */

/* -- 0. Reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* -- 1. Tokens --------------------------------------------------------- */
:root {
    /* Surfaces */
    --bg:           #0a0d12;
    --bg-grad:      radial-gradient(1200px 600px at 12% -10%, #131822 0%, #0a0d12 60%);
    --surface:      #11151c;
    --surface-2:    #161b25;
    --surface-3:    #1a2030;
    --surface-hi:   #20283a;

    /* Borders */
    --border:       rgba(255, 255, 255, 0.07);
    --border-hi:    rgba(255, 255, 255, 0.13);
    --hairline:     rgba(255, 255, 255, 0.045);

    /* Text */
    --text-1:       #e6ebf2;
    --text-2:       #a8b1c0;
    --text-3:       #6c7589;
    --muted:        #5b6374;

    /* Accent (single warm signal colour) */
    --accent:       #f5a524;
    --accent-soft:  rgba(245, 165, 36, 0.14);
    --accent-line:  rgba(245, 165, 36, 0.35);

    /* States */
    --green:        #3ecf8e;
    --green-soft:   rgba(62, 207, 142, 0.14);
    --red:          #f87171;
    --red-soft:     rgba(248, 113, 113, 0.13);
    --yellow:       #facc15;
    --yellow-soft:  rgba(250, 204, 21, 0.13);
    --blue:         #60a5fa;
    --blue-soft:    rgba(96, 165, 250, 0.13);
    --violet:       #a78bfa;
    --violet-soft:  rgba(167, 139, 250, 0.13);

    /* Radii / spacing */
    --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 18px;

    /* Shadows */
    --shadow-1: 0 1px 0 rgba(255,255,255,0.03) inset, 0 0 0 1px var(--border);
    --shadow-2: 0 4px 16px rgba(0,0,0,0.35), 0 0 0 1px var(--border);
    --shadow-pop: 0 12px 36px rgba(0,0,0,0.5), 0 0 0 1px var(--border-hi);

    /* Typography */
    --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
    --font-body:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --layout-side: 232px;
    --layout-top:  64px;
}

/* -- 2. Body ---------------------------------------------------------- */
body {
    font-family: var(--font-body);
    font-feature-settings: 'ss01', 'cv11';
    color: var(--text-1);
    background: var(--bg);
    background-image: var(--bg-grad);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    /* Subtle grain texture for atmosphere */
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}

body.plain {
    display: grid;
    place-items: center;
    padding: 48px 24px;
}

/* -- 3. Layout -------------------------------------------------------- */
.layout {
    display: grid;
    grid-template-columns: var(--layout-side) 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.layout__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.content {
    flex: 1;
    padding: 28px 36px 64px;
    max-width: 1480px;
    width: 100%;
}
.appfoot {
    padding: 16px 36px 24px;
    border-top: 1px solid var(--hairline);
}

/* -- 4. Sidebar ------------------------------------------------------- */
.sidebar {
    background: linear-gradient(180deg, #0d1118 0%, #0a0d12 100%);
    border-right: 1px solid var(--border);
    padding: 18px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar__brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
    padding: 6px 8px 18px;
    border-bottom: 1px solid var(--hairline);
}
.sidebar__brand svg { width: 32px; height: 32px; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar__brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.sidebar__brand-sub {
    color: var(--muted);
    font-size: 10.5px;
    letter-spacing: 0.05em;
    margin-top: 2px;
}
.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
.navlink {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    text-decoration: none;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 120ms, color 120ms;
}
.navlink__icon {
    width: 18px; height: 18px;
    display: grid; place-items: center;
    color: var(--text-3);
    flex-shrink: 0;
}
.navlink__icon svg { width: 16px; height: 16px; }
.navlink__label { flex: 1; }
.navlink:hover {
    background: var(--surface);
    color: var(--text-1);
}
.navlink:hover .navlink__icon { color: var(--text-1); }
.navlink.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent);
}
.navlink.is-active .navlink__icon { color: var(--accent); }
.sidebar__footer { border-top: 1px solid var(--hairline); padding-top: 12px; }
.sidebar__me {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    text-decoration: none;
}
.sidebar__me:hover { background: var(--surface); }
.sidebar__me-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__me-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.sidebar__me-role {
    font-size: 10.5px; color: var(--text-3); text-transform: uppercase;
    letter-spacing: 0.06em;
}
.avatar {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #1a1106;
    font-weight: 700;
    font-size: 13px;
}

/* -- 5. Topbar -------------------------------------------------------- */
.topbar {
    height: var(--layout-top);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 36px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(10, 13, 18, 0.65);
    backdrop-filter: blur(12px);
    position: sticky; top: 0;
    z-index: 10;
}
.topbar__heading {
    display: flex; align-items: baseline; gap: 14px;
}
.topbar__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}
.topbar__crumb {
    color: var(--text-3);
}
.topbar__actions {
    display: flex; align-items: center; gap: 8px;
}

/* -- 6. Buttons ------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px;
    border-radius: var(--r-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-1);
    transition: all 130ms;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled {
    opacity: 0.45; pointer-events: none;
}

.btn--sm { padding: 6px 10px; font-size: 12.5px; border-radius: 5px; }
.btn--lg { padding: 11px 18px; font-size: 14.5px; }

.btn--accent {
    background: var(--accent);
    color: #1a1106;
    border-color: transparent;
    font-weight: 600;
}
.btn--accent:hover { background: #ffb13d; }

.btn--ghost {
    background: transparent;
    border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface); }

.btn--danger {
    background: var(--red-soft);
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.26);
}
.btn--danger:hover { background: rgba(248, 113, 113, 0.22); }

.btn--success {
    background: var(--green-soft);
    color: var(--green);
    border-color: rgba(62, 207, 142, 0.3);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* -- 7. Forms --------------------------------------------------------- */
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.field__hint { font-size: 12px; color: var(--text-3); }
.field__error { font-size: 12.5px; color: var(--red); }

.input, .select, .textarea {
    width: 100%;
    background: var(--surface);
    color: var(--text-1);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 9px 11px;
    font-family: var(--font-body);
    font-size: 13.5px;
    transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.textarea { min-height: 120px; resize: vertical; line-height: 1.55; font-family: var(--font-body); }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c7589'><path d='M4 6l4 4 4-4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.input--mono, .textarea--mono { font-family: var(--font-mono); font-size: 13px; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { accent-color: var(--accent); width: 14px; height: 14px; }

/* -- 8. Cards / panels ------------------------------------------------ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.panel__header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}
.panel__sub { color: var(--text-3); font-size: 12.5px; }
.panel__body { padding: 18px; }
.panel__body--flush { padding: 0; }
.panel__footer {
    padding: 12px 18px;
    border-top: 1px solid var(--hairline);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

/* Stat card row */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute; right: -22px; top: -22px;
    width: 80px; height: 80px;
    background: radial-gradient(circle at center, var(--stat-tint, var(--accent-soft)) 0%, transparent 65%);
}
.stat__label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 6px;
}
.stat__value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-1);
    line-height: 1;
    font-feature-settings: 'tnum';
}
.stat__delta {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 6px;
    font-family: var(--font-mono);
}
.stat--accent  { --stat-tint: var(--accent-soft); }
.stat--green   { --stat-tint: var(--green-soft); }
.stat--blue    { --stat-tint: var(--blue-soft); }
.stat--red     { --stat-tint: var(--red-soft); }
.stat--violet  { --stat-tint: var(--violet-soft); }
.stat--yellow  { --stat-tint: var(--yellow-soft); }

/* -- 9. Badges -------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
    font-family: var(--font-mono);
    line-height: 1.4;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge--xs { padding: 1px 6px; font-size: 10px; }
.badge--green  { background: var(--green-soft);  color: var(--green);  border-color: rgba(62,207,142,.3); }
.badge--red    { background: var(--red-soft);    color: var(--red);    border-color: rgba(248,113,113,.3); }
.badge--yellow { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(250,204,21,.3); }
.badge--blue   { background: var(--blue-soft);   color: var(--blue);   border-color: rgba(96,165,250,.3); }
.badge--violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(167,139,250,.3); }
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* -- 10. Tables ------------------------------------------------------- */
.tbl-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.2px;
}
.tbl thead th {
    text-align: left;
    padding: 11px 14px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    white-space: nowrap;
}
.tbl thead th a {
    color: inherit; text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.tbl thead th a:hover { color: var(--text-1); }
.tbl tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--hairline);
    color: var(--text-2);
    vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td .strong { color: var(--text-1); font-weight: 500; }
.tbl td a { color: var(--text-1); text-decoration: none; }
.tbl td a:hover { color: var(--accent); }

/* Empty state */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-3);
}
.empty__title { font-family: var(--font-display); font-size: 17px; color: var(--text-2); margin-bottom: 6px; }
.empty__msg { font-size: 13.5px; }

/* -- 11. Filter bar --------------------------------------------------- */
.filterbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    align-items: end;
}
.filterbar__actions {
    grid-column: 1 / -1;
    display: flex; gap: 8px; flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid var(--hairline);
    margin-top: 4px;
}

/* -- 12. Pager -------------------------------------------------------- */
.pager {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 0 0;
    flex-wrap: wrap;
}
.pager__pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager__btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    text-decoration: none;
    color: var(--text-2);
    font-size: 12.5px;
    font-family: var(--font-mono);
}
.pager__btn:hover { background: var(--surface-2); color: var(--text-1); }
.pager__btn.is-current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pager__btn.is-disabled { opacity: 0.35; pointer-events: none; }
.pager__sep { color: var(--text-3); padding: 0 4px; }

/* -- 13. Flash -------------------------------------------------------- */
.flash-stack {
    position: fixed;
    top: 80px;
    right: 30px;
    z-index: 50;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
    max-width: 380px;
}
.flash {
    pointer-events: auto;
    background: var(--surface-3);
    border: 1px solid var(--border-hi);
    border-radius: var(--r-md);
    padding: 11px 14px;
    display: flex; align-items: flex-start; gap: 9px;
    box-shadow: var(--shadow-pop);
    animation: flashIn 200ms ease-out, flashFade 4s 4s forwards;
    font-size: 13.5px;
}
.flash--success { border-color: rgba(62, 207, 142, 0.4); }
.flash--success .flash__bullet { color: var(--green); }
.flash--error   { border-color: rgba(248, 113, 113, 0.4); }
.flash--error .flash__bullet   { color: var(--red); }
.flash--warning { border-color: rgba(250, 204, 21, 0.4); }
.flash--warning .flash__bullet { color: var(--yellow); }
.flash__bullet { font-size: 13px; line-height: 1.55; }
@keyframes flashIn  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes flashFade { to { opacity: 0; transform: translateY(-4px); pointer-events: none; } }

/* -- 14. Page header (intra-content title row) ------------------------ */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 14px;
    margin-bottom: 18px;
}
.page-head__lead {
    color: var(--text-3); font-size: 13.5px;
}
.section-head {
    margin: 28px 0 12px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 8px;
}
.section-head h2 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 0;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* -- 15. Charts / dashboard grid ------------------------------------- */
.chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 2fr 1fr;
}
.chart-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1100px) {
    .chart-grid, .chart-grid--3 { grid-template-columns: 1fr; }
}
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    min-height: 220px;
}
.chart-card__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.chart-card__title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}
.chart-card__total {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
}
.chart-card canvas {
    width: 100% !important;
    height: 240px !important;
}
.chart-legend {
    display: flex; flex-wrap: wrap; gap: 8px 14px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-2);
    font-family: var(--font-mono);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* -- 16. Detail layout ------------------------------------------------ */
.detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 320px;
}
@media (max-width: 1000px) {
    .detail-grid { grid-template-columns: 1fr; }
}
.kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 14px;
    font-size: 13.5px;
}
.kv dt { color: var(--text-3); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 4px; }
.kv dd { color: var(--text-1); margin: 0; word-break: break-word; }

.codeblock {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: #06080c;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    color: var(--text-2);
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.45;
}

/* -- 17. Auth screens ------------------------------------------------- */
.auth {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 36px 32px 32px;
    box-shadow: var(--shadow-pop);
    position: relative;
    z-index: 1;
}
.auth__brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 22px;
}
.auth__brand-mark {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--accent-soft);
    display: grid; place-items: center;
}
.auth__brand-mark svg { width: 22px; height: 22px; }
.auth__brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.auth h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 4px 0 6px;
}
.auth p.lead {
    color: var(--text-3);
    font-size: 13.5px;
    margin: 0 0 22px;
}
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth__qr {
    width: 192px; height: 192px;
    margin: 14px auto 18px;
    background: #fff;
    padding: 10px;
    border-radius: var(--r-md);
}
.auth__qr canvas, .auth__qr img, .auth__qr table {
    width: 100% !important; height: 100% !important;
}
.auth__secret {
    font-family: var(--font-mono);
    font-size: 13.5px;
    text-align: center;
    background: var(--surface-2);
    border: 1px dashed var(--border-hi);
    padding: 10px;
    border-radius: var(--r-md);
    color: var(--accent);
    user-select: all;
    word-break: break-all;
    margin-bottom: 14px;
}
.auth__alt {
    text-align: center;
    margin-top: 18px;
    color: var(--text-3);
    font-size: 12.5px;
}
.auth__alt a { color: var(--accent); text-decoration: none; }

/* -- 18. Misc utilities ----------------------------------------------- */
.mono { font-family: var(--font-mono); }
.small { font-size: 12px; }
.muted { color: var(--text-3); }
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.tabular { font-variant-numeric: tabular-nums; }
.hr { border: 0; border-top: 1px solid var(--hairline); margin: 18px 0; }
.spacer-sm { height: 8px; }
.spacer-md { height: 16px; }
.spacer-lg { height: 28px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.row-actions { display: inline-flex; gap: 4px; }
.row-actions form { display: inline; }
.row-actions .btn { padding: 4px 8px; font-size: 11.5px; }

.hide-on-mobile { }
@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; flex-direction: row; gap: 8px; padding: 12px; overflow: auto; }
    .sidebar__brand { padding: 0 4px; border-bottom: 0; flex-shrink: 0; }
    .sidebar__nav { flex-direction: row; gap: 4px; flex: 1; }
    .navlink__label, .sidebar__brand-text, .sidebar__footer { display: none; }
    .navlink { padding: 8px; }
    .content { padding: 18px; }
    .topbar { padding: 0 18px; }
    .hide-on-mobile { display: none !important; }
    .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

/* -- 19. Sortable header arrows -------------------------------------- */
.sort-arrow { font-size: 9px; opacity: 0.4; }
.sort-arrow.is-active { opacity: 1; color: var(--accent); }

/* -- 20. Tabs --------------------------------------------------------- */
.tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.tabs a {
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tabs a:hover { color: var(--text-1); }
.tabs a.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* -- 21. Tooltip-ish title overrides --------------------------------- */
[title] { cursor: help; }
.btn[title], a[title] { cursor: pointer; }

/* -- 22. User-comment rendering (additional_info) -------------------- */
.comment-cell {
    max-width: 320px;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comment-cell--flagged {
    color: var(--red, #e75252);
    font-weight: 500;
}
.comment-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    line-height: 1.6;
    color: var(--text-1);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 480px;
    overflow-y: auto;
}
.comment-block--flagged {
    border-color: var(--red, #e75252);
    background: rgba(231, 82, 82, 0.06);
}
.comment-masked {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 4px;
    background: rgba(245, 165, 36, 0.12);
    border: 1px solid rgba(245, 165, 36, 0.4);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    cursor: help;
}
.comment-flag-row {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 8px;
}
