:root {
    --ink: #0a2458;
    --text: #17202b;
    --muted: #697386;
    --line: #e4edf8;
    --soft: #eef7ff;
    --blue: #1267f2;
    --orange: #ff5b18;
    --green: #32c940;
    --panel: #ffffff;
    --shadow: 0 24px 70px rgba(17, 54, 96, .12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #f4f9ff;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #eff8ff 0%, #ffffff 45%, #eef6ff 100%);
}
.login-card {
    width: min(520px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 38px;
}
.login-card img {
    width: 245px;
    max-height: 72px;
    object-fit: contain;
    margin-bottom: 24px;
}
.login-card h1 {
    margin: 16px 0 12px;
}
.login-card p {
    color: var(--muted);
    line-height: 1.65;
}
.login-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}
.login-form .primary-btn {
    width: 100%;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 18px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.brand {
    height: 62px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}
.brand img {
    width: 215px;
    max-height: 58px;
    object-fit: contain;
}
.side-nav {
    display: grid;
    gap: 8px;
}
.nav-label {
    margin: 16px 14px 4px;
    color: #91a0b5;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.side-nav a {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    color: #4d5f78;
    border-radius: 8px;
    font-weight: 700;
}
.side-nav a.active,
.side-nav a:hover {
    color: var(--blue);
    background: #eaf3ff;
}
.side-nav svg { width: 20px; height: 20px; }
.sidebar-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
    padding: 14px;
    background: #f7fbff;
    border-radius: 8px;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--orange);
}
.status-dot.ok { background: var(--green); }

.main {
    min-width: 0;
    padding: 34px 42px 60px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}
.eyebrow {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    margin: 0 0 6px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
    color: var(--ink);
    font-size: 34px;
    line-height: 1.1;
    margin-bottom: 0;
}
h2 {
    color: var(--ink);
    font-size: 26px;
    line-height: 1.18;
}
h3 {
    color: var(--ink);
    font-size: 18px;
}
.top-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.global-search,
.inline-search {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
}
.global-search input,
.inline-search input {
    width: 180px;
    height: 42px;
    border: 0;
    background: transparent;
    padding: 0;
}
.inline-search input { width: 260px; }
.primary-btn,
.secondary-btn,
.icon-btn {
    border: 0;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
}
.primary-btn {
    padding: 0 20px;
    background: var(--orange);
    color: #fff;
    box-shadow: 0 16px 38px rgba(255, 91, 24, .24);
}
.primary-btn.disabled {
    opacity: .72;
    cursor: not-allowed;
}
.secondary-btn {
    padding: 0 20px;
    border: 1px solid #cddcee;
    background: #fff;
    color: var(--ink);
}
.icon-btn {
    width: 48px;
    background: #fff;
    color: var(--blue);
    border: 1px solid var(--line);
}
.primary-btn svg,
.secondary-btn svg,
.icon-btn svg { width: 18px; height: 18px; }

.notice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #ffd8c9;
    background: #fff7f3;
    color: #9a3614;
    border-radius: 8px;
    margin-bottom: 22px;
}
.notice.compact {
    margin: 16px 0 0;
    align-items: flex-start;
}
.notice svg { flex: 0 0 auto; }
.notice span { display: block; color: #6f503f; margin-top: 2px; }

.panel,
.metric-card,
.service-card,
.promo-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 8px;
}
.pill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--blue);
    background: #dcecff;
    font-weight: 900;
    font-size: 13px;
}
.pill svg {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.promo-card {
    min-height: 210px;
    padding: 24px;
}
.promo-card span {
    display: block;
    color: var(--ink);
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 10px;
}
.promo-card p {
    color: var(--muted);
    line-height: 1.65;
}
.promo-card a {
    color: var(--blue);
    font-weight: 900;
}

.metric-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.metric-card {
    padding: 24px;
}
.metric-card svg {
    width: 30px;
    height: 30px;
    color: var(--orange);
}
.metric-card strong {
    display: block;
    color: var(--ink);
    font-size: 30px;
    margin-top: 14px;
}
.metric-card span {
    display: block;
    font-weight: 900;
    color: var(--text);
}
.metric-card p,
.service-card p,
.section-head p {
    color: var(--muted);
    line-height: 1.6;
}

.module-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}
.service-card {
    min-height: 230px;
    padding: 24px;
}
.service-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: var(--orange);
    background: #fff1ea;
    border-radius: 8px;
    margin-bottom: 18px;
}
.service-icon svg { width: 27px; height: 27px; }
.service-card a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-weight: 900;
}
.service-card a svg { width: 16px; height: 16px; }

