:root {
    --ctl-bg: #eef1f6;
    --ctl-surface: #ffffff;
    --ctl-sidebar: #070b14;
    --ctl-sidebar-2: #101827;
    --ctl-line: #e5eaf1;
    --ctl-text: #101828;
    --ctl-muted: #667085;
    --ctl-brand: #1d4ed8;
    --ctl-brand-2: #2563eb;
    --ctl-gold: #c9a227;
    --ctl-ok: #067647;
    --ctl-ok-bg: #ecfdf3;
    --ctl-warn: #b54708;
    --ctl-warn-bg: #fffaeb;
    --ctl-err: #b42318;
    --ctl-err-bg: #fef3f2;
    --ctl-info: #175cd3;
    --ctl-info-bg: #eff8ff;
    --ctl-radius: 10px;
    --ctl-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 20px rgba(16, 24, 40, .04);
    --ctl-font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    --ctl-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --ctl-sidebar-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.ctl-app, body.ctl-auth {
    font-family: var(--ctl-font);
    color: var(--ctl-text);
    background: var(--ctl-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ctl-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .ctl-mono {
    font-family: var(--ctl-mono);
    font-size: 11px;
    background: #f2f4f7;
    border: 1px solid var(--ctl-line);
    border-radius: 5px;
    padding: 1px 5px;
    user-select: all;
}

/* ---- Auth: left brand / right form ---- */
.ctl-auth {
    min-height: 100vh;
    padding: 0;
    background: #070b14;
    color: #e8eef8;
}
.ctl-auth-wrap {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(360px, 1fr);
    background: #070b14;
}
.ctl-auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    padding: 56px 56px 56px 64px;
    overflow: hidden;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(201, 162, 39, .22), transparent 58%),
        radial-gradient(700px 380px at 90% 110%, rgba(37, 99, 235, .22), transparent 50%),
        linear-gradient(165deg, #0b1220 0%, #070b14 55%, #0a1628 100%);
}
.ctl-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.45), transparent 88%);
    pointer-events: none;
}
.ctl-auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.ctl-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .04em;
    color: #0b1220;
    background: linear-gradient(135deg, #f6e2a1, var(--ctl-gold));
    box-shadow: 0 10px 28px rgba(201, 162, 39, .28);
    margin-bottom: 28px;
}
.ctl-auth-kicker {
    color: #c9a227;
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 700;
}
.ctl-auth-brand h1 {
    margin: 0 0 12px;
    font-size: 36px;
    letter-spacing: -.03em;
    font-weight: 720;
}
.ctl-auth-brand p {
    margin: 0 0 22px;
    color: #9aa6ba;
    line-height: 1.7;
    font-size: 14px;
}
.ctl-auth-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.ctl-auth-points li {
    color: #d7deea;
    font-size: 13px;
    padding-left: 18px;
    position: relative;
}
.ctl-auth-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--ctl-gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
.ctl-auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    background: #f7f8fb;
    color: var(--ctl-text);
}
.ctl-auth-form-inner { width: min(380px, 100%); }
.ctl-auth-form h2 {
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: -.02em;
}
.ctl-auth-form .ctl-lead {
    margin: 0 0 22px;
    color: var(--ctl-muted);
    font-size: 13px;
}
.ctl-auth label {
    display: block;
    margin: 0 0 6px;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}
