:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #16202a;
    --muted: #607080;
    --line: #dce4ee;
    --primary: #1666d8;
    --primary-dark: #0d4ea8;
    --ok: #168a4a;
    --warn: #b66a00;
    --bad: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
.ghost-link {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.ghost-link:hover {
    background: var(--primary-dark);
}

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.hero,
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2 {
    margin: 0;
    line-height: 1.15;
}

h1 {
    font-size: clamp(28px, 5vw, 48px);
}

h2 {
    font-size: 20px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 8px;
}

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

.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.plan-card,
.panel,
.auth-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(22, 32, 42, 0.08);
}

.plan-card {
    min-height: 360px;
    padding: 22px;
    display: grid;
    gap: 16px;
}

.plan-price {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
}

.stack {
    display: grid;
    gap: 10px;
}

.auth-box {
    width: min(420px, 100%);
    margin: 8vh auto 0;
    padding: 26px;
}

.client-cabinet {
    width: min(560px, 100%);
}

.client-facts {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.client-facts div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.client-facts span {
    color: var(--muted);
}

.download-button {
    width: 100%;
    min-height: 46px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.download-button:hover {
    background: var(--primary-dark);
}

.alert {
    border: 1px solid #c6dbff;
    background: #eaf3ff;
    color: #113f7b;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert.danger {
    border-color: #ffc9c9;
    background: #fff0f0;
    color: var(--bad);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.stats-grid > div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.stats-grid b {
    display: block;
    font-size: 30px;
}

.stats-grid span {
    color: var(--muted);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.panel {
    padding: 18px;
    margin-bottom: 14px;
}

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

.grid-form .wide {
    grid-column: 1 / -1;
}

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

.check input {
    width: auto;
    min-height: auto;
}

.table-wrap {
    overflow-x: auto;
}

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

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

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

td input {
    min-width: 90px;
}

.actions {
    white-space: nowrap;
}

.actions form {
    display: inline-block;
}

.copy-field {
    width: 260px;
    margin: 0 6px 6px 0;
    font-size: 12px;
}

.mini-link {
    min-height: 38px;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--primary);
    background: #fff;
    padding: 9px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.mini-link:hover {
    border-color: var(--primary);
}

.status {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    background: #eef2f7;
}

.status.paid,
.status.active {
    background: #e9f8ef;
    color: var(--ok);
}

.status.pending {
    background: #fff5df;
    color: var(--warn);
}

.status.disabled,
.status.cancelled {
    background: #fff0f0;
    color: var(--bad);
}

@media (max-width: 720px) {
    .hero,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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