:root {
    --bg-top: #000000;
    --bg-mid: #000258;
    --bg-bot: #003399;
    --card-bg: rgba(8, 14, 38, 0.9);
    --card-bg-soft: rgba(9, 14, 42, 0.84);
    --line: rgba(208, 136, 255, 0.34);
    --line-strong: rgba(169, 171, 255, 0.56);
    --text-main: #ecf5ff;
    --text-soft: #d5d8ff;
    --accent: #3366ff;
    --accent-2: #ff00ff;
    --accent-3: #993399;
    --state-default: linear-gradient(to bottom, #3366ff 17%, #ff00ff 67%);
    --state-focus: linear-gradient(to bottom, #003399 23%, #993399 64%);
    --state-selected: linear-gradient(to bottom, #000000 37%, #000258 93%);
    --surface-default: linear-gradient(160deg, rgba(8, 15, 43, 0.86), rgba(8, 14, 40, 0.82)), var(--state-default);
    --surface-focus: linear-gradient(160deg, rgba(5, 11, 35, 0.9), rgba(8, 12, 39, 0.84)), var(--state-focus);
    --surface-selected: linear-gradient(160deg, rgba(4, 7, 26, 0.92), rgba(6, 10, 33, 0.86)), var(--state-selected);
    --danger: #ef4444;
    --ok: #22c55e;
    --warn: #f59e0b;
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 9% 10%, rgba(51, 102, 255, 0.22), transparent 35%),
        radial-gradient(circle at 88% 88%, rgba(255, 0, 255, 0.15), transparent 42%),
        radial-gradient(circle at 52% -10%, rgba(153, 51, 153, 0.16), transparent 40%),
        linear-gradient(to bottom, #000000 53%, #000250 75%);
    background-attachment: fixed;
}

a {
    color: #8ec7ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.panel-body {
    min-height: 100vh;
}

.panel-shell {
    width: min(1720px, calc(100% - 1.2rem));
    margin: 0.65rem auto 1.2rem;
    display: grid;
    gap: 14px;
}

.panel-header {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-selected);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    padding: 14px;
    display: grid;
    gap: 12px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.header-left {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--state-default);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    flex: 0 0 auto;
}

.header-brand h1 {
    margin: 0;
    line-height: 1.04;
    font-size: 1.12rem;
}

.header-brand p {
    margin: 3px 0 0;
    font-size: 0.76rem;
    color: var(--text-soft);
}

.menu-select-wrap {
    display: grid;
    gap: 4px;
    width: min(350px, 100%);
}

.small {
    color: var(--text-soft);
    font-size: 0.78rem;
}

.menu-select {
    appearance: none;
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-default);
    border-radius: 11px;
    color: #e4f1ff;
    padding: 9px 11px;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.menu-select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 2px rgba(153, 51, 153, 0.28);
    background: var(--surface-focus);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.login-chip {
    border: 1px solid var(--line);
    background: var(--surface-selected);
    border-radius: 11px;
    padding: 7px 11px;
    display: grid;
    gap: 2px;
    line-height: 1.1;
    min-width: 188px;
}

.login-chip span {
    font-size: 0.68rem;
    color: var(--text-soft);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.login-chip strong {
    font-size: 0.9rem;
}

.header-page {
    border-top: 1px solid rgba(145, 193, 255, 0.22);
    padding-top: 11px;
}

.header-page h2 {
    margin: 0;
    font-size: 1.22rem;
}

.header-page p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.top-tabs {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 8px;
}

.top-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-default);
    color: #d6e9ff;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 8px 9px;
    min-height: 36px;
    text-align: center;
    text-decoration: none;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.top-tab:hover {
    text-decoration: none;
    border-color: var(--line-strong);
    transform: translateY(-1px);
    background: var(--surface-focus);
}

.top-tab.is-active {
    border-color: var(--line-strong);
    background: var(--surface-selected);
    box-shadow: 0 10px 22px rgba(12, 45, 95, 0.38);
}

.panel-main {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.content-wrap {
    display: grid;
    gap: 12px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-default);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
    padding: 14px;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 34%);
}

.card > * {
    position: relative;
    z-index: 1;
}

.glass {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-focus);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

.card-inner {
    background: var(--surface-selected);
}

.card-grid {
    display: grid;
    gap: 12px;
    align-items: stretch;
}

.card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-grid > .card,
.card-grid > article.card {
    height: 100%;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(145, 193, 255, 0.2);
}

.card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.card h4 {
    margin: 0;
    font-size: 0.95rem;
}

.stat-card {
    text-align: center;
    display: grid;
    gap: 7px;
    align-content: center;
    min-height: 116px;
}

.stat-label {
    color: var(--text-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 1.82rem;
    font-weight: 700;
}

.metric-card {
    position: relative;
    min-height: 104px;
}

.metric-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.metric-card p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    position: absolute;
    right: 12px;
    top: 12px;
}

.status-dot.active { background: var(--ok); }
.status-dot.paused { background: #f97316; }
.status-dot.trial { background: var(--warn); }
.status-dot.expired { background: var(--danger); }

.stack-list {
    display: grid;
    gap: 8px;
}

.stack-item {
    border: 1px solid var(--line);
    background: var(--surface-default);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quick-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-link {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-default);
    padding: 10px;
    color: #cfe5ff;
    font-weight: 600;
    font-size: 0.86rem;
}

.quick-link:hover {
    text-decoration: none;
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(10, 37, 76, 0.4);
    background: var(--surface-focus);
}

.dns-head,
.client-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.dns-head h4 {
    margin: 0;
    font-size: 0.98rem;
}

.dns-head p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    word-break: break-word;
}

.badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.74rem;
    border: 1px solid var(--line);
    background: var(--surface-default);
    white-space: nowrap;
}

