:root {
    color-scheme: dark;
    --bg: #080d13;
    --panel: #111923;
    --card: #182330;
    --line: #2b3a4d;
    --text: #f6f8fb;
    --muted: #94a5b9;
    --primary: #2185ff;
    --primary-hover: #4a9dff;
    --success: #42c77a;
    --danger: #ec5d6a;
    --warning: #f2b84b;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(33, 133, 255, .14), transparent 34rem),
        var(--bg);
    color: var(--text);
}
a { color: inherit; }
code { color: #b9d9ff; }

.setup-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.setup-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}
.brand-panel {
    padding: 52px;
    background: linear-gradient(145deg, #121d2a, #0b1119);
    border-right: 1px solid var(--line);
}
.brand-panel img { width: 210px; max-width: 100%; display: block; margin-bottom: 52px; }
.brand-panel h1 { margin: 8px 0 16px; font-size: 38px; line-height: 1.05; }
.brand-panel p { color: var(--muted); line-height: 1.7; }
.form-panel { padding: 46px 52px; }
.form-panel h2 { margin: 6px 0 26px; font-size: 28px; }
.eyebrow {
    margin: 0;
    color: #73b4ff !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.requirement-list { display: grid; gap: 10px; margin-top: 34px; }
.requirement { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.requirement span {
    display: grid; place-items: center; width: 22px; height: 22px;
    border-radius: 50%; font-size: 12px; font-weight: 800;
}
.requirement.ok span { color: #07120b; background: var(--success); }
.requirement.bad span { color: white; background: var(--danger); }

.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.field small, .small-note { display: block; margin-top: 7px; color: var(--muted); line-height: 1.5; }
input, select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #0c131c;
    color: var(--text);
    padding: 10px 12px;
    outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 133, 255, .15); }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--card);
    color: var(--text);
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: #223146; }
.button.primary { background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: #ffd7db; border-color: #7a323b; }
.button.full { width: 100%; margin-top: 8px; }
.alert { margin: 0 0 20px; padding: 13px 15px; border-radius: 9px; line-height: 1.5; }
.alert.error { color: #ffd5d9; background: rgba(236, 93, 106, .12); border: 1px solid rgba(236, 93, 106, .45); }
.alert.success { color: #c9f8da; background: rgba(66, 199, 122, .12); border: 1px solid rgba(66, 199, 122, .4); }
.success-card { text-align: center; padding: 48px 0; }
.success-icon {
    display: grid; place-items: center; width: 72px; height: 72px;
    margin: 0 auto 20px; border-radius: 50%; background: var(--success);
    color: #07120b; font-size: 34px; font-weight: 900;
}

.admin-body { min-height: 100vh; }
.topbar {
    height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; border-bottom: 1px solid var(--line); background: #0d141d;
    position: sticky; top: 0; z-index: 5;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.topbar .brand img { width: 36px; height: 36px; object-fit: contain; background: white; border-radius: 7px; padding: 3px; }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav a { color: var(--muted); padding: 9px 12px; text-decoration: none; border-radius: 7px; }
.topbar nav a:hover, .topbar nav a.active { color: white; background: var(--card); }
.admin-main { width: min(1240px, calc(100% - 40px)); margin: 30px auto 60px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 30px; }
.page-head p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.card-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-head h2 { margin: 0; font-size: 18px; }
.card-body { padding: 22px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge.active { color: #bcf5d1; background: rgba(66,199,122,.13); }
.badge.trial { color: #c6e1ff; background: rgba(33,133,255,.14); }
.badge.suspended, .badge.expired { color: #ffd1d5; background: rgba(236,93,106,.13); }
.search { width: min(360px, 100%); }
.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.info-list { display: grid; gap: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.info-row span { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.login-card img { display: block; width: 180px; max-width: 100%; margin: 0 auto 30px; }
.login-card h1 { margin: 0 0 8px; }
.login-card > p { color: var(--muted); margin: 0 0 24px; }

@media (max-width: 850px) {
    .setup-shell, .detail-grid { grid-template-columns: 1fr; }
    .brand-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 34px; }
    .brand-panel img { width: 170px; margin-bottom: 28px; }
    .form-panel { padding: 34px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .setup-page { padding: 12px; }
    .form-grid.two, .stats { grid-template-columns: 1fr; }
    .topbar { padding: 0 14px; }
    .topbar .brand span { display: none; }
    .admin-main { width: min(100% - 20px, 1240px); }
    .page-head { align-items: stretch; flex-direction: column; }
}