.panel {
    padding: 28px;
    margin-bottom: 22px;
}
.list-head,
.tabs-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}
.list-head h2,
.tabs-panel h2 {
    margin: 0;
}
.list-head > div {
    display: flex;
    gap: 12px;
    align-items: center;
}
.row-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}
.row-head > a {
    color: var(--blue);
    font-weight: 900;
}
.section-head {
    margin-bottom: 18px;
}
.section-head h2 {
    margin: 12px 0 8px;
}
.form-grid,
.filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
}
.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    margin-bottom: 22px;
}
label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
}
input,
select,
textarea {
    height: 46px;
    border: 1px solid #cbd9eb;
    border-radius: 8px;
    padding: 0 14px;
    background: #f9fcff;
    color: #52627a;
}
textarea {
    min-height: 170px;
    padding: 14px;
    resize: vertical;
}
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
}
th {
    color: var(--ink);
    font-size: 13px;
    text-transform: uppercase;
}
td {
    color: #506078;
    font-weight: 650;
}
.empty {
    text-align: center;
    color: var(--muted);
    padding: 38px 12px;
}
.compact-list {
    padding: 0;
    overflow: hidden;
}
.compact-list .section-head {
    padding: 22px 24px 0;
}
.compact-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr .75fr .65fr;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    align-items: center;
}
.compact-row strong {
    color: var(--ink);
}
.compact-row span,
.compact-row em {
    color: var(--muted);
    font-style: normal;
}
.compact-row b {
    color: var(--green);
    font-size: 13px;
}
.compact-empty {
    padding: 30px 24px;
    color: var(--muted);
}
.resource-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.resource-card li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
}
.resource-card svg {
    width: 16px;
    height: 16px;
    color: var(--orange);
}
.wizard-panel .muted,
.muted {
    color: var(--muted);
    line-height: 1.65;
}
.choice-block,
.price-note {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fcff;
}
.choice-block strong,
.price-note strong {
    display: block;
    color: var(--ink);
    margin-bottom: 12px;
}
.choice-block div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.choice-block span,
.steps span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe7f4;
    color: #42546d;
    font-weight: 800;
}
.steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}
.steps span.active {
    color: var(--blue);
    background: #eaf3ff;
    border-color: #bdd8ff;
}
.wizard-panel .primary-btn,
.purge-layout .primary-btn,
.purge-layout .secondary-btn {
    margin-top: 20px;
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tabs a {
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #52627a;
    font-weight: 800;
}
.tabs a.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.empty-panel {
    min-height: 340px;
    display: grid;
    place-items: center;
    text-align: center;
    align-content: center;
}
.empty-panel > svg {
    width: 58px;
    height: 58px;
    color: var(--orange);
}
.empty-panel p {
    color: var(--muted);
}
.purge-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 28px;
}
.split-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px;
}
.split-panel article {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fcff;
}
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.chart-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.chart-card strong {
    color: var(--ink);
    font-size: 24px;
}
.fake-chart,
.fake-bars {
    height: 150px;
    margin-top: 16px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(18,103,242,.12), rgba(18,103,242,0)),
        repeating-linear-gradient(90deg, transparent 0 58px, rgba(10,36,88,.08) 58px 60px),
        linear-gradient(135deg, rgba(255,91,24,.35), rgba(18,103,242,.45));
}
.fake-chart.small { height: 120px; }
.fake-bars {
    background: repeating-linear-gradient(90deg, var(--blue) 0 28px, transparent 28px 48px);
    opacity: .75;
}
.support-card {
    min-height: 190px;
}
.support-card > svg {
    color: var(--orange);
}
.billing-layout {
    display: grid;
    grid-template-columns: minmax(320px, .75fr) minmax(0, 1.25fr);
    gap: 22px;
}
.price-form,
.setup-list {
    display: grid;
    gap: 14px;
}
.setup-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}
.setup-list span {
    color: var(--blue);
    font-weight: 900;
}
.code-block {
    margin: 20px 0 0;
    padding: 16px;
    background: #0b1f45;
    color: #eaf3ff;
    border-radius: 8px;
    overflow-x: auto;
}

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        padding: 16px;
    }
    .side-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .main { padding: 24px 18px 42px; }
    .overview-grid,
    .dashboard-columns,
    .purge-layout,
    .split-panel,
    .billing-layout {
        grid-template-columns: 1fr;
    }
    .metric-grid,
    .module-grid,
    .form-grid,
    .filter-row,
    .chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .side-nav { grid-template-columns: 1fr; }
    .topbar,
    .list-head,
    .row-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .list-head > div {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .global-search,
    .inline-search,
    .global-search input,
    .inline-search input {
        width: 100%;
    }
    .metric-grid,
    .module-grid,
    .overview-grid,
    .dashboard-columns,
    .form-grid,
    .filter-row,
    .chart-grid {
        grid-template-columns: 1fr;
    }
    .compact-row {
        grid-template-columns: 1fr;
    }
}
