:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #17202a;
    --muted: #667085;
    --line: #e5e8ef;
    --red: #ef233c;
    --red-dark: #b9152b;
    --black: #0a0d12;
    --green: #16c784;
    --amber: #f59e0b;
    --shadow: 0 18px 55px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.public-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(239, 35, 60, .12), transparent 30%),
        linear-gradient(135deg, #0a0d12 0%, #161b24 42%, #f4f6f8 42%, #f4f6f8 100%);
}

.privacy-wrap {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.privacy-hero {
    color: #fff;
    padding: 30px 0 34px;
}

.public-brand {
    margin-bottom: 34px;
}

.privacy-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(36px, 6vw, 62px);
    letter-spacing: 0;
}

.privacy-hero p {
    color: #cbd5e1;
    font-weight: 800;
}

.privacy-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 44px);
}

.privacy-card h2 {
    margin: 28px 0 10px;
    font-size: 22px;
}

.privacy-card h2:first-child {
    margin-top: 0;
}

.privacy-card p, .privacy-card li {
    color: var(--muted);
    font-weight: 650;
    line-height: 1.75;
}

.privacy-card ul {
    padding-left: 22px;
}

.privacy-card a {
    color: var(--red);
    font-weight: 900;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: linear-gradient(180deg, #0a0d12 0%, #151922 100%);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 12px 0 40px rgba(12, 16, 23, .18);
}

.brand, .login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--red), #ff5c6c);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(239, 35, 60, .28);
}

.brand strong, .login-brand strong {
    display: block;
    font-size: 18px;
    letter-spacing: 0;
}

.brand small, .login-brand small, .sidebar-footer small, td small {
    display: block;
    color: #98a2b3;
    margin-top: 3px;
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 42px;
}

.nav a {
    padding: 13px 14px;
    border-radius: 8px;
    color: #d0d5dd;
    font-weight: 700;
}

.nav-section {
    display: block;
    margin: 18px 6px 4px;
    color: #667085;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav a.active, .nav a:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.main {
    margin-left: 280px;
    padding: 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 30px;
}

.eyebrow {
    margin: 0;
    color: var(--red);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 11px 15px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
}

.btn.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    box-shadow: 0 12px 28px rgba(239, 35, 60, .18);
}

.btn.danger {
    color: #fff;
    background: #b42318;
}

.btn.small {
    min-height: 30px;
    padding: 7px 10px;
    font-size: 12px;
}