.ctl-auth input {
    width: 100%;
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: var(--ctl-text);
    font: inherit;
}
.ctl-auth input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.ctl-auth .ctl-btn { width: 100%; margin-top: 4px; padding: 11px 14px; }
.ctl-auth-foot {
    margin: 16px 0 0;
    color: var(--ctl-muted);
    font-size: 13px;
}
.ctl-auth-foot a { color: var(--ctl-brand); font-weight: 600; }
.ctl-flash {
    padding: 8px 10px;
    border-radius: 8px;
    margin: 0 0 12px;
    font-size: 12px;
    border: 1px solid transparent;
}
.ctl-flash.ok { background: var(--ctl-ok-bg); color: var(--ctl-ok); border-color: #abefc6; }
.ctl-flash.err { background: var(--ctl-err-bg); color: var(--ctl-err); border-color: #fecdca; }
.ctl-flash.warn { background: var(--ctl-warn-bg); color: var(--ctl-warn); border-color: #fedf89; }
.ctl-flash.is-cmd { position: sticky; top: 8px; z-index: 20; }
.ctl-checklist { list-style: none; margin: 0; padding: 0; }
.ctl-checklist li {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 1.2fr) minmax(120px, auto);
    gap: 8px 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--ctl-line);
    font-size: 13px;
}
.ctl-checklist li:last-child { border-bottom: 0; }
.ctl-checklist li.is-on span { color: var(--ctl-ok); }
.ctl-checklist label { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.ctl-checklist input { width: auto; margin: 0; }
.ctl-checklist em, .ctl-checklist small { color: var(--ctl-muted); font-style: normal; font-size: 12px; }
@media (max-width: 720px) {
    .ctl-checklist li { grid-template-columns: 1fr; gap: 4px; }
}
.ctl-auth .ctl-flash.err {
    background: #fef3f2;
    color: #b42318;
    border-color: #fecdca;
}

/* ---- App shell / drawer ---- */
.ctl-shell { min-height: 100vh; }
.ctl-drawer-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(7, 11, 20, .46);
    cursor: pointer;
}
.ctl-sidebar {
    width: var(--ctl-sidebar-w);
    background: var(--ctl-sidebar);
    color: #d7deea;
    padding: 14px 8px 18px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow: hidden auto;
    transform: translateX(0);
    transition: transform .22s ease;
    border-right: 1px solid rgba(255,255,255,.06);
}
.ctl-brand {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 8px 14px;
}
.ctl-brand .ctl-mark { width: 32px; height: 32px; margin: 0; font-size: 11px; flex: 0 0 32px; }
.ctl-brand-text { min-width: 0; flex: 1; }
.ctl-brand b { display: block; color: #fff; font-size: 13px; line-height: 1.2; }
.ctl-brand span { color: #8b97ab; font-size: 10px; letter-spacing: .04em; }
.ctl-side-toggle {
    appearance: none;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #d7deea;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    flex: 0 0 26px;
    font-size: 13px;
    line-height: 1;
    padding: 0;
}
.ctl-side-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.ctl-side-toggle.is-bar {
    width: 32px;
    height: 32px;
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    color: #344054;
    box-shadow: var(--ctl-shadow);
}
.ctl-nav { display: block; }
.ctl-nav-group { margin: 0 0 6px; outline: none; }
.ctl-nav-group summary {
    color: #8b97ab;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 10px 4px;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}
.ctl-nav-group summary::-webkit-details-marker { display: none; }
.ctl-nav-group summary::after { content: "▾"; opacity: .55; font-size: 9px; }
.ctl-nav-group:not([open]) summary::after { content: "▸"; }
.ctl-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ctl-nav-list li { display: block; margin: 0; padding: 0; }
.ctl-nav a {
    display: block;
    width: 100%;
    color: #b7c2d4;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
}
.ctl-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.ctl-nav a.is-on {
    background: linear-gradient(90deg, rgba(201,162,39,.18), rgba(255,255,255,.06));
    color: #fff;
    box-shadow: inset 2px 0 0 var(--ctl-gold);
    text-decoration: none;
}
.ctl-app.ctl-sidebar-collapsed .ctl-sidebar { transform: translateX(-105%); }
.ctl-main {
    min-width: 0;
    min-height: 100vh;
    padding: 14px 20px 36px;
    margin-left: var(--ctl-sidebar-w);
    transition: margin-left .22s ease;
}
.ctl-app.ctl-sidebar-collapsed .ctl-main { margin-left: 0; }
.ctl-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.ctl-top-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ctl-top h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.ctl-top p { margin: 2px 0 0; color: var(--ctl-muted); font-size: 12px; }
.ctl-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    box-shadow: var(--ctl-shadow);
    white-space: nowrap;
}
.ctl-user b { font-size: 12px; }
.ctl-user span { color: var(--ctl-muted); font-size: 11px; }

.ctl-chrome {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.ctl-tenant-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: 999px;
    padding: 3px 10px 3px 12px;
    box-shadow: var(--ctl-shadow);
}
.ctl-tenant-switch label {
    color: var(--ctl-muted);
    font-size: 11px;
    font-weight: 700;
}
.ctl-tenant-switch select {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    color: var(--ctl-text);
    max-width: 220px;
    padding: 4px 0;
}
.ctl-tenant-switch.is-empty em {
    font-size: 12px;
    font-style: normal;
    font-weight: 650;
    color: var(--ctl-muted);
}
.ctl-tenant-switch.is-bare {
    padding-left: 14px;
}
.ctl-inc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--ctl-line);
    background: var(--ctl-surface);
    color: var(--ctl-text);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    box-shadow: var(--ctl-shadow);
}
.ctl-inc-badge:hover { text-decoration: none; border-color: #c5d0de; }
.ctl-inc-badge b { font-variant-numeric: tabular-nums; }
.ctl-inc-badge.is-hot {
    background: var(--ctl-err-bg);
    border-color: #fecdca;
    color: var(--ctl-err);
}
.ctl-cmd {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(7, 11, 20, .46);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 24px;
}
.ctl-cmd[hidden] { display: none; }
.ctl-cmd-panel {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(16, 24, 40, .28);
    padding: 12px;
}
.ctl-cmd-panel input[type="search"] {
    width: 100%;
    border: 1px solid var(--ctl-line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
}
.ctl-cmd-panel ul {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    max-height: 360px;
    overflow: auto;
}
.ctl-cmd-panel li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.ctl-cmd-panel li em {
    font-style: normal;
    color: var(--ctl-muted);
    font-size: 11px;
}
.ctl-cmd-panel li.is-on,
.ctl-cmd-panel li:hover { background: #eef2f8; }
.ctl-cmd-panel .ctl-help { margin: 8px 4px 0; }

.ctl-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    background: #e7ebf2;
    border-radius: 10px;
    overflow: auto;
}
.ctl-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #475467;
    padding: 6px 11px;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.ctl-tab:hover { color: var(--ctl-text); text-decoration: none; background: rgba(255,255,255,.55); }
.ctl-tab.is-on {
    background: #fff;
    color: var(--ctl-text);
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
    text-decoration: none;
}

.ctl-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.ctl-stat {
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: var(--ctl-radius);
    padding: 10px 12px;
    box-shadow: var(--ctl-shadow);
    text-decoration: none;
    color: inherit;
    display: block;
}
a.ctl-stat:hover { text-decoration: none; border-color: #c5d0de; }
.ctl-stat span { display: block; margin-top: 4px; color: var(--ctl-muted); font-size: 11px; font-weight: 600; }
.ctl-stat em {
    display: block;
    font-style: normal;
    color: var(--ctl-muted);
    font-size: 11px;
    margin-bottom: 4px;
}
.ctl-stat strong { font-size: 18px; letter-spacing: -.03em; }
.ctl-stat strong.ctl-text { font-size: 13px; letter-spacing: 0; font-weight: 650; }
.ctl-card > .ctl-stats { margin-bottom: 8px; }
.ctl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: var(--ctl-radius);
    background: #fff7f7;
}
.ctl-toolbar .ctl-help { margin: 0; }
.ctl-toolbar.is-edge {
    margin-top: 10px;
    border-color: #bfdbfe;
    background: #f0f7ff;
}
.ctl-col-hosts { min-width: 140px; white-space: normal; }
.ctl-section { margin: 0 0 8px; scroll-margin-top: 12px; }
.ctl-section h2 { margin: 0 0 8px; font-size: 14px; }
.ctl-section h3 { margin: 12px 0 8px; font-size: 13px; color: var(--ctl-muted); font-weight: 600; }
.ctl-card {
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: var(--ctl-radius);
    padding: 12px;
    box-shadow: var(--ctl-shadow);
    overflow: visible;
}
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctl-sites { grid-template-columns: 1fr; max-width: 860px; }
.ctl-site { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ctl-site-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.ctl-section .ctl-site-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.02em;
    color: var(--ctl-text);
    font-weight: 700;
}
.ctl-site-code { margin: 3px 0 0; color: var(--ctl-muted); font-size: 12px; }
.ctl-site-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.ctl-site-kv {
    background: #f8fafc;
    border: 1px solid var(--ctl-line);
    border-radius: 8px;
    padding: 9px 10px;
}
.ctl-site-kv em {
    display: block;
    font-style: normal;
    color: var(--ctl-muted);
    font-size: 11px;
    margin-bottom: 3px;
}
.ctl-site-kv strong { display: block; font-size: 14px; }
.ctl-site-kv span { display: block; margin-top: 2px; color: var(--ctl-muted); font-size: 11px; }
.ctl-site-kv.is-warn { background: var(--ctl-warn-bg); border-color: #f5d9a8; }
.ctl-site-kv.is-warn strong, .ctl-site-kv.is-warn span { color: var(--ctl-warn); }
.ctl-site-kv.is-err { background: var(--ctl-err-bg); border-color: #f3c4c0; }
.ctl-site-kv.is-err strong, .ctl-site-kv.is-err span { color: var(--ctl-err); }
.ctl-site-note {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--ctl-info-bg);
    color: var(--ctl-info);
    font-size: 12px;
}
.ctl-site-block h3 { margin: 0 0 8px; font-size: 12px; color: var(--ctl-muted); }
.ctl-site-hosts { margin: 0 0 10px; }
.ctl-site-hosts .ctl-table { font-size: 12px; }
.ctl-site .ctl-toolbar.is-edge { margin: 0; }
.ctl-site-line {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    margin: 0 0 6px;
    font-size: 13px;
}
.ctl-site-line > span { color: var(--ctl-muted); padding-top: 2px; }
.ctl-site-line code { display: inline-block; word-break: break-all; }
.ctl-site-creds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.ctl-site-ops {
    display: grid;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--ctl-line);
}
.ctl-site-ops .ctl-actions { margin: 0; }
.ctl-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--ctl-line);
    border-radius: var(--ctl-radius);
    background: var(--ctl-surface);
    box-shadow: var(--ctl-shadow);
}
.ctl-card > .ctl-table-wrap,
.ctl-card .ctl-table-wrap {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}
table.ctl-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 12px;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}
.ctl-table th, .ctl-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--ctl-line);
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    word-break: keep-all;
    overflow-wrap: normal;
}
.ctl-table th {
    background: #f8fafc;
    color: #475467;
    font-weight: 650;
    font-size: 11px;
}
.ctl-table td code {
    display: inline;
    max-width: none;
    white-space: nowrap;
    word-break: keep-all;
}
.ctl-table input, .ctl-table select, .ctl-table textarea {
    max-width: none;
    width: auto;
    min-width: 72px;
}
.ctl-table .ctl-actions,
.ctl-table .ctl-switch-form,
.ctl-table .ctl-chips { white-space: nowrap; }
.ctl-table .ctl-actions { flex-wrap: wrap; }
.ctl-table td.ctl-col-ops {
    white-space: normal;
    min-width: 280px;
    width: 36%;
    max-width: 560px;
}
.ctl-ops {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}
.ctl-ops-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.ctl-ops-row .ctl-chips,
.ctl-ops-row .ctl-switch-list {
    display: inline-flex;
}
.ctl-ops-row .ctl-switch {
    padding: 2px 8px;
    min-width: 0;
}
.ctl-ops-row .ctl-switch em { font-size: 11px; }
.ctl-app .ctl-ops-row input.short,
.ctl-app .ctl-actions input.short {
    width: 118px;
    max-width: 118px;
    min-width: 0;
}
.ctl-app .ctl-ops-row select {
    width: auto;
    max-width: 168px;
    min-width: 0;
}
.ctl-table tr:last-child td { border-bottom: 0; }
.ctl-table tr:hover td { background: #fafbfe; }
.ctl-quota-table td { padding: 6px 8px; vertical-align: middle; }
.ctl-quota-site { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.ctl-quota-site b { font-size: 13px; font-weight: 650; }
.ctl-quota-site code { width: fit-content; }
.ctl-app .ctl-quota-table input.short {
    width: 64px;
    max-width: 64px;
    min-width: 56px;
    padding: 4px 6px;
}
.ctl-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ctl-field { margin: 0 0 10px; }
.ctl-field label, .ctl-card > label {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    color: #344054;
    font-weight: 600;
}
.ctl-app input, .ctl-app select, .ctl-app textarea {
    width: 100%;
    max-width: 420px;
    padding: 7px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: inherit;
}
.ctl-app input.short { width: 80px; max-width: 80px; min-width: 0; }
.ctl-actions input, .ctl-actions select { width: auto; max-width: none; }
.ctl-app .ctl-table input,
.ctl-app .ctl-table select,
.ctl-app .ctl-table textarea {
    width: auto;
    max-width: none;
    min-width: 72px;
}
.ctl-app input:focus, .ctl-app select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.ctl-check { display: flex; flex-wrap: wrap; gap: 6px; }
.ctl-chips { display: grid; gap: 8px; }
.ctl-chip-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ctl-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ctl-actions .ctl-chips { display: inline-flex; align-items: center; gap: 6px; }
.ctl-actions .ctl-chip-list { display: inline-flex; }
.ctl-chip {
    display: inline-flex;
    position: relative;
    margin: 0;
    cursor: pointer;
    user-select: none;
}
.ctl-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.ctl-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    box-shadow: 0 1px 1px rgba(16,24,40,.04);
}
.ctl-chip:hover span { border-color: #98a2b3; }
.ctl-chip:has(input:checked) span,
.ctl-chip.is-on span {
    background: var(--ctl-brand-2);
    border-color: var(--ctl-brand-2);
    color: #fff;
}
.ctl-chip.is-danger:has(input:checked) span,
.ctl-chip.is-danger.is-on span {
    background: var(--ctl-err);
    border-color: var(--ctl-err);
    color: #fff;
}
.ctl-chip input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.ctl-chip:has(input:disabled) span,
.ctl-chip.is-off span {
    opacity: .55;
    cursor: default;
}
.ctl-check label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
}
.ctl-check input { width: auto; max-width: none; margin: 0; }
.ctl-check .ctl-chip span { font-weight: 650; }

.ctl-switch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
    gap: 8px;
}
.ctl-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    min-height: 40px;
    cursor: pointer;
    font-size: 12px;
    color: #344054;
    user-select: none;
    position: relative;
    border: 1px solid var(--ctl-line);
    border-radius: 10px;
    background: #fff;
    min-width: 0;
}
.ctl-actions .ctl-switch,
.ctl-switch-form .ctl-switch,
.ctl-ops .ctl-switch {
    padding: 4px 8px;
    min-height: 32px;
    justify-content: flex-start;
}
.ctl-app .ctl-switch input,
.ctl-switch input {
    position: absolute;
    opacity: 0;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.ctl-switch-ui {
    display: block;
    box-sizing: border-box;
    width: 56px;
    min-width: 56px;
    height: 24px;
    border-radius: 99px;
    background: #d0d5dd;
    position: relative;
    flex: 0 0 56px;
    order: 2;
    overflow: hidden;
    isolation: isolate;
    transition: background .16s ease;
    box-shadow: inset 0 0 0 1px rgba(16,24,40,.06);
}
.ctl-switch-ui::before {
    content: attr(data-off);
    position: absolute;
    top: 0;
    right: 7px;
    bottom: 0;
    left: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #667085;
    line-height: 24px;
    pointer-events: none;
    z-index: 1;
}
.ctl-switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 99px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.18);
    transition: transform .16s ease;
    z-index: 2;
    pointer-events: none;
}
.ctl-switch input:checked + .ctl-switch-ui,
.ctl-switch.is-on > .ctl-switch-ui { background: #12b76a; }
.ctl-switch input:checked + .ctl-switch-ui::before,
.ctl-switch.is-on > .ctl-switch-ui::before {
    content: attr(data-on);
    left: 7px;
    right: 22px;
    justify-content: flex-start;
    color: #fff;
}
.ctl-switch input:checked + .ctl-switch-ui::after,
.ctl-switch.is-on > .ctl-switch-ui::after { transform: translateX(32px); }
.ctl-switch.is-danger input:checked + .ctl-switch-ui,
.ctl-switch.is-danger.is-on > .ctl-switch-ui { background: var(--ctl-err); }
.ctl-switch input:disabled + .ctl-switch-ui { opacity: .45; }
.ctl-switch em {
    font-style: normal;
    font-weight: 650;
    line-height: 1.25;
    min-width: 0;
    flex: 1;
    order: 1;
}
.ctl-switch-form { display: inline-flex; }

.ctl-btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    background: #e8eef7;
    color: #1f2a3d;
}
.ctl-btn:hover { filter: brightness(.97); }
.ctl-btn-primary { background: var(--ctl-brand-2); color: #fff; }
.ctl-btn-danger { background: #fee4e2; color: #912018; }
.ctl-btn-warn { background: #fef0c7; color: #93370d; }
.ctl-btn-ghost { background: transparent; border: 1px solid var(--ctl-line); }
.ctl-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #eef2f6;
    color: #475467;
}
.ctl-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: currentColor;
    display: inline-block;
    box-shadow: 0 0 0 2px currentColor;
    opacity: .45;
}
.ctl-pill.ok { background: var(--ctl-ok-bg); color: var(--ctl-ok); }
.ctl-pill.ok .ctl-dot { opacity: 1; animation: ctl-pulse 1.8s ease infinite; }
.ctl-pill.warn { background: var(--ctl-warn-bg); color: var(--ctl-warn); }
.ctl-pill.warn .ctl-dot { opacity: 1; }
.ctl-pill.err, .ctl-pill.crit { background: var(--ctl-err-bg); color: var(--ctl-err); }
.ctl-pill.info { background: var(--ctl-info-bg); color: var(--ctl-info); }
@keyframes ctl-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6, 118, 71, .35); }
    50% { box-shadow: 0 0 0 4px rgba(6, 118, 71, 0); }
}
.ctl-help { color: var(--ctl-muted); font-size: 12px; line-height: 1.55; margin: 6px 0 0; }
.ctl-host-live { margin: 6px 0 10px; }
.ctl-host-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
    border: 1px solid var(--ctl-line);
    border-radius: 8px;
    overflow: auto;
    background: #fff;
    max-width: 100%;
}
.ctl-host-lines li {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 5px 10px;
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--ctl-line);
    border-radius: 0;
    min-width: max-content;
}
.ctl-host-lines li:last-child { border-bottom: 0; }
.ctl-host-lines li span {
    flex: 0 0 52px;
    color: var(--ctl-muted);
    font-weight: 650;
}
.ctl-host-lines li code {
    white-space: nowrap;
    background: #f2f4f7;
}
.ctl-feat-group { margin: 0 0 12px; }
.ctl-feat-group h3 { margin: 0 0 6px; font-size: 12px; color: #475467; }
.ctl-plan-feat {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--ctl-line);
    border-radius: 10px;
    background: #f8fafc;
}
.ctl-plan-feat > h3 { margin: 0 0 4px; font-size: 13px; }
.ctl-plan-quota {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px 12px;
    margin: 8px 0 0;
}
.ctl-plan-quota label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #475467;
}
.ctl-plan-apply {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 8px 0 0;
}
.ctl-table td.ctl-job-msg {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 560px;
    line-height: 1.45;
}
form.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.ok { color: var(--ctl-ok); }
.err { color: var(--ctl-err); }
.warn { color: var(--ctl-warn); }
.crit { color: var(--ctl-err); font-weight: 700; }
.ctl-expire-cell {
    min-width: 168px;
    white-space: nowrap;
}
.ctl-expire-cell .ctl-expire-text {
    display: block;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}