.client-meta {
    margin-top: 8px;
    display: grid;
    gap: 4px;
    font-size: 0.85rem;
}

.client-meta span {
    color: var(--text-soft);
}

.details-box {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    background: var(--surface-default);
}

.details-box summary {
    cursor: pointer;
    color: #bdd7f8;
    font-weight: 600;
}

.details-box[open] {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 1px rgba(153, 51, 153, 0.26) inset;
    background: var(--surface-selected);
}

.top-gap {
    margin-top: 10px;
}

form.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
}

form.form-grid.compact {
    gap: 8px;
}

.field {
    grid-column: span 12;
    min-width: 0;
}

.field-9 { grid-column: span 9; }
.field-8 { grid-column: span 8; }
.field-7 { grid-column: span 7; }
.field-6 { grid-column: span 6; }
.field-5 { grid-column: span 5; }
.field-4 { grid-column: span 4; }
.field-3 { grid-column: span 3; }
.field-2 { grid-column: span 2; }
.field-1 { grid-column: span 1; }

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-soft);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-default);
    color: var(--text-main);
    padding: 10px 10px;
    font-size: 0.92rem;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input::placeholder,
textarea::placeholder {
    color: rgba(169, 194, 230, 0.74);
}

select option {
    background: #0b2342;
    color: #eaf4ff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 2px rgba(153, 51, 153, 0.28);
    background: var(--surface-focus);
}

textarea {
    min-height: 104px;
    resize: vertical;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: var(--state-default);
    box-shadow: 0 10px 22px rgba(17, 68, 146, 0.35);
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(67, 20, 104, 0.44);
    background: var(--state-focus);
}

.btn-ghost {
    border: 1px solid var(--line);
    background: var(--surface-default);
}

.btn-danger {
    background: linear-gradient(140deg, #ef4444, #dc2626);
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

thead th {
    text-align: left;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: var(--surface-selected);
    padding: 10px;
}

tbody td {
    border-top: 1px solid rgba(145, 193, 255, 0.16);
    padding: 10px;
    font-size: 0.86rem;
    vertical-align: top;
}

tbody tr:nth-child(odd) {
    background: var(--surface-default);
}

tbody tr:nth-child(even) {
    background: linear-gradient(160deg, rgba(5, 11, 35, 0.9), rgba(8, 12, 39, 0.84)), var(--state-default);
}

tbody tr:hover {
    background: var(--surface-focus);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    border: 1px solid transparent;
}

.status-chip.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
}

.status-chip.paused {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.45);
}

.status-chip.trial {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.45);
}

.status-chip.expired {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
}

.bar-track {
    width: 130px;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--state-default);
}

.flash {
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.flash-success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.16);
}

.flash-error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.16);
}

.flash-info {
    border-color: rgba(61, 121, 255, 0.5);
    background: rgba(61, 121, 255, 0.16);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.muted {
    color: var(--text-soft);
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.check-inline input {
    width: 16px;
    height: 16px;
}

.media-preview {
    margin-top: 8px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    overflow: hidden;
    height: 180px;
    background: var(--surface-default);
    display: grid;
    place-items: center;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-empty {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.sports-preview {
    border: 2px solid;
    border-radius: 14px;
    padding: 18px;
}

.sports-preview h4 {
    margin: 0 0 6px;
}

.sports-preview p {
    margin: 0 0 8px;
}

.reveal {
    opacity: 0;
    transform: translateY(6px);
    animation: revealIn .34s ease forwards;
}

@keyframes revealIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(460px, 100%);
    padding: 22px;
}

.login-hero {
    text-align: center;
    margin-bottom: 14px;
}

.login-mark {
    margin: 0 auto 12px;
}

.login-hero h1 {
    margin: 0;
    font-size: 1.38rem;
}

.login-host {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.login-footnote {
    margin-top: 14px;
}

@media (max-width: 1650px) {
    .top-tabs {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .card-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .top-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .panel-shell {
        width: calc(100% - 0.7rem);
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .header-left {
        width: 100%;
        align-items: stretch;
        gap: 10px;
    }

    .menu-select-wrap {
        width: 100%;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .top-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .card-grid-5,
    .card-grid-4,
    .card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .field-9,
    .field-8,
    .field-7,
    .field-6,
    .field-5,
    .field-4,
    .field-3,
    .field-2,
    .field-1 {
        grid-column: span 12;
    }
}

@media (max-width: 640px) {
    .panel-shell {
        width: calc(100% - 0.55rem);
        margin-top: 0.48rem;
    }

    .panel-header,
    .card {
        border-radius: 14px;
        padding: 12px;
    }

    .top-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-grid-5,
    .card-grid-4,
    .card-grid-3,
    .card-grid-2 {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 650px;
    }

    .btn,
    .btn-ghost {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