.btn.ghost, .pill {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.pill {
    border-radius: 999px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card, .panel, .router-hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    margin-top: 8px;
}

.stat-card.ok {
    border-color: rgba(22,199,132,.28);
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 0;
    font-size: 20px;
}

.page-panel {
    min-height: calc(100vh - 110px);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart {
    width: 100%;
    max-height: 300px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.link-strong {
    display: block;
    font-weight: 900;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    background: #eef2f7;
    color: #344054;
}

.status.ok { color: #057a55; background: #dcfaec; }
.status.warn { color: #92400e; background: #fef3c7; }
.status.muted { color: #667085; background: #f2f4f7; }
.status.neutral { color: #304673; background: #e7eefc; }

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .65fr);
    gap: 18px;
}

.router-hero {
    padding: 24px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    background:
        radial-gradient(circle at top right, rgba(239,35,60,.16), transparent 36%),
        linear-gradient(135deg, #10141b, #1b202a);
    color: #fff;
}

.sync-banner {
    margin: -4px 0 18px;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.sync-banner strong {
    display: block;
    margin-bottom: 3px;
}

.sync-banner span,
.sync-banner small {
    color: var(--muted);
}

.sync-banner.ok {
    border-color: rgba(22,199,132,.28);
    background: #f2fff8;
}

.sync-banner.warn {
    border-color: rgba(245,158,11,.30);
    background: #fffbeb;
}

.sync-banner.neutral {
    border-color: #d9e4ff;
    background: #f5f8ff;
}

.router-hero h2 {
    margin: 8px 0 12px;
    font-size: 30px;
}

.hero-metrics {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hero-metrics span {
    min-width: 110px;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #d0d5dd;
}

.hero-metrics strong {
    display: block;
    color: #fff;
    font-size: 20px;
}

.form {
    display: grid;
    gap: 12px;
}

.form label {
    font-weight: 800;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

.compact input, .compact select, .compact textarea {
    padding: 10px 11px;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.command-row {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 10px;
}

.password-command-row {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.password-command-row strong {
    display: block;
}

.password-command-row small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.command-list, .list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.command-list > div, .list-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.command-panel {
    align-self: start;
}

.command-item {
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.command-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(180, 35, 24, .22);
    border-radius: 8px;
    background: #fff7f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.danger-zone strong {
    display: block;
    color: #8a1f16;
}

.danger-zone small,
.muted {
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.site-item {
    color: inherit;
}

.site-counts {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.account-list {
    display: grid;
    gap: 12px;
}

.account-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px 18px;
    align-items: start;
}

.account-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    font-weight: 900;
}

.account-main strong {
    display: block;
}

.account-main small {
    color: var(--muted);
}

.account-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.account-sites, .access-details {
    grid-column: 1 / -1;
}

.site-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.site-badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #fff1f2;
    color: var(--red-dark);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
}

.site-badges small {
    color: inherit;
    opacity: .7;
}

.access-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.access-details {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.access-details summary {
    cursor: pointer;
    color: var(--red-dark);
    font-weight: 900;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    font-weight: 800;
    color: var(--ink);
}

.check-grid input {
    width: auto;
}

.radio-grid label {
    align-items: flex-start;
}

.radio-grid small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    font-weight: 700;
}

.site-radio-matrix {
    display: grid;
    gap: 12px;
}

.site-radio-router {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcfd;
}

.site-radio-router strong {
    display: block;
}

.site-radio-router small {
    color: var(--muted);
}

.compact-radio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.per-radio-grid {
    align-items: stretch;
}

.radio-config-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 11px;
}

.radio-card-head {
    border: 0 !important;
    padding: 0 !important;
    margin-bottom: 12px;
    background: transparent !important;
}

.radio-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.radio-control-grid label {
    display: block;
    border: 0;
    padding: 0;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.radio-control-grid select {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
}

.section-divider {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.section-divider h3 {
    margin: 4px 0 0;
    font-size: 16px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px;
    color: var(--ink) !important;
}

.toggle-row input {
    width: auto;
}

.danger-toggle {
    border-color: rgba(239,35,60,.28);
    background: #fff7f8;
}

.danger-toggle span {
    color: var(--red-dark);
    font-weight: 900;
}

.inline-action {
    margin-top: 12px;
}

.icon-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 18, .58);
    backdrop-filter: blur(8px);
}

.modal-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
    padding: 22px;
}

.modal-header, .modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.modal-header {
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 4px 0 0;
}

.modal-actions {
    margin-top: 8px;
    justify-content: flex-end;
}

.config-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.config-preview span {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--muted);
    font-weight: 800;
}

.config-preview strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
}

.scroll {
    max-height: 520px;
    overflow: auto;
}

.empty, .muted {
    color: var(--muted);
}

.alert {
    padding: 13px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 800;
}

.alert.success { background: #dcfaec; color: #057a55; }
.alert.error { background: #fee4e2; color: #b42318; }

.login-page {
    display: grid;
    grid-template-columns: 460px 1fr;
    background: #080b10;
}

.login-panel {
    min-height: 100vh;
    padding: 58px;
    background: rgba(10,13,18,.96);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-panel h1 {
    font-size: 42px;
    margin: 70px 0 12px;
}

.login-panel p {
    color: #b9c0cd;
    line-height: 1.6;
}

.login-panel footer {
    margin-top: auto;
    color: #8b95a7;
    font-size: 13px;
}

.login-panel input {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.18);
    color: #fff;
}

.login-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 45%, rgba(239,35,60,.42), transparent 28%),
        linear-gradient(135deg, rgba(6,9,14,.72), rgba(6,9,14,.20)),
        url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.grid-glow {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 20%, transparent 72%);
}

.visual-card {
    position: absolute;
    right: 58px;
    bottom: 58px;
    width: 360px;
    padding: 24px;
    color: #fff;
    background: rgba(10,13,18,.70);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    backdrop-filter: blur(14px);
}

.visual-card span {
    color: #ff6373;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.visual-card strong {
    display: block;
    margin-top: 10px;
    font-size: 22px;
    line-height: 1.25;
}

.stat-card {
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

a.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(239,35,60,.32);
    box-shadow: 0 22px 62px rgba(15, 23, 42, .14);
}

.warn-card {
    border-color: rgba(245,158,11,.28);
}

.warn-card strong {
    color: #b45309;
}

.site-list {
    display: grid;
    gap: 12px;
}

.site-card {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.site-card.selected {
    border-color: rgba(239,35,60,.45);
    box-shadow: inset 4px 0 0 var(--red);
}

.site-card strong, .interface-card strong {
    display: block;
    font-size: 16px;
}

.site-card small, .interface-card small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.site-card-metrics {
    display: flex;
    gap: 10px;
}

.site-card-metrics span {
    min-width: 86px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    background: #fff;
}

.site-card-metrics strong {
    font-size: 20px;
}

.card-actions, .split-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.wide-modal {
    width: min(920px, 100%);
}

.narrow-panel {
    max-width: 760px;
}

.user-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.user-list-head {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px 1fr 90px;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.user-list .account-card {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    grid-template-columns: minmax(280px, 1fr) 220px 1fr 90px;
    align-items: center;
    padding: 14px 16px;
}

.user-list .account-card:last-child {
    border-bottom: 0;
}

.user-list .account-meta {
    justify-content: flex-start;
}

.user-list .account-sites {
    grid-column: auto;
    margin-top: 0;
}

.user-list .site-badges {
    margin-top: 0;
}

.interface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.interface-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.audit-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px 160px auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.update-panel {
    border-color: rgba(239, 35, 60, .22);
}

.update-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: end;
}

.update-grid p {
    margin: 0 0 14px;
    max-width: 820px;
    line-height: 1.55;
}

.api-health {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    font-size: 13px;
}

.api-health span {
    color: var(--muted);
    font-weight: 800;
}

.api-health a {
    color: var(--red);
    font-weight: 900;
}

.update-form {
    display: grid;
    gap: 10px;
}

.update-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 900;
}

.audit-table {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.audit-head, .audit-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(180px, .8fr) minmax(280px, 1.2fr) 130px;
    gap: 14px;
    align-items: center;
}

.audit-head {
    padding: 12px 16px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.audit-row {
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}

.audit-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audit-main small, .audit-context small {
    color: var(--muted);
    display: block;
    margin-top: 3px;
}

.audit-icon, .small-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    font-weight: 900;
}

.audit-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.audit-details span {
    border-radius: 999px;
    padding: 6px 9px;
    background: #f2f4f7;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.audit-details strong {
    color: var(--ink);
}

.audit-row time {
    color: var(--muted);
    text-align: right;
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.pagination a:last-child {
    justify-self: end;
}

@media (max-width: 980px) {
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        inset: auto;
        width: 100%;
        min-height: auto;
        padding: 12px;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        overflow-x: auto;
        box-shadow: 0 12px 28px rgba(12, 16, 23, .18);
    }

    .brand {
        min-width: max-content;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small, .nav-section, .sidebar-footer {
        display: none;
    }

    .nav {
        display: flex;
        gap: 8px;
        margin-top: 0;
        overflow-x: auto;
        min-width: 0;
        padding-bottom: 2px;
    }

    .nav a {
        white-space: nowrap;
        padding: 10px 12px;
    }

    .main {
        margin-left: 0;
        padding: 14px;
    }

    .stats-grid, .grid-2, .login-page, .form-grid, .site-card, .user-list-head,
    .user-list .account-card, .audit-filters, .audit-head, .audit-row, .update-grid,
    .site-radio-router, .compact-radio-grid, .radio-control-grid, .command-row, .password-command-row {
        grid-template-columns: 1fr;
    }

    .account-card {
        grid-template-columns: 1fr;
    }

    .account-meta {
        justify-content: flex-start;
    }

    .login-visual {
        display: none;
    }

    .top-actions, .page-actions, .modal-actions {
        flex-wrap: wrap;
    }

    .hero-metrics, .router-hero, .topbar, .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal {
        align-items: flex-start;
        padding: 12px;
    }

    .modal-dialog, .wide-modal {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

    th, td {
        padding: 11px 10px;
    }
}
