:root {
    --bg: #020711;
    --surface: #07111f;
    --surface-2: #0b1829;
    --line: rgba(255, 255, 255, .1);
    --text: #f5f7fb;
    --muted: #9aa7b7;
    --gold: #f5b900;
    --gold-2: #ffd858;
    --green: #6fe000;
    --danger: #ff5e6b;
    --shadow: 0 28px 80px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% -10%, rgba(111, 224, 0, .10), transparent 35rem),
        radial-gradient(circle at 95% 0%, rgba(245, 185, 0, .10), transparent 35rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.muted { color: var(--muted); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 7, 17, .86);
    backdrop-filter: blur(18px);
}
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand img { width: 66px; height: 66px; object-fit: cover; border-radius: 17px; border: 1px solid rgba(111, 224, 0, .35); box-shadow: 0 0 28px rgba(111, 224, 0, .14); }
.brand span { display: grid; }
.brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.brand small { color: var(--green); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.brand-compact img { width: 48px; height: 48px; border-radius: 13px; }
.account-nav { display: flex; align-items: center; gap: 18px; font-size: .88rem; font-weight: 700; }
.account-nav a { color: var(--muted); text-decoration: none; }
.account-nav a:hover { color: var(--gold); }
.user-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }

.auth-body { display: grid; place-items: center; padding: 32px 16px; }
.auth-shell { width: min(100%, 520px); }
.auth-card {
    overflow: hidden;
    position: relative;
    padding: 34px;
    border: 1px solid rgba(245, 185, 0, .24);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(11, 24, 41, .96), rgba(4, 11, 22, .98));
    box-shadow: var(--shadow);
}
.auth-card::before { content: ""; position: absolute; width: 260px; height: 260px; right: -130px; top: -130px; border-radius: 50%; background: rgba(245, 185, 0, .13); filter: blur(2px); pointer-events: none; }
.auth-copy { margin: 34px 0 24px; }
.eyebrow { display: inline-block; color: var(--gold); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
.auth-copy h1, .page-hero h1 { margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.02; letter-spacing: -.055em; }
.auth-copy h1 { font-size: clamp(2rem, 8vw, 3rem); }
.auth-copy p, .page-hero p { color: var(--muted); margin-bottom: 0; }

.form-stack, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #dce3ec; font-size: .82rem; font-weight: 800; }
label small { color: var(--muted); font-weight: 500; }
input, select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, .26);
    color: var(--text);
    padding: 11px 13px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 185, 0, .12); }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { border: 0; border-radius: 8px; padding: 8px 11px; margin-right: 10px; background: #233149; color: #fff; cursor: pointer; }
.field-wide, .form-submit, .form-divider { grid-column: 1 / -1; }
.schedule-guide { margin: 0; padding: 13px 15px; border: 1px solid rgba(245, 185, 0, .24); border-radius: 12px; color: var(--muted); background: rgba(245, 185, 0, .06); font-size: .78rem; }
.schedule-guide strong { color: var(--gold-2); }
.form-divider { display: flex; align-items: center; gap: 14px; margin-top: 4px; color: var(--gold); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 17px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s, filter .2s, border-color .2s;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button-primary { color: #161000; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 12px 30px rgba(245, 185, 0, .16); }
.button-secondary { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .04); }
.button-small { min-height: 36px; padding: 6px 10px; border-radius: 9px; font-size: .76rem; }
.auth-help { display: grid; gap: 4px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.auth-help a { width: fit-content; color: var(--green); font-weight: 900; text-decoration: none; }

.alert { margin: 18px 0; border: 1px solid; border-radius: 12px; padding: 12px 14px; font-size: .86rem; font-weight: 700; }
.alert-error { color: #ffd9dc; border-color: rgba(255, 94, 107, .35); background: rgba(255, 94, 107, .1); }
.alert-success { color: #dfffc0; border-color: rgba(111, 224, 0, .35); background: rgba(111, 224, 0, .1); }

.page-main { padding-block: 52px 80px; }
.page-hero { display: flex; align-items: end; justify-content: space-between; gap: 34px; margin-bottom: 32px; }
.page-hero > div:first-child { max-width: 740px; }
.status-card { flex: 0 0 auto; min-width: 190px; display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; padding: 16px; border: 1px solid rgba(111, 224, 0, .25); border-radius: 16px; background: rgba(111, 224, 0, .06); }
.status-card small { grid-column: 2; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 24px; scrollbar-width: thin; }
.archive-policy { display: flex; align-items: flex-start; gap: 13px; margin: -8px 0 24px; padding: 16px 18px; border: 1px solid rgba(245, 185, 0, .24); border-radius: 16px; background: rgba(245, 185, 0, .06); }
.archive-policy-icon { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #171000; font-weight: 900; }
.archive-policy strong { color: var(--gold-2); }
.archive-policy p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.tabs a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .82rem; font-weight: 800; }
.tabs a:hover, .tabs a.active { color: #171000; border-color: var(--gold); background: var(--gold); }

.banner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.banner-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: 0 18px 48px rgba(0, 0, 0, .25); }
.banner-image { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #000; }
.banner-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.banner-image:hover img { transform: scale(1.025); }
.banner-info { padding: 17px; display: grid; gap: 16px; }
.banner-info h2 { margin: 3px 0 2px; font-size: 1.08rem; line-height: 1.25; letter-spacing: -.02em; }
.banner-info p { margin: 0; color: var(--muted); font-size: .8rem; }
.category-label { color: var(--gold); font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.banner-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 9px; }
.empty-state { padding: 70px 24px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; }
.empty-state h2 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); }

.admin-main { display: grid; gap: 24px; }
.admin-hero { margin-bottom: 0; }
.metrics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.metrics div { min-width: 130px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .035); }
.metrics strong, .metrics span { display: block; }
.metrics strong { color: var(--gold); font-size: 1.8rem; line-height: 1; }
.metrics span { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(11, 24, 41, .96), rgba(5, 13, 24, .96)); }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.panel-number { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(245, 185, 0, .35); border-radius: 10px; color: var(--gold); font-size: .7rem; font-weight: 900; }
.panel-heading h2 { margin: 0; font-size: 1.17rem; }
.panel-heading p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 13px 12px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 2px; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 900; }
.badge-active { color: #cfff9f; background: rgba(111, 224, 0, .1); }
.badge-scheduled { color: #ffe59a; background: rgba(245, 185, 0, .12); }
.badge-inactive { color: #ffc0c5; background: rgba(255, 94, 107, .1); }
.actions-cell { display: flex; align-items: center; gap: 8px; }
.reset-form { display: flex; align-items: center; gap: 6px; }
.reset-form input { min-width: 140px; min-height: 36px; padding: 6px 9px; border-radius: 9px; font-size: .76rem; }

.installer-shell { width: min(100%, 760px); }
.installer-card { padding: 34px; }
.install-result { text-align: center; padding: 36px 0 12px; }
.install-result .eyebrow { display: block; margin-top: 16px; }
.install-result h1 { margin: 8px 0; }
.install-result p { color: var(--muted); margin-bottom: 24px; }
.success-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: #102200; background: var(--green); font-size: 2rem; font-weight: 900; box-shadow: 0 0 34px rgba(111, 224, 0, .22); }

@media (max-width: 900px) {
    .banner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid { grid-template-columns: 1fr; }
    .page-hero { align-items: flex-start; flex-direction: column; }
    .status-card { width: 100%; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 22px, 1160px); }
    .topbar-inner { min-height: 70px; }
    .brand-compact img { width: 42px; height: 42px; }
    .brand-compact strong { font-size: .9rem; }
    .brand-compact small, .user-pill { display: none; }
    .account-nav { gap: 12px; font-size: .76rem; }
    .page-main { padding-block: 36px 60px; }
    .page-hero h1 { font-size: 2.35rem; }
    .banner-grid { grid-template-columns: 1fr; }
    .banner-card { max-width: 460px; width: 100%; margin-inline: auto; }
    .auth-card, .installer-card { padding: 24px 20px; border-radius: 22px; }
    .brand img { width: 56px; height: 56px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide, .form-submit, .form-divider { grid-column: auto; }
    .metrics { width: 100%; }
    .metrics div { min-width: 0; flex: 1; }
    .panel { padding: 19px 15px; }
    .actions-cell { min-width: 260px; }
}
