:root {
    --bg: #07090d;
    --bg-soft: #0d1118;
    --panel: rgba(255, 255, 255, 0.055);
    --panel-strong: rgba(255, 255, 255, 0.085);
    --border: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.075);
    --text: #f5f7fb;
    --muted: #9ba4b5;
    --muted-2: #667085;
    --accent: #63e6be;
    --accent-2: #7aa2ff;
    --danger: #ff6b6b;
    --warning: #ffd166;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --max: 1360px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(99, 230, 190, 0.12), transparent 34%),
        radial-gradient(circle at 90% 10%, rgba(122, 162, 255, 0.10), transparent 30%),
        linear-gradient(180deg, #080b10 0%, #05070a 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    background: rgba(7, 9, 13, 0.78);
    border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
    width: min(100% - 32px, var(--max));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 230, 190, 0.95), rgba(122, 162, 255, 0.85));
    box-shadow: 0 12px 30px rgba(99, 230, 190, 0.18);
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title strong {
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-title span {
    font-size: 12px;
    color: var(--muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-shell {
    width: min(100% - 32px, var(--max));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.hero {
    padding: 18px 0 28px;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--accent);
    box-shadow: 0 0 22px var(--accent);
}

.kicker.small {
    font-size: 11px;
    margin-bottom: 0;
}

.hero h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.hero p {
    margin: 20px 0 0;
    max-width: 780px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.card,
.stat-card,
.client-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card {
    padding: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card {
    min-height: 132px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.stat-number {
    display: block;
    margin-top: 12px;
    font-size: 42px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-note {
    color: var(--muted-2);
    font-size: 13px;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 6px 0 0;
    font-size: 28px;
    letter-spacing: -0.035em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-row {
    display: grid;
    gap: 8px;
}

.span-2 {
    grid-column: span 2;
}

label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
    color: var(--text);
    min-height: 42px;
    padding: 10px 13px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(99, 230, 190, 0.55);
    box-shadow: 0 0 0 4px rgba(99, 230, 190, 0.09);
}

.form-actions {
    margin-top: 18px;
}

.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.095);
    border-color: rgba(255,255,255,0.22);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(99,230,190,0.95), rgba(122,162,255,0.92));
    color: #061014;
    border-color: transparent;
}

.btn-danger {
    color: #fff;
    background: rgba(255, 107, 107, 0.13);
    border-color: rgba(255, 107, 107, 0.32);
}

.btn-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
    border: 1px solid var(--border);
}

.alert-ok {
    color: var(--accent);
    background: rgba(99, 230, 190, 0.08);
    border-color: rgba(99, 230, 190, 0.25);
}

.alert-error {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.25);
}

.note-list {
    display: grid;
    gap: 12px;
}

.note-item {
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
}

.note-item strong {
    display: block;
    margin-bottom: 5px;
}

.note-item span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.clients-card {
    margin-top: 18px;
}

.pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.045);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.pill.live {
    color: var(--accent);
    border-color: rgba(99, 230, 190, 0.25);
    background: rgba(99, 230, 190, 0.075);
}

.client-list {
    display: grid;
    gap: 12px;
}

.client-panel {
    overflow: hidden;
}

.client-summary {
    cursor: pointer;
    list-style: none;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.client-summary::-webkit-details-marker {
    display: none;
}

.client-main {
    display: grid;
    gap: 4px;
}

.client-main strong {
    font-size: 18px;
}

.client-main span,
.summary-expiry {
    color: var(--muted);
    font-size: 13px;
}

.client-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-soft);
}

.badge-ok {
    color: var(--accent);
    background: rgba(99, 230, 190, 0.08);
    border-color: rgba(99, 230, 190, 0.25);
}

.badge-blue {
    color: var(--accent-2);
    background: rgba(122, 162, 255, 0.08);
    border-color: rgba(122, 162, 255, 0.25);
}

.badge-danger {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.25);
}

