:root {
    color-scheme: dark;
    --ink: #f2f7ff;
    --muted: #aebbd1;
    --base: #0c1425;
    --surface: #172641;
    --line: #3b4b68;
    --accent: #a5dcff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--base); color: var(--ink); font: 1rem/1.5 system-ui, sans-serif; }
.wrap { width: min(1120px, calc(100% - 2rem)); margin: auto; }
.top { border-bottom: 1px solid var(--line); background: #101d36; }
.bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.025em; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--base); font-size: 1.5rem; line-height: 1; }
main { padding-block: 2rem 4rem; }
h1, h2 { margin: 0 0 1rem; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1rem; color: var(--muted); }
.layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.card { padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.auth { max-width: 470px; margin: 4vh auto; }
.auth h1 { font-size: 2rem; }
.listing { margin-top: 1rem; }
.fields, label { display: grid; gap: .55rem; }
.fields { gap: 1rem; }
label { font-size: .9rem; font-weight: 600; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input, select, button { font: inherit; }
input, select { width: 100%; min-width: 0; color: var(--ink); background: #101d36; border: 1px solid var(--line); border-radius: 8px; padding: .66rem .75rem; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.check, .actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
button { border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: var(--base); font-weight: 700; padding: .6rem .9rem; cursor: pointer; justify-self: start; }
button.secondary, button.danger { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { color: #ffbab5; margin-top: .5rem; }
a, summary { color: var(--accent); cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.key { font: .86rem/1.5 ui-monospace, monospace; }
.connection details { margin-top: 1rem; }
.update-help { margin: .75rem 0 0; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.75rem; }
.tabs a { padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--base); font-weight: 700; }
.layout.manage { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.4fr); align-items: start; }
.settings-card { max-width: 700px; }
.settings-card details input { margin-top: .65rem; }
.search-line { display: flex; gap: .5rem; margin-bottom: 1rem; }
.mac { display: block; margin-top: .18rem; color: var(--muted); white-space: nowrap; }
.link-button { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; font-weight: 700; text-decoration: none; }
.link-button.primary { background: var(--accent); color: var(--base); border-color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.metric { min-height: 108px; display: grid; align-content: space-between; gap: .6rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric span { color: var(--muted); font-size: .83rem; }
.metric strong { font-size: 1.8rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dashboard-table { margin-top: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.editor-fields { padding-top: 1rem; max-width: 600px; }
.client-page { display: grid; gap: 1rem; }
.clients-table { min-width: 860px; }
.detail { display: block; color: var(--muted); margin-top: .2rem; overflow-wrap: anywhere; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; margin-top: .35rem; padding: .12rem .42rem; border-radius: 99px; background: #2a3c59; color: var(--muted); }
.badge.online { color: #a4edce; background: #17463d; }
.badge.off { color: #ffc1b8; background: #552e38; }
.compact { padding: .3rem .55rem; font-size: .85rem; }
.message-form { min-width: 190px; margin-top: .5rem; }
textarea { font: inherit; width: 100%; resize: vertical; color: var(--ink); background: #101d36; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; }
details p { margin-top: .75rem; }
.message { border: 1px solid #4977a0; border-radius: 8px; color: var(--accent); padding: .75rem 1rem; }
.message.error { border-color: #9b5d58; color: #ffbab5; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .75rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.status { color: var(--muted); }
.status.published { color: var(--accent); }
@media (max-width: 820px) { .layout, .layout.manage { grid-template-columns: 1fr; } }
.tab-content { min-width: 0; }
.layout-options { padding: 0; border: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: .7rem; }
.layout-options legend { margin-bottom: .65rem; font-weight: 700; font-size: .9rem; }
.layout-option { border: 1px solid var(--line); border-radius: 10px; padding: .6rem; cursor: pointer; }
.layout-option:has(input:checked) { border-color: var(--accent); }
.layout-option > span:last-child { display: flex; gap: .4rem; align-items: center; }
.layout-option input { width: auto; accent-color: var(--accent); }
.layout-preview { display: grid; gap: 5px; padding: 8px; border-radius: 6px; min-height: 55px; background: #0a1529; }
.layout-preview i { display: block; border-radius: 3px; background: #4772a6; }
.preview-reference { grid-template-columns: 1.65fr 1fr; }
.preview-reference i:first-child { grid-row: span 2; background: #477db7; }
.preview-gallery { grid-template-columns: repeat(3, 1fr); }
.preview-gallery i:nth-child(2) { background: #685e9b; }
.preview-gallery i:nth-child(3) { background: #487c70; }
.preview-list i { background: #39567a; }
@media (min-width: 920px) {
    .panel-sidebar main { width: min(1400px, calc(100% - 2rem)); display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 1.45rem; align-items: start; }
    .panel-sidebar .message { grid-column: 1 / -1; }
    .panel-sidebar .tabs { flex-direction: column; position: sticky; top: 1.25rem; margin-bottom: 0; }
}
.wide-clients .wrap { width: calc(100% - clamp(1.25rem, 4vw, 5rem)); max-width: 1960px; }
.wide-clients .clients-table { min-width: 1040px; }
.wide-clients td, .wide-clients th { padding-inline: clamp(.65rem, 1.15vw, 1.35rem); }
.clients-table .line-expiry { white-space: nowrap; }
.clients-table .client-group th { background: #101e36; color: var(--ink); padding-block: .5rem; }
.client-group strong { font-size: .96rem; margin-right: .8rem; }
.client-group span { color: var(--muted); margin-right: .8rem; }
.clients-table tbody tr:not(.client-group) td { padding-block: .55rem; }
.country-flag { width: 24px; max-height: 18px; object-fit: contain; vertical-align: middle; margin-inline-start: .35rem; }
.reseller-access { margin-bottom: 1rem; }
.reseller-dns { display: grid; gap: .55rem; border: 1px solid var(--line); border-radius: 8px; }
.clients-table td:first-child, .clients-table td:nth-child(2) { min-width: 148px; }
.client-actions { min-width: 228px; max-width: 330px; gap: .55rem .85rem; }
.client-message { flex-basis: 100%; }
.delete-client { margin-top: 1.3rem; }
.delete-client form { max-width: 350px; margin-top: .65rem; }
button:disabled { opacity: .65; cursor: wait; }
.login-page { min-height: 100vh; background: radial-gradient(ellipse at top left,#203c64,transparent 60%),#0b1325; }
.login-page main { position: relative; width: min(520px,calc(100% - 2rem)); padding-top: max(2rem,10vh); }
.login-page .auth { background: #101d33; border-color: #446485; box-shadow: 0 24px 80px #030810bb; margin: 0 auto; }
.login-page .auth h1 { font-size: clamp(1.65rem,6vw,2.15rem); }
.login-background { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .57; pointer-events: none; }
.login-brand { display:flex; align-items:center; gap:.8rem; margin-bottom:1.35rem; font-size:1.1rem; }
.login-brand img { width:64px; height:54px; object-fit:contain; object-position:left center; }
.background-preview { display:block; width:min(100%,320px); aspect-ratio:16/9; object-fit:cover; border-radius:8px; }
.dns-assignment { padding:.75rem 0; border-bottom:1px solid var(--line); }
.color-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(126px,1fr)); gap:.8rem; }
.color-fields input { height:47px; padding:.3rem; cursor:pointer; }
.theme-preview { display:block; width:72px; height:72px; object-fit:contain; border:1px solid var(--line); border-radius:8px; }
.theme-preview-wide { width:min(100%,320px); height:auto; aspect-ratio:16/9; object-fit:cover; }
.security-captcha { margin:0; border:1px solid var(--line); border-radius:8px; padding:1rem; }
.security-captcha legend { padding-inline:.4rem; }
.launcher-preview { display:flex; align-items:center; gap:.85rem; padding:.85rem; border:1px solid var(--line); border-radius:12px; }
.launcher-preview img, .launcher-preview .mark { width:56px; height:56px; flex:none; object-fit:contain; }
.launcher-preview small { display:block; color:var(--muted); margin-top:.2rem; }
