: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;
    overflow-wrap: anywhere;
}

.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);
}


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

.openvpn-admin-page {
    max-width: 1180px;
    margin: 0 auto;
}

.openvpn-admin-header {
    margin-bottom: 14px;
}

.openvpn-admin-header h1 {
    font-size: 24px;
}

.openvpn-create-panel,
.openvpn-clients-panel {
    padding: 12px;
}

.openvpn-create-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1fr) 86px auto;
    gap: 8px;
    align-items: end;
}

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

.openvpn-clients-table {
    min-width: 980px;
    font-size: 13px;
}

.openvpn-clients-table th,
.openvpn-clients-table td {
    padding: 8px 7px;
}

.openvpn-clients-table td > strong,
.openvpn-clients-table td > small {
    display: block;
}

.openvpn-clients-table td > small {
    color: var(--muted);
    font-size: 11px;
}

.openvpn-actions {
    display: grid;
    grid-template-columns: auto minmax(245px, 1fr) auto auto;
    gap: 4px;
    align-items: center;
}

.openvpn-actions form {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr) auto;
    gap: 4px;
    margin: 0;
}

.openvpn-actions button,
.action-button {
    min-height: 34px;
    border-radius: 5px;
    background: #111827;
    color: #fff;
    padding: 7px 10px;
    border: 0;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.openvpn-actions input {
    min-height: 34px;
    min-width: 0;
    padding: 6px 7px;
}

.openvpn-actions .days-input {
    width: 54px;
}

.openvpn-actions .danger-button {
    background: #b4232d;
}

.openvpn-support {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

@media (max-width: 720px) {
    .openvpn-create-form {
        grid-template-columns: 1fr 1fr;
    }

    .openvpn-create-form label:nth-of-type(1),
    .openvpn-create-form label:nth-of-type(2) {
        grid-column: span 1;
    }

    .openvpn-create-form button {
        align-self: end;
    }

    .openvpn-table-wrap {
        overflow: visible;
    }

    .openvpn-clients-table {
        display: block;
        min-width: 0;
    }

    .openvpn-clients-table thead {
        display: none;
    }

    .openvpn-clients-table tbody {
        display: grid;
        gap: 8px;
    }

    .openvpn-clients-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 4px 10px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 9px;
    }

    .openvpn-clients-table td {
        display: block;
        border: 0;
        padding: 2px;
    }

    .openvpn-actions {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .openvpn-actions form {
        display: flex;
        gap: 4px;
    }

    .openvpn-actions form:first-of-type {
        flex: 1 1 230px;
    }

    .openvpn-actions form:first-of-type input:not([type="hidden"]) {
        flex: 1 1 auto;
        width: auto;
    }

    .hero,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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