.client-details {
    padding: 0 18px 18px;
    border-top: 1px solid var(--border-soft);
}

.client-data-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding-top: 18px;
    margin-bottom: 16px;
}

.data-box {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-soft);
    min-width: 0;
}

.data-box span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.data-box strong {
    font-size: 14px;
}

code {
    display: inline-flex;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 10px;
    color: var(--accent);
    background: rgba(0,0,0,0.26);
    border: 1px solid var(--border-soft);
    font-size: 12px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tool-box {
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.035);
}

.tool-box h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.danger-zone {
    border-color: rgba(255, 107, 107, 0.18);
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1 1 220px;
}

.settings-card {
    margin-top: 18px;
}

.settings-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.settings-summary::-webkit-details-marker {
    display: none;
}

.settings-summary span {
    color: var(--muted);
}

.settings-body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

@media (max-width: 1100px) {
    .stats-grid,
    .client-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar-inner,
    .client-summary,
    .settings-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .client-data-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .hero h1 {
        font-size: 40px;
    }

    .app-shell {
        width: min(100% - 22px, var(--max));
    }
}
/* Login / auth page */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-shell {
    width: min(100% - 32px, 1180px);
    min-height: min(760px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1.15fr);
    gap: 18px;
    align-items: stretch;
}

.auth-card,
.auth-side {
    background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: auto;
}

.auth-copy {
    padding: 72px 0 28px;
}

.auth-copy h1 {
    margin: 0;
    font-size: clamp(42px, 5vw, 70px);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.auth-copy p {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
}

.auth-submit:disabled,
.auth-form input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-footer {
    margin-top: auto;
    padding-top: 28px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 12px;
}

.auth-footer a {
    color: var(--accent);
}

.auth-side {
    position: relative;
    padding: 28px;
    display: flex;
    align-items: flex-end;
    background:
        radial-gradient(circle at 20% 10%, rgba(99,230,190,0.16), transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(122,162,255,0.18), transparent 38%),
        linear-gradient(160deg, rgba(255,255,255,0.085), rgba(255,255,255,0.025));
}

.auth-side::before {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
}

.auth-side::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -90px;
    top: -80px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(99,230,190,0.22), transparent 65%);
    filter: blur(2px);
    pointer-events: none;
}

.auth-side-inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

.auth-side h2 {
    max-width: 720px;
    margin: 26px 0 28px;
    font-size: clamp(34px, 4.4vw, 66px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

@media (max-width: 940px) {
    .auth-page {
        place-items: start center;
        padding: 20px 0;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-copy {
        padding-top: 54px;
    }

    .auth-side {
        min-height: 420px;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        width: min(100% - 22px, 1180px);
    }

    .auth-card,
    .auth-side {
        border-radius: 24px;
        padding: 22px;
    }

    .auth-footer {
        flex-direction: column;
    }
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.capacity-form,
.restream-form {
    display: grid;
    gap: 12px;
}

.extras-section {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    margin-bottom: 20px;
}

.extras-section:last-child {
    margin-bottom: 0;
}

.extras-section > strong {
    font-size: 14px;
}

@media (max-width: 720px) {
    .mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .client-meta {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .client-badges {
        justify-content: flex-start;
    }

    .summary-expiry {
        min-width: 0;
        text-align: left;
    }
}
.restream-form button.btn {
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}

.capacity-form .btn,
.restream-form .btn {
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}

.badge-purple {
    color: #c4b5fd;
    background: rgba(196, 181, 253, 0.08);
    border-color: rgba(196, 181, 253, 0.25);
}
.client-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: center;
    gap: 14px;
    min-width: 520px;
}

.client-badges {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-expiry {
    min-width: 96px;
    text-align: right;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.footer-link {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.footer-link:hover,
.auth-footer a:hover {
    text-decoration: underline;
}

.footer-contact-link {
    color: var(--accent);
}

.cookie-note {
    margin-top: 22px;
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.55;
}