:root {
    color-scheme: dark;
    --bg: #0b0d10;
    --surface: #14171b;
    --surface-2: #191d22;
    --border: #2a2f37;
    --text: #f3f4f6;
    --muted: #8e96a3;
    --accent: #f5a800;
    --accent-2: #ffca42;
    --green: #3dcc78;
    --red: #ff5d62;
    --blue: #5d9cff;
    --purple: #aa7dff;
    --shadow: 0 18px 55px rgba(0, 0, 0, .28);
    --radius: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { transition: border-color .18s ease, background-color .18s ease, color .18s ease, opacity .18s ease, transform .18s ease, box-shadow .18s ease; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(245, 168, 0, .28); color: #fff; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: 12px; padding: 8px 12px; border-radius: 7px; background: var(--accent); color: #171006; font-weight: 800; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 50; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--border); background: linear-gradient(180deg, #12151a 0%, #0d0f12 100%); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { color: var(--accent-2); }
.brand-mark { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #d56d00); color: #171006; box-shadow: 0 8px 24px rgba(245, 168, 0, .18); }
.brand-mark-image { overflow: hidden; background: #20242b; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link { position: relative; padding: 10px 12px; border-radius: 8px; color: #aeb4be; }
.nav-link:hover, .nav-link.is-active { background: #23272d; color: #fff; }
.nav-link.is-active { box-shadow: inset 3px 0 var(--accent), 0 7px 20px #0003; }
.nav-link-danger { margin-top: 8px; color: #d9898d; }
.nav-link-danger:hover, .nav-link-danger.is-active { background: #351b1e; color: #ffb3b6; }
.nav-link-danger.is-active { box-shadow: inset 3px 0 var(--red), 0 7px 20px #0003; }
.sidebar-user { margin-top: auto; display: grid; gap: 14px; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user small { color: var(--muted); }
.page { min-width: 0; }
.topbar { position: sticky; z-index: 35; top: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(16, 18, 22, .9); backdrop-filter: blur(16px); }
.topbar strong { display: block; font-size: 17px; }
.topbar-title, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.admin-public-link { min-height: 32px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.language-switcher { margin: 0; }
.language-switcher button { min-width: 38px; padding: 6px 9px; border-color: var(--border); background: #171a1f; color: var(--accent-2); font-size: 11px; font-weight: 800; }
.auth-language { margin-left: auto; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: #aeb4be; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.page-content { width: min(1500px, 100%); margin: 0 auto; padding: 28px; animation: page-in .28s ease both; }
.page-heading { display: flex; justify-content: space-between; margin-bottom: 22px; }
.page-heading h1 { margin: 4px 0 2px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.page-heading p, .muted { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card, .card, .server-card { border: 1px solid var(--border); background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: 0 8px 30px rgba(0, 0, 0, .09); }
.metric-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 17px; border-radius: 11px; transition: transform .18s ease, border-color .18s ease; }
.metric-card:hover, .server-card:hover { transform: translateY(-2px); border-color: #454c57; }
.metric-card strong, .metric-card span { display: block; }
.metric-card strong { font-size: 24px; line-height: 1.1; }
.metric-card div > span { color: var(--muted); font-size: 12px; }
.metric-icon { width: 9px; height: 38px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 16px #f5a80055; }
.tone-green { background: var(--green); box-shadow: 0 0 16px #3dcc7855; }
.tone-red { background: var(--red); box-shadow: 0 0 16px #ff5d6255; }
.tone-blue { background: var(--blue); box-shadow: 0 0 16px #5d9cff55; }
.tone-purple { background: var(--purple); box-shadow: 0 0 16px #aa7dff55; }
.tone-orange { background: #ff7a29; box-shadow: 0 0 16px #ff7a2955; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 18px; margin-bottom: 18px; }
.card { border-radius: var(--radius); color: var(--text); }
.chart-card, .section-card { padding: 20px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-heading h2 { margin: 2px 0 0; font-size: 18px; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap-small { max-width: 380px; margin: 0 auto; }
.section-card { margin-bottom: 18px; }
.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.server-card { padding: 16px; border-radius: 10px; }
.server-card-top { display: flex; justify-content: space-between; align-items: center; }
.server-card h3 { margin: 16px 0 2px; font-size: 16px; }
.server-card code, .server-card small { display: block; color: var(--muted); }
.server-card small { margin-top: 13px; font-size: 11px; }
.players-count { color: var(--muted); font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status-online { background: #173a27; color: #7ef0a6; }
.status-offline { background: #421f22; color: #ff9296; }
.status-unknown { background: #3a321b; color: #ffd273; }
.status-disabled { background: #292d33; color: #939aa5; }
.table-scroll { overflow-x: auto; scrollbar-color: #444b55 #111419; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
td small { display: block; color: var(--muted); }
.action-label { color: var(--accent-2); font-weight: 700; text-transform: uppercase; font-size: 11px; }
.empty-state, .empty-cell { padding: 28px; color: var(--muted); text-align: center; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border: 1px solid #444b55; border-radius: 7px; background: #24282f; color: #fff; cursor: pointer; text-decoration: none; }
.button-ghost:hover, button:hover { border-color: var(--accent); }
.button:active, button:active { transform: translateY(1px); }
button:disabled, .button.is-disabled { cursor: not-allowed; opacity: .55; }
.alert { margin-bottom: 18px; padding: 10px 12px; border: 1px solid #346a43; border-radius: 8px; background: #183322; color: #b8f3c7; }
.alert-error { border-color: #7d3333; background: #3b1c1c; color: #ffb4b4; }
.management-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; }
.field > span { color: #c9ced6; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .server-picker select, .player-action-fields input, .player-action-fields select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0e1013;
    color: var(--text);
    outline: none;
}
.field select, .server-picker select { appearance: auto; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .player-action-fields input::placeholder { color: #626a76; }
.field input:focus, .field select:focus, .field textarea:focus, .server-picker select:focus, .player-action-fields input:focus, .player-action-fields select:focus { border-color: var(--accent); }
.check-field { display: flex; align-items: center; gap: 8px; color: #c9ced6; }
.button-primary { border-color: #d78d00; background: linear-gradient(135deg, var(--accent), #dc7800); color: #171006; font-weight: 800; }
.button-danger { border-color: #713034; background: #3b1c1f; color: #ffafb3; }
.stack { display: grid; gap: 10px; }
.editor-card { border: 1px solid var(--border); border-radius: 9px; background: #101317; }
.editor-card summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; cursor: pointer; list-style: none; }
.editor-card summary::-webkit-details-marker { display: none; }
.editor-card summary strong, .editor-card summary small { display: block; }
.editor-card summary small { color: var(--muted); }
.editor-body { padding: 14px; border-top: 1px solid var(--border); }
.danger-zone { padding: 0 14px 14px; text-align: right; }
.factory-reset-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 18px; align-items: start; }
.factory-reset-summary, .factory-reset-danger-card { margin-bottom: 0; }
.factory-reset-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.factory-reset-list { padding: 17px; border: 1px solid var(--border); border-radius: 11px; background: #101317; }
.factory-reset-list h3 { margin: 0 0 12px; font-size: 14px; }
.factory-reset-list ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; color: #b9c0ca; }
.factory-reset-list li { position: relative; padding-left: 20px; }
.factory-reset-list li::before { position: absolute; left: 0; top: .58em; width: 8px; height: 8px; border-radius: 50%; content: ''; }
.factory-reset-remove-list { border-color: #533033; background: rgba(66, 31, 34, .25); }
.factory-reset-remove-list h3 { color: #ff9da2; }
.factory-reset-remove-list li::before { background: var(--red); box-shadow: 0 0 10px rgba(255, 93, 98, .3); }
.factory-reset-keep-list { border-color: #28543a; background: rgba(23, 58, 39, .26); }
.factory-reset-keep-list h3 { color: #7ef0a6; }
.factory-reset-keep-list li::before { background: var(--green); box-shadow: 0 0 10px rgba(61, 204, 120, .3); }
.factory-reset-table-note { display: grid; gap: 6px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #0e1115; }
.factory-reset-table-note strong { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.factory-reset-table-note code { color: #cbd2dc; white-space: normal; overflow-wrap: anywhere; }
.factory-reset-danger-card { overflow: hidden; padding: 0; border-color: #633136; }
.factory-reset-danger-heading { padding: 22px; border-bottom: 1px solid #512b2e; background: linear-gradient(145deg, rgba(71, 28, 32, .65), rgba(31, 20, 22, .5)); }
.factory-reset-danger-heading > span { color: #ff777c; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.factory-reset-danger-heading h2 { margin: 7px 0 5px; font-size: 22px; }
.factory-reset-danger-heading p { margin: 0; color: #c6aeb0; }
.factory-reset-form { display: grid; gap: 16px; padding: 22px; }
.factory-reset-checkbox { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #533033; border-radius: 9px; background: rgba(66, 31, 34, .25); color: #d7c4c6; cursor: pointer; }
.factory-reset-checkbox input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--red); }
.factory-reset-button { width: 100%; min-height: 48px; font-weight: 800; }
.server-picker { display: flex; align-items: center; gap: 10px; }
.server-picker label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.server-picker select { min-width: 220px; }
.players-table td { vertical-align: middle; }
.copy-value { padding: 0; border: 0; background: none; color: #b8c2d1; font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-value:hover { color: var(--accent-2); border: 0; }
.player-manage-button { min-width: 86px; background: #1b1f25; }
.player-action-dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 1px solid #3d444f; border-radius: 16px; background: #111419; color: var(--text); box-shadow: 0 28px 90px #000c; }
.player-action-dialog[open] { animation: dialog-in .2s ease both; }
.player-action-dialog::backdrop { background: rgba(4, 6, 9, .78); backdrop-filter: blur(7px); animation: backdrop-in .18s ease both; }
.player-dialog-shell { max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-color: #444b55 #111419; }
.player-dialog-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--border); background: rgba(20, 23, 27, .96); backdrop-filter: blur(14px); }
.player-dialog-header h2 { margin: 4px 0 8px; font-size: 25px; letter-spacing: -.025em; }
.player-dialog-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 12px; }
.player-dialog-meta code { color: var(--accent-2); }
.player-dialog-close { position: relative; flex: 0 0 auto; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: #24282f; color: #c8ced7; font-size: 0; line-height: 1; }
.player-dialog-close::before,
.player-dialog-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 2px; border-radius: 999px; background: currentColor; transform-origin: center; }
.player-dialog-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.player-dialog-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.player-dialog-body { display: grid; gap: 10px; padding: 18px; }
.player-action-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; padding: 16px 18px; border: 1px solid var(--border); border-left: 3px solid #555d69; border-radius: 11px; background: #171a1f; }
.action-card-ban, .action-card-kick { border-left-color: var(--red); }
.action-card-mute, .action-card-gag { border-left-color: var(--accent); }
.player-action-copy strong, .player-action-copy span { display: block; }
.player-action-copy strong { margin-bottom: 3px; font-size: 14px; }
.player-action-copy span, .player-quick-actions span { color: var(--muted); font-size: 11px; white-space: normal; }
.player-action-fields { display: grid; grid-template-columns: 120px minmax(190px, 1fr) auto; gap: 12px; align-items: end; }
.player-template-action-fields { grid-template-columns: minmax(145px, .85fr) 132px minmax(190px, 1.25fr) auto; }
.player-action-fields .field-grow { grid-column: 1 / 3; }
.player-action-fields label { display: grid; gap: 4px; min-width: 0; }
.player-action-fields label > span { color: #aeb5c0; font-size: 10px; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .045em; white-space: normal; }
.player-action-fields input, .player-action-fields select { min-width: 0; padding: 8px 9px; font-size: 12px; }
.player-quick-actions { display: flex; align-items: center; gap: 8px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: #0e1115; }
.player-quick-actions > div { margin-right: auto; }
.player-quick-actions strong, .player-quick-actions span { display: block; }
.player-quick-action-form { display: flex; align-items: center; gap: 8px; }
.player-quick-action-form .action-button { min-width: 96px; min-height: 40px; padding: 9px 16px; }
.player-slap-form { gap: 6px; }
.player-slap-count { display: block; }
.player-slap-count > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.player-slap-count input { width: 66px; height: 40px; padding: 8px 10px; border-color: #444b56; border-radius: 8px; background: #20242b; color: var(--text); font-size: 14px; font-weight: 700; }
.action-button { padding: 7px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.action-ban, .action-kick { border-color: #713034; color: #ff9da2; }
.action-mute, .action-gag { border-color: #614d19; color: #ffd56c; }
.action-slay, .action-slap { min-width: 78px; }
body.dialog-open { overflow: hidden; }
.log-tabs { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: #111419; }
.log-tabs a { padding: 7px 13px; border-radius: 6px; color: var(--muted); }
.log-tabs a.is-active { background: #292e35; color: var(--text); }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-actions .button { display: inline-flex; justify-content: center; }
.punishment-filter-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(244, 180, 0, .22);
    background:
        radial-gradient(circle at 18% 0%, rgba(244, 180, 0, .09), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .005)),
        var(--card);
}
.punishment-filter-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.punishment-filter-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(130px, .75fr) minmax(280px, 1.6fr) repeat(2, minmax(150px, .9fr));
    gap: 14px;
    align-items: end;
}
.punishment-filter-grid .field {
    min-width: 0;
}
.punishment-filter-grid .field > span {
    color: #e0e4eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.punishment-filter-grid input,
.punishment-filter-grid select {
    min-height: 42px;
    background: rgba(9, 11, 14, .9);
}
.punishment-filter-grid input:focus,
.punishment-filter-grid select:focus {
    box-shadow: 0 0 0 3px rgba(244, 180, 0, .11);
}
.punishment-filter-server { grid-column: span 2; }
.punishment-filter-actions {
    grid-column: span 2;
    justify-content: flex-end;
}
.punishment-filter-actions .button {
    min-height: 42px;
    padding-inline: 16px;
}
.log-table td { vertical-align: top; }
.command-preview { display: block; max-width: 320px; overflow: hidden; color: #d6dbe3; text-overflow: ellipsis; }
.log-details { min-width: 58px; }
.log-details summary { display: inline-flex; padding: 5px 8px; border: 1px solid #454b55; border-radius: 6px; cursor: pointer; list-style: none; }
.log-details summary::-webkit-details-marker { display: none; }
.log-details > div { width: min(620px, 75vw); padding: 12px 0 4px; white-space: normal; }
.log-details strong { display: block; margin-top: 10px; color: #cfd4dc; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.log-details p { margin: 5px 0; color: #b6bdc8; }
.log-details pre { max-height: 240px; margin: 5px 0; padding: 10px; overflow: auto; border: 1px solid var(--border); border-radius: 7px; background: #0b0d10; color: #cbd2dc; white-space: pre-wrap; word-break: break-word; }
.log-details .error-text { color: #ff9fa4; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); }
.pagination > :last-child { justify-self: end; }
.mobile-menu-button, .mobile-logout, .sidebar-overlay { display: none; }
.mobile-menu-button { width: 38px; height: 38px; padding: 9px; flex-direction: column; border-color: var(--border); background: #171a1f; }
.mobile-menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #dfe3e9; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.app-toast { min-width: 190px; padding: 10px 13px; border: 1px solid #4c535e; border-radius: 8px; background: #1c2026; color: #f4f5f7; box-shadow: var(--shadow); animation: toast-in .2s ease both; }
.template-notice { margin-bottom: 16px; padding: 11px 13px; border-left: 3px solid var(--accent); border-radius: 6px; background: rgba(245, 168, 0, .07); color: #c6cbd3; }
.template-list { display: grid; gap: 10px; }
.template-editor { padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: #101317; }
.template-heading, .template-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.template-heading { margin-bottom: 12px; }
.template-heading strong { text-transform: uppercase; letter-spacing: .06em; }
.scope-badge { margin-left: 8px; padding: 3px 7px; border-radius: 999px; background: #292e35; color: #9fa7b3; font-size: 10px; text-transform: uppercase; }
.switch-control { display: inline-flex; align-items: center; gap: 7px; color: #c3c9d2; font-size: 12px; cursor: pointer; }
.switch-control input { accent-color: var(--accent); }
.code-input { min-height: 62px; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.template-footer { margin-top: 10px; }
.template-footer small { color: var(--muted); overflow-wrap: anywhere; }
.admins-grid { grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr); }
.admins-list { display: grid; gap: 10px; }
.admin-summary-meta { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.admin-editor summary { align-items: center; }
.admin-summary-chevron {
    width: 9px;
    height: 9px;
    margin-left: 4px;
    border-right: 2px solid #9aa2ae;
    border-bottom: 2px solid #9aa2ae;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
}
.admin-editor[open] .admin-summary-chevron { transform: rotate(225deg) translateY(-2px); }
.admin-editor summary:hover .admin-summary-chevron { border-color: var(--accent); }
.admins-check { align-self: end; min-height: 42px; padding: 9px 0; }
.branding-settings-card { margin-bottom: 20px; }
.branding-settings-subtitle { margin: 6px 0 0; }
.branding-settings-form { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.65fr); gap: 26px; align-items: center; }
.branding-preview { display: flex; align-items: center; gap: 16px; min-height: 116px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: #101318; }
.branding-preview-mark { width: 68px; height: 68px; border-radius: 16px; font-size: 20px; }
.branding-preview strong, .branding-preview small { display: block; }
.branding-preview strong { max-width: 260px; overflow-wrap: anywhere; font-size: 18px; }
.branding-preview small { margin-top: 4px; color: var(--muted); }
.branding-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.branding-remove-logo { min-height: 44px; }
.branding-save-button { grid-column: 2; justify-self: end; min-width: 220px; min-height: 44px; }
.admin-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-editor-footer small { color: var(--muted); }

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-page { min-height: 100vh; overflow-x: hidden; }
.auth-backdrop { position: fixed; inset: 0; background:
    radial-gradient(circle at 14% 18%, rgba(245, 168, 0, .13), transparent 28rem),
    radial-gradient(circle at 82% 74%, rgba(93, 156, 255, .08), transparent 32rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
}
.auth-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 0 48%, rgba(245, 168, 0, .035) 48% 49%, transparent 49% 100%); }
.auth-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: min(440px, 100%); padding: 30px; border: 1px solid #303640; border-radius: 15px; background: rgba(20, 23, 27, .96); box-shadow: 0 28px 90px #000a; backdrop-filter: blur(18px); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand small { color: var(--muted); font-size: 11px; }
.auth-card h1 { margin: 4px 0 4px; font-size: 28px; letter-spacing: -.035em; }
.subtitle { margin: 0 0 22px; color: var(--muted); }
.auth-field { display: grid; gap: 7px; margin-bottom: 14px; color: #d8dce3; font-size: 12px; font-weight: 700; }
.auth-field input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #0d0f12; color: #fff; outline: none; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 168, 0, .08); }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 62px; }
.password-control button { position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 9px; border: 0; background: transparent; color: var(--accent-2); font-size: 11px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin: 17px 0; color: #c8cdd5; cursor: pointer; }
.checkbox input { accent-color: var(--accent); }
.auth-submit { width: 100%; min-height: 43px; margin-top: 2px; }
.password-hint { margin: 2px 0 16px; color: var(--muted); font-size: 11px; }
.auth-footer { margin-top: 22px; color: #656d79; font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .12em; }
.installer-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 34px 16px; }
.installer-card { width: min(760px, 100%); padding: 30px; border: 1px solid #303640; border-radius: 15px; background: rgba(20, 23, 27, .97); box-shadow: 0 28px 90px #000a; backdrop-filter: blur(18px); }
.installer-card h1 { margin: 4px 0; font-size: 30px; letter-spacing: -.035em; }
.installer-language { margin-left: auto; display: inline-flex; gap: 5px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: #101317; }
.installer-language a { padding: 5px 9px; border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.installer-language a.is-active { background: #292e35; color: var(--accent-2); }
.installer-section { margin-top: 4px; padding: 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 9px; background: rgba(245, 168, 0, .055); }
.installer-section h2 { margin: 0 0 6px; font-size: 18px; }
.installer-section p { margin: 5px 0 0; color: #aeb4be; }
.requirements-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.requirements-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #101317; color: #c9ced6; }
.installer-form { padding-top: 18px; border-top: 1px solid var(--border); }
.installer-submit { min-height: 44px; }
.installation-credentials { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 20px 0; padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: #0e1013; }
.installation-credentials span { color: var(--muted); }
.installation-credentials code { color: var(--accent-2); }

.portal-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(245, 168, 0, .13), transparent 28rem),
        radial-gradient(circle at 84% 12%, rgba(255, 122, 41, .08), transparent 30rem),
        linear-gradient(180deg, #0f1117 0%, #090b0f 100%);
}

.portal-topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 0 clamp(16px, 4vw, 52px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(13, 15, 20, .82);
    backdrop-filter: blur(18px);
}

.portal-brand {
    padding: 0;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
}

.portal-nav a {
    padding: 8px 13px;
    border-radius: 999px;
    color: #aeb4be;
    font-weight: 700;
    font-size: 12px;
}

.portal-nav a:hover,
.portal-nav a.is-active {
    background: rgba(245, 168, 0, .14);
    color: var(--accent-2);
}

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

.portal-shell {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 4vw, 42px) clamp(14px, 4vw, 28px) 56px;
    animation: page-in .28s ease both;
}

.portal-footer {
    border-top: 1px solid rgba(255, 255, 255, .07);
    background: rgba(8, 10, 14, .72);
    backdrop-filter: blur(16px);
}

.portal-footer-inner {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 38px clamp(14px, 4vw, 28px) 22px;
}

.portal-footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .35fr);
    gap: 50px;
    padding-bottom: 34px;
}

.portal-footer-brand {
    width: fit-content;
    padding: 0;
    color: #f4f5f7;
}

.portal-footer-community h2,
.portal-footer-admins h2 {
    margin: 25px 0 14px;
    color: #b8bec8;
    font-size: 14px;
    font-weight: 700;
}

.portal-socials {
    display: flex;
    gap: 10px;
}

.portal-socials a,
.portal-socials > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
    background: rgba(255, 255, 255, .055);
    color: #eef0f3;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.portal-socials a:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 168, 0, .5);
    background: rgba(245, 168, 0, .12);
    color: var(--accent-2);
}

.portal-socials .is-disabled {
    opacity: .38;
    cursor: not-allowed;
}

.portal-socials svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.portal-footer-admins h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 3px;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.portal-footer-admins h2 svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.portal-footer-admin-list {
    display: grid;
    gap: 10px;
    color: #9fa6b2;
}

.portal-footer-admin-list span {
    width: fit-content;
}

.portal-footer-admin-list span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 9px;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 10px rgba(57, 217, 138, .55);
    vertical-align: middle;
}

.portal-footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    color: #858d99;
    font-size: 13px;
}

.portal-hero {
    display: block;
    margin-bottom: 18px;
}

.portal-hero-copy,
.portal-hero-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(26, 29, 38, .92), rgba(14, 16, 22, .92));
    box-shadow: 0 26px 90px rgba(0, 0, 0, .28);
}

.portal-hero-copy {
    min-height: 430px;
    padding: clamp(24px, 4vw, 42px);
}

.portal-hero-copy::after,
.portal-hero-card::after {
    content: "";
    position: absolute;
    inset: auto -12% -45% 35%;
    height: 260px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(245, 168, 0, .24), transparent 68%);
    pointer-events: none;
}

.portal-hero h1 {
    max-width: 760px;
    margin: 8px 0 12px;
    font-size: clamp(34px, 6vw, 68px);
    line-height: .96;
    letter-spacing: -.06em;
}

.portal-hero p {
    max-width: 620px;
    margin: 0;
    color: #aeb4be;
    font-size: 16px;
}

.portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.portal-ban-hero-heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.portal-ban-hero h1 {
    margin-bottom: 8px;
    font-size: clamp(34px, 5vw, 56px);
}

.portal-ban-hero .portal-hero-copy::after {
    display: none;
}

.portal-ban-list-button {
    position: absolute;
    right: clamp(24px, 4vw, 42px);
    bottom: 24px;
    z-index: 3;
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .38);
}

.portal-ban-feed {
    position: relative;
    z-index: 1;
    display: grid;
    max-height: 255px;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .09);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 67%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 67%, transparent 100%);
}

.portal-ban-feed-item {
    display: grid;
    grid-template-columns: 52px minmax(180px, 1.1fr) minmax(180px, 1fr) 100px minmax(140px, auto);
    gap: 16px;
    align-items: center;
    min-height: 72px;
    padding: 13px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.portal-ban-marker {
    color: #ff7f87;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
}

.portal-ban-player,
.portal-ban-reason,
.portal-ban-duration {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.portal-ban-player strong,
.portal-ban-reason span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-ban-feed small,
.portal-ban-feed time {
    color: var(--muted);
    font-size: 11px;
}

.portal-ban-feed time {
    text-align: right;
}

.portal-ban-empty {
    display: grid;
    min-height: 190px;
    place-items: center;
    color: var(--muted);
}

.portal-hero-card {
    display: grid;
    align-content: end;
    gap: 22px;
    padding: 28px;
}

.portal-server-logo {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent), #ff7a29);
    color: #171006;
    font-size: 32px;
    font-weight: 900;
    box-shadow: 0 24px 60px rgba(245, 168, 0, .22);
}

.portal-hero-card h2 {
    margin: 5px 0;
    font-size: 28px;
    letter-spacing: -.03em;
}

.portal-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.portal-metric-card {
    background: linear-gradient(145deg, rgba(26, 29, 38, .86), rgba(18, 20, 27, .72));
    backdrop-filter: blur(14px);
}

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

.portal-join {
    width: 100%;
    margin-top: 14px;
}

.portal-heading {
    margin-bottom: 18px;
}

.portal-tabs {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 16px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #101317;
}

.portal-tabs a {
    padding: 8px 13px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.portal-tabs a:hover,
.portal-tabs a.is-active {
    background: rgba(245, 168, 0, .13);
    color: var(--accent-2);
}

.portal-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}

.portal-punishment-table code {
    color: #cbd2dc;
}

.portal-punishment-table,
.punishment-records-table {
    min-width: 1040px;
}

.portal-punishment-table th:nth-child(5),
.portal-punishment-table td:nth-child(5),
.punishment-records-table th:nth-child(5),
.punishment-records-table td:nth-child(5) {
    min-width: 150px;
    max-width: 260px;
    white-space: normal;
}

.portal-punishment-table th:last-child,
.portal-punishment-table td:last-child,
.punishment-records-table th:last-child,
.punishment-records-table td:last-child {
    width: 1%;
}

.portal-punishment-table td:last-child .button,
.punishment-records-table td:last-child .button {
    white-space: nowrap;
}

.portal-status-active {
    background: #173a27;
    color: #7ef0a6;
}

.portal-status-expired {
    background: #3a321b;
    color: #ffd273;
}

.portal-status-removed {
    background: #421f22;
    color: #ff9296;
}

.portal-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #3d444f;
    border-radius: 18px;
    background: #111419;
    color: var(--text);
    box-shadow: 0 28px 90px #000c;
}

.portal-dialog[open] {
    animation: dialog-in .2s ease both;
}

.portal-dialog::backdrop {
    background: rgba(4, 6, 9, .78);
    backdrop-filter: blur(7px);
    animation: backdrop-in .18s ease both;
}

.portal-dialog-shell {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
}

.portal-dialog-header,
.portal-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(20, 23, 27, .96);
}

.portal-dialog-header h2 {
    margin: 4px 0 0;
    font-size: 26px;
}

.portal-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    border-bottom: 0;
}

.punishment-page-heading {
    align-items: flex-end;
}

.punishment-heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.offline-ban-open-button {
    align-self: flex-end;
    flex: 0 0 auto;
    min-height: 46px;
    padding: 11px 17px;
    white-space: nowrap;
}

.offline-ban-dialog {
    width: min(720px, calc(100vw - 28px));
}

.ban-template-dialog {
    width: min(860px, calc(100vw - 28px));
}

.ban-template-body {
    display: grid;
    gap: 20px;
    padding: 22px 24px 24px;
}

.ban-template-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0e1115;
}

.ban-template-create-form .button {
    align-self: start;
    min-height: 50px;
    margin-top: 24px;
    padding-inline: 20px;
}

.ban-template-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.ban-template-list-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 238px;
    gap: 8px;
    padding: 0 11px 2px;
    color: #8e96a3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.ban-template-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #15191e;
}

.ban-template-edit-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 140px;
    gap: 8px;
}

.ban-template-delete-form {
    display: flex;
}

.ban-template-row input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0d1014;
    color: var(--text);
    font: inherit;
    outline: none;
}

.ban-template-row input:focus {
    border-color: var(--accent);
}

.ban-template-row .button {
    min-height: 42px;
    justify-content: center;
    white-space: nowrap;
}

.ban-template-delete-form .button {
    min-width: 92px;
}

.ban-template-duration {
    min-width: 0;
}

.offline-ban-subtitle {
    max-width: 540px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.offline-ban-body {
    display: grid;
    gap: 18px;
    padding: 22px 24px 24px;
}

.offline-ban-notice {
    margin: 0;
}

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

.offline-ban-grid .field {
    align-content: start;
}

.offline-ban-grid .field > span small {
    color: #737c88;
    font-size: 10px;
    font-weight: 500;
}

.offline-ban-grid input,
.offline-ban-grid select {
    min-height: 50px;
}

.portal-detail-table {
    display: grid;
    padding: 20px 24px;
}

.portal-detail-table > div {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.portal-detail-table > div:last-child {
    border-bottom: 0;
}

.portal-detail-table strong {
    color: #dfe3e9;
}

.portal-detail-table span {
    color: #c1c7d0;
    overflow-wrap: anywhere;
}

.portal-detail-table .status-badge {
    align-self: center;
    justify-self: start;
    min-width: 82px;
    justify-content: center;
    padding: 5px 11px;
}


@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.privilege-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.privilege-summary-card {
    min-height: 92px;
}

.privilege-workspace {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.privilege-create-card,
.privilege-assignment-card {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.privilege-assignment-card {
    grid-column: 1 / span 2;
    order: 1;
}

.privilege-create-card {
    grid-column: 3;
    order: 2;
}

.privilege-card-copy {
    min-height: 54px;
    margin: -6px 0 18px;
}

.privilege-assignment-card .template-notice {
    display: flex;
    min-height: 54px;
    align-items: center;
    margin-bottom: 18px;
}

.privilege-flags-field {
    margin-top: 16px;
}

.privilege-flag-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(24px, 1fr));
    gap: 5px;
}

.privilege-create-card .privilege-flag-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
}

.privilege-flag {
    position: relative;
    cursor: pointer;
}

.privilege-flag input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.privilege-flag span {
    display: grid;
    min-height: 30px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #111419;
    color: #77808d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.privilege-flag:hover span {
    border-color: #59616d;
    color: #d8dce2;
    transform: translateY(-1px);
}

.privilege-flag input:checked + span {
    border-color: #ce8f08;
    background: linear-gradient(145deg, rgba(245, 168, 0, .28), rgba(245, 168, 0, .12));
    color: var(--accent-2);
    box-shadow: 0 0 16px rgba(245, 168, 0, .1);
}

.privilege-flag input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.privilege-submit {
    width: 100%;
    min-height: 42px;
    margin-top: 18px;
}

.privilege-create-card > form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.privilege-create-card .privilege-submit {
    margin-top: auto;
}

.privilege-assignment-form {
    display: grid;
    flex: 1;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto) minmax(42px, 1fr);
    gap: 13px;
    align-content: start;
}

.privilege-assignment-form .field {
    align-content: start;
}

.privilege-assignment-form input,
.privilege-assignment-form select {
    min-height: 52px;
}

.privilege-assignment-form .privilege-submit {
    align-self: end;
    grid-column: 1 / -1;
    margin-top: 0;
}

.privilege-days-field small {
    min-height: 17px;
}

.privilege-empty-state {
    display: grid;
    gap: 4px;
}

.privilege-empty-state strong {
    color: #dfe2e7;
}

.privilege-profile-list {
    display: grid;
    gap: 10px;
}

.privilege-profile-editor {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #101317;
}

.privilege-profile-editor summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    cursor: pointer;
    list-style: none;
}

.privilege-profile-editor summary::-webkit-details-marker {
    display: none;
}

.privilege-profile-editor summary > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.privilege-profile-editor summary code,
.privilege-flags-code {
    padding: 3px 7px;
    border: 1px solid rgba(245, 168, 0, .22);
    border-radius: 6px;
    background: rgba(245, 168, 0, .08);
    color: var(--accent-2);
    font-size: 11px;
}

.privilege-profile-chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid #7f8792;
    border-bottom: 2px solid #7f8792;
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.privilege-profile-editor[open] .privilege-profile-chevron {
    transform: rotate(225deg);
}

.privilege-profile-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.privilege-profile-body > form:first-child {
    display: grid;
    grid-template-columns: minmax(180px, .4fr) minmax(0, 1fr) auto;
    gap: 13px;
    align-items: end;
}

.privilege-profile-body .privilege-flags-field {
    margin-top: 0;
}

.privilege-assignments-table {
    min-width: 1120px;
}

.privilege-row-actions {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.privilege-edit-dialog {
    width: min(680px, calc(100vw - 28px));
}

.privilege-dialog-body {
    display: grid;
    gap: 18px;
    padding: 22px 24px 24px;
}

.privilege-dialog-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(245, 168, 0, .2);
    border-radius: 10px;
    background: rgba(245, 168, 0, .065);
    color: #c7ccd4;
    font-size: 12px;
    font-weight: 700;
}

.privilege-dialog-current .privilege-flags-code {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.privilege-dialog-grid .field {
    align-content: start;
}

.privilege-dialog-grid input,
.privilege-dialog-grid select {
    min-height: 50px;
}

.privilege-dialog-grid small {
    min-height: 17px;
}

@media (max-width: 1180px) {
    .factory-reset-grid { grid-template-columns: 1fr; }
    .privilege-workspace { grid-template-columns: 1fr; }
    .privilege-assignment-card, .privilege-create-card { grid-column: 1; }
    .privilege-profile-body > form:first-child { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .punishment-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .punishment-filter-search, .punishment-filter-server, .punishment-filter-actions { grid-column: span 3; }
    .portal-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .branding-settings-form { grid-template-columns: 1fr; }
    .privilege-summary-grid { grid-template-columns: 1fr; }
    .privilege-assignment-form { grid-template-columns: 1fr; grid-template-rows: none; }
    .privilege-profile-body { grid-template-columns: 1fr; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100vh; border-right: 1px solid var(--border); transform: translateX(-105%); box-shadow: 24px 0 70px #000a; }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-nav { display: grid; overflow: visible; }
    .sidebar-user { display: grid; }
    .sidebar-overlay { position: fixed; z-index: 45; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(0, 0, 0, .62); opacity: 0; pointer-events: none; }
    body.sidebar-open .sidebar-overlay { display: block; opacity: 1; pointer-events: auto; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 18px; }
    .mobile-menu-button { display: inline-flex; }
    .mobile-logout { display: block; }
    .live-pill { display: none; }
    .page-content { padding: 20px 16px; }
    .page-heading { align-items: flex-start; gap: 16px; flex-direction: column; }
    .punishment-heading-actions { width: 100%; }
    .server-picker { width: 100%; }
    .server-picker select { min-width: 0; flex: 1; }
    .log-tabs { width: 100%; }
    .log-tabs a { flex: 1; text-align: center; }
    .player-action-card { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 560px) {
    .branding-settings-fields { grid-template-columns: 1fr; }
    .branding-save-button { grid-column: auto; justify-self: stretch; width: 100%; min-width: 0; }
    .factory-reset-columns { grid-template-columns: 1fr; }
    .offline-ban-open-button { align-self: stretch; justify-content: center; width: 100%; }
    .punishment-heading-actions { align-items: stretch; flex-direction: column; }
    .punishment-heading-actions .button { justify-content: center; width: 100%; }
    .offline-ban-body { padding: 18px; }
    .offline-ban-grid { grid-template-columns: 1fr; }
    .ban-template-body { padding: 18px; }
    .ban-template-create-form { grid-template-columns: 1fr; }
    .ban-template-create-form .button { margin-top: 0; }
    .ban-template-list-heading { display: none; }
    .ban-template-row { grid-template-columns: 1fr; }
    .ban-template-edit-form { grid-template-columns: 1fr 100px; }
    .ban-template-edit-form .ban-template-reason { grid-column: 1 / -1; }
    .ban-template-delete-form .button { width: 100%; }
    .privilege-dialog-body { padding: 18px; }
    .privilege-dialog-grid { grid-template-columns: 1fr; }
    .privilege-dialog-current { align-items: flex-start; flex-direction: column; }
    .privilege-dialog-current .privilege-flags-code { max-width: 100%; }
    .privilege-flag-grid { grid-template-columns: repeat(7, minmax(28px, 1fr)); }
    .privilege-profile-editor summary > div { align-items: flex-start; flex-direction: column; gap: 4px; }
    .metric-grid, .server-grid { grid-template-columns: 1fr 1fr; }
    .metric-card { padding: 13px; }
    .metric-card strong { font-size: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .filter-grid { grid-template-columns: 1fr; }
    .punishment-filter-grid { grid-template-columns: 1fr; }
    .punishment-filter-search, .punishment-filter-server, .punishment-filter-actions { grid-column: auto; }
    .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .punishment-filter-actions { justify-content: stretch; }
    .metric-grid { grid-template-columns: 1fr; }
    .template-heading, .template-footer { align-items: flex-start; flex-direction: column; }
    .template-footer .button { width: 100%; }
    .auth-card { padding: 24px 20px; }
    .installer-card { padding: 24px 18px; }
    .requirements-list { grid-template-columns: 1fr; }
    .topbar-title { gap: 9px; }
    .topbar strong { font-size: 14px; }
    .topbar .eyebrow { display: none; }
    .mobile-logout .button { padding: 7px 9px; }
    .player-action-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
    .player-dialog-shell { max-height: calc(100vh - 16px); }
    .player-dialog-header { padding: 18px; }
    .player-dialog-header h2 { font-size: 21px; }
    .player-dialog-body { padding: 10px; }
    .player-action-fields { grid-template-columns: 1fr; }
    .player-action-fields .field-grow { grid-column: auto; }
    .player-action-fields .action-button { min-height: 40px; }
    .player-quick-actions { align-items: stretch; flex-wrap: wrap; }
    .player-quick-actions > div { width: 100%; }
    .player-quick-actions form { flex: 1; }
    .player-quick-actions button { width: 100%; }
    .player-quick-actions .player-slap-form { flex: 1 1 190px; }
    .player-quick-actions .player-slap-form button { flex: 1; width: auto; }
    .portal-topbar { align-items: flex-start; flex-direction: column; padding-top: 15px; padding-bottom: 15px; }
    .portal-nav { width: 100%; overflow-x: auto; border-radius: 12px; }
    .portal-nav a { white-space: nowrap; }
    .portal-actions { width: 100%; justify-content: space-between; }
    .portal-footer-main { grid-template-columns: 1fr; gap: 30px; }
    .portal-footer-community h2 { margin-top: 20px; }
    .portal-hero { grid-template-columns: 1fr; }
    .portal-hero-copy { min-height: 0; }
    .portal-ban-hero-heading { align-items: flex-start; flex-direction: column; }
    .portal-ban-list-button { right: 20px; bottom: 18px; }
    .portal-ban-feed { max-height: 270px; }
    .portal-ban-feed-item { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
    .portal-ban-reason { grid-column: 2 / -1; }
    .portal-ban-duration { grid-column: 3; grid-row: 1; }
    .portal-ban-feed time { display: none; }
    .portal-search { grid-template-columns: 1fr; }
    .portal-tabs { width: 100%; }
    .portal-tabs a { flex: 1; text-align: center; }
    .portal-detail-table > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