.ctl-expire-form {
    margin-top: 6px;
    flex-wrap: wrap;
}
.ctl-app .ctl-expire-input {
    width: 168px;
    max-width: 100%;
    min-width: 0;
    padding: 4px 6px;
    font-size: 12px;
}
[data-ctl-pane][hidden] { display: none !important; }

.ctl-open-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(7, 11, 20, .55);
    display: grid;
    place-items: center;
    padding: 20px;
}
.ctl-open-mask[hidden] { display: none; }
.ctl-open-box {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.ctl-open-box h3 { margin: 0 0 6px; font-size: 16px; }
.ctl-open-box p { margin: 0 0 10px; color: var(--ctl-muted); font-size: 13px; }
.ctl-open-track { height: 8px; border-radius: 999px; background: #e8eef7; overflow: hidden; }
.ctl-open-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width .35s ease;
}
.ctl-open-pct { margin: 8px 0 0; font-weight: 700; color: #1d4ed8; font-size: 12px; }
.ctl-open-bar.is-danger { background: linear-gradient(90deg, #b42318, #f79009); }
.ctl-open-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.ctl-open-box .ctl-field { display: grid; gap: 6px; margin: 10px 0; }
.ctl-open-box .ctl-field span { font-size: 12px; color: var(--ctl-muted); }
.ctl-open-box .ctl-switch { margin: 8px 0 4px; align-items: flex-start; }
.ctl-open-steps {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ctl-open-steps li {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--ctl-muted);
}
.ctl-open-steps li.is-on { background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.ctl-open-steps li.is-done { background: #d1fadf; color: #067647; }
.ctl-open-steps li.is-fail { background: #fee4e2; color: #b42318; font-weight: 700; }
.ctl-open-result { margin-top: 12px; }
.ctl-open-result code { display: inline-block; margin: 2px 0; }
.ctl-wizard-nav { display: flex; gap: 6px; margin: 0 0 14px; }
.ctl-wizard-nav button {
    appearance: none;
    border: 1px solid var(--ctl-line);
    background: #f2f4f7;
    border-radius: 999px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.ctl-wizard-nav button.is-on { background: #fff; border-color: #c5d0de; }
.ctl-timeline { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.ctl-tl {
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: 10px;
    padding: 8px 12px;
}
.ctl-tl i { font-style: normal; color: var(--ctl-muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-right: 8px; }
.ctl-tl em { font-style: normal; color: var(--ctl-muted); font-size: 11px; margin-right: 8px; }
.ctl-tl b { font-size: 13px; }
.ctl-tl span { display: block; margin-top: 4px; color: #475467; font-size: 12px; }
.wall-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 90;
    background: #101820;
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
}
.wall-toast[hidden] { display: none; }
.wall-toast.is-err { background: #912018; }
.ctl-desk-bar { margin-bottom: 10px; }
.ctl-desk-bar .ctl-field { margin-bottom: 0; }
.ctl-live-switch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 8px;
    padding: 8px 10px;
    background: var(--ctl-surface);
    border: 1px solid var(--ctl-line);
    border-radius: 8px;
}
.ctl-live-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.ctl-live-row em {
    flex: 0 0 36px;
    margin-top: 6px;
    color: var(--ctl-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}
.ctl-live-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.ctl-live-chips .ctl-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--ctl-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ctl-text);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.ctl-live-chips .ctl-chip:hover {
    border-color: #8aa0b8;
}
.ctl-live-chips .ctl-chip.is-on {
    background: #1d4f8a;
    border-color: #1d4f8a;
    color: #fff;
}
.ctl-embed {
    width: 100%;
    min-height: calc(100vh - 180px);
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    background: #fff;
}
.ctl-live-switch + .ctl-embed {
    min-height: calc(100vh - 280px);
}

.ctl-pay-form h2,
.ctl-pay-off h2,
.ctl-pay-ticket h2 {
    margin: 0 0 8px;
}
.ctl-pay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}
.ctl-pay-chips .ctl-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 12px;
    border: 1px solid var(--ctl-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ctl-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.ctl-pay-chips .ctl-chip.is-on {
    background: #1d4f8a;
    border-color: #1d4f8a;
    color: #fff;
}
.ctl-pay-ticket {
    margin-top: 14px;
}
.ctl-pay-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.ctl-pay-ticket-grid {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 18px;
    align-items: start;
}
.ctl-pay-qr {
    width: 168px;
    height: 168px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--ctl-line);
    border-radius: 10px;
}
.ctl-pay-qr img,
.ctl-pay-qr canvas,
.ctl-pay-qr table {
    width: 100% !important;
    height: 100% !important;
}
.ctl-pay-amount {
    font-size: 18px;
    margin: 0 0 8px;
}
.ctl-pay-amount strong {
    font-size: 28px;
    letter-spacing: .02em;
    color: var(--ctl-brand);
    cursor: pointer;
}
.ctl-pay-off {
    background: var(--ctl-warn-bg);
}
.ctl-pay-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 8px;
}
.ctl-pay-filter select,
.ctl-pay-filter input[name="pay_q"] {
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid var(--ctl-line);
    border-radius: 8px;
    font: inherit;
}
.ctl-pay-filter input[name="pay_q"] {
    min-width: 220px;
}
.ctl-pay-ops {
    white-space: nowrap;
}
.ctl-pay-ops .inline {
    display: inline-block;
    margin: 2px 4px 2px 0;
}
@media (max-width: 720px) {
    .ctl-pay-ticket-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1099px) {
    .ctl-auth-wrap { grid-template-columns: 1fr; }
    .ctl-auth-brand { min-height: 280px; padding: 36px 24px; }
    .ctl-auth-brand h1 { font-size: 28px; }
    .ctl-auth-form { padding: 28px 20px 40px; }
    .ctl-main { margin-left: 0; padding: 12px 14px 28px; }
    .ctl-app:not(.ctl-sidebar-collapsed) .ctl-drawer-mask { display: block; }
    .ctl-app:not(.ctl-sidebar-collapsed) { overflow: hidden; }
    .ctl-grid, .ctl-stats, .ctl-site-meta, .ctl-site-creds { grid-template-columns: 1fr 1fr; }
    .ctl-sites { grid-template-columns: 1fr; }
    .ctl-top { flex-wrap: wrap; }
}
@media (max-width: 720px) {
    .ctl-stats, .ctl-grid, .ctl-site-meta, .ctl-site-creds { grid-template-columns: 1fr; }
    .ctl-site-line { grid-template-columns: 1fr; }
    .ctl-auth-points { display: none; }
}
