:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-strong: #f9fbff;
    --text: #172033;
    --muted: #68738a;
    --line: #dde4ef;
    --primary: #1167d8;
    --primary-strong: #0b4ead;
    --accent: #0f9f7a;
    --danger: #cf3f3f;
    --warning: #b87503;
    --shadow: 0 18px 45px rgba(24, 35, 56, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 22px;
    background: #0f1724;
    color: #eef4ff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #1d7bf0;
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small,
.user-card strong,
.user-card small {
    display: block;
}

.brand small,
.user-card small {
    color: #aebbd0;
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    padding: 11px 12px;
    border-radius: 8px;
    color: #c5d1e4;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.user-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.user-card span {
    color: #8ee3c1;
    font-weight: 700;
}

.main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.hero {
    min-height: 430px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: center;
    gap: 28px;
    padding: 38px;
    border-radius: 8px;
    background:
        linear-gradient(130deg, rgba(17, 103, 216, 0.95), rgba(11, 78, 173, 0.88)),
        radial-gradient(circle at 80% 20%, rgba(15, 159, 122, 0.5), transparent 35%);
    color: #fff;
    box-shadow: var(--shadow);
}

.hero h1,
.auth-layout h1,
.page-title h1 {
    margin: 6px 0 10px;
    line-height: 1.05;
    letter-spacing: 0;
}

.hero h1 {
    font-size: 76px;
}

.hero p,
.auth-layout p,
.section-head p {
    color: rgba(255, 255, 255, 0.82);
    max-width: 620px;
    line-height: 1.7;
}

.hero-actions,
.button-row,
.topup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-board {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(9, 19, 35, 0.42);
    backdrop-filter: blur(12px);
}

.hero-board div:not(.pulse-row) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-board span {
    color: #cbd9ec;
}

.hero-board strong {
    font-size: 24px;
}

.pulse-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 8px;
    height: 92px;
}

.pulse-row i {
    display: block;
    border-radius: 6px 6px 0 0;
    background: #8ee3c1;
}

.pulse-row i:nth-child(1) { height: 38%; }
.pulse-row i:nth-child(2) { height: 72%; }
.pulse-row i:nth-child(3) { height: 54%; }
.pulse-row i:nth-child(4) { height: 86%; }
.pulse-row i:nth-child(5) { height: 64%; }

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #8ee3c1;
}

.section-head,
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 30px 0 18px;
}

.section-head h2,
.panel h2,
.page-title h1 {
    margin: 0;
}

.section-head p,
.page-title p {
    color: var(--muted);
}

.page-title h1,
.auth-layout h1 {
    font-size: 52px;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.plan-card,
.panel,
.metric,
.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.plan-card {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.plan-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.plan-card p,
.feature-list,
.metric small,
td small,
.empty-state,
.notice span,
.topup-panel p {
    color: var(--muted);
}

.price {
    display: block;
    font-size: 28px;
}

.price span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.feature-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    border-color: #b9c6d9;
}

.btn.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-strong);
}

.btn.ghost {
    background: transparent;
    color: inherit;
}

.btn.danger {
    border-color: rgba(207, 63, 63, 0.24);
    color: var(--danger);
}

.btn.full {
    width: 100%;
}

.btn.tiny {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.65fr);
    align-items: start;
    gap: 24px;
    margin-top: 56px;
}

.auth-layout p {
    color: var(--muted);
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head a {
    color: var(--primary);
    font-weight: 700;
}

.form-stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #34415a;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(17, 103, 216, 0.18);
    border-color: var(--primary);
}

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

.check {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

.metric strong {
    font-size: 28px;
}

.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    margin: 0 0 18px;
    border-left: 4px solid var(--accent);
}

.notice.compact {
    justify-content: flex-start;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr);
    gap: 18px;
}

.two-column.wide-left {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.7fr);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    max-width: 360px;
    overflow-wrap: anywhere;
    margin-top: 4px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2f8;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status.ok {
    background: #e6f8f1;
    color: #08775a;
}

.status.bad {
    background: #fdecec;
    color: var(--danger);
}

.status.muted {
    background: #edf0f5;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 120px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
}

.log-list {
    display: grid;
    gap: 12px;
}

.log-list article {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: var(--panel-strong);
}

.dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--muted);
}

.dot.ok {
    background: var(--accent);
}

.dot.bad {
    background: var(--danger);
}

.balance-pill {
    padding: 10px 14px;
    border-radius: 8px;
    background: #e6f8f1;
    color: #08775a;
    font-weight: 800;
}

.topup-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.admin-plan {
    display: grid;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
}

.alert.success {
    border-color: #bfe8d9;
    color: #08775a;
}

.alert.danger {
    border-color: #f2c4c4;
    color: var(--danger);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav,
    .metrics,
    .plan-grid,
    .hero,
    .auth-layout,
    .two-column,
    .two-column.wide-left,
    .topup-panel {
        grid-template-columns: 1fr;
    }

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

    .main {
        padding: 18px;
    }
}

@media (max-width: 620px) {
    .hero h1 {
        font-size: 46px;
    }

    .page-title h1,
    .auth-layout h1 {
        font-size: 36px;
    }

    .hero {
        padding: 24px;
    }

    .section-head,
    .page-title,
    .notice {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

    .actions {
        min-width: 220px;
    }
}
