:root {
    --bg: #eef2f6;
    --bg-deep: #101827;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --text: #172033;
    --muted: #667085;
    --line: #d9e1ea;
    --brand: #1b5fc1;
    --brand-dark: #13488f;
    --brand-soft: #e8f1ff;
    --ok: #16794c;
    --warning: #a15c07;
    --danger: #b42318;
    --radius: 8px;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.1);
    --shadow-strong: 0 24px 70px rgba(16, 24, 39, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 242, 246, 0.94)),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(16px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.app-topbar div,
.app-topbar nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-topbar strong {
    font-size: 16px;
}

.app-topbar span,
.eyebrow,
.module-card p,
.next-step p,
.feature-list {
    color: var(--muted);
}

.app-topbar nav a {
    padding: 8px 10px;
    border-radius: 6px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

.app-topbar nav a:hover {
    background: var(--surface-soft);
    color: var(--brand-dark);
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 28px;
    align-items: stretch;
    padding: 54px 0 34px;
}

.hero-copy {
    padding: clamp(24px, 5vw, 48px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p,
ul {
    margin-top: 0;
}

h1 {
    max-width: 840px;
    margin-bottom: 18px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 0;
    font-size: 18px;
}

.hero-copy > p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
}

.hero-panel {
    display: grid;
    gap: 12px;
}

.hero-panel div,
.module-card,
.next-step,
.admin-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.hero-panel div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 88px;
    padding: 18px;
}

.hero-panel span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.hero-panel strong {
    font-size: 20px;
}

.section {
    padding: 28px 0 36px;
}

.section-heading {
    margin-bottom: 18px;
}

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

.module-card {
    min-height: 172px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.05);
}

.module-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.module-card__head span {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8f3ee;
    color: var(--ok);
    font-size: 12px;
    font-weight: 800;
}

.module-card p {
    margin-bottom: 0;
}

.next-step {
    margin-bottom: 42px;
    padding: clamp(22px, 4vw, 34px);
    border-left: 5px solid var(--brand);
    box-shadow: var(--shadow);
}

.next-step p:last-child {
    margin-bottom: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 800;
}

.button-primary {
    background: var(--brand);
    color: #ffffff;
}

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

.button-secondary {
    background: var(--surface);
    border-color: var(--line);
    color: #344054;
}

.button-secondary:hover {
    background: var(--surface-soft);
    color: var(--brand-dark);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 42px);
    background:
        radial-gradient(circle at 18% 18%, rgba(27, 95, 193, 0.2), transparent 34%),
        linear-gradient(135deg, #101827 0%, #172033 48%, #edf2f7 48.2%, #f7f9fc 100%);
}

.auth-shell {
    width: min(980px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    align-items: stretch;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding: clamp(28px, 5vw, 48px);
    background:
        linear-gradient(180deg, rgba(16, 24, 39, 0.18), rgba(16, 24, 39, 0.88)),
        #172033;
    color: #ffffff;
}

.auth-brand .eyebrow {
    color: #b9c6d8;
}

.auth-brand h1 {
    max-width: 520px;
    margin-bottom: 16px;
    font-size: clamp(38px, 6vw, 62px);
}

.auth-brand p {
    max-width: 520px;
    margin-bottom: 26px;
    color: #d7deea;
    font-size: 17px;
}

.auth-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-highlights span {
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #edf2f7;
    font-size: 13px;
    font-weight: 800;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 5vw, 44px);
    background: rgba(255, 255, 255, 0.98);
}

.auth-card h2 {
    margin-bottom: 10px;
    font-size: clamp(28px, 4vw, 40px);
}

.auth-card > p:not(.eyebrow) {
    margin-bottom: 24px;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 15px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(16, 24, 39, 0.02);
}

.auth-form input:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(27, 95, 193, 0.16);
}

.auth-form button {
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.auth-form button:hover {
    background: var(--brand-dark);
}

.alert {
    margin-bottom: 16px;
    padding: 11px 12px;
    border-radius: 6px;
    font-weight: 800;
}

.alert-danger {
    background: var(--danger);
    color: #ffffff;
}

.alert-success {
    background: #0f7a4f;
    color: #ffffff;
}

.admin-main {
    padding-bottom: 36px;
}

.page-head,
.dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 42px 0 20px;
}

.page-head h1,
.dashboard-head h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 6vw, 56px);
}

.page-head p:last-child,
.dashboard-head p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--muted);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 12px 0 28px;
}

.stat-card {
    min-height: 142px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.05);
}

.stat-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1;
}

.stat-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 14px;
}

.admin-panel {
    padding: clamp(20px, 3vw, 28px);
    box-shadow: var(--shadow);
}

.admin-panel-accent {
    background: var(--brand-soft);
    border-color: #bed7ff;
}

.feature-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 20px;
}

.feature-list li::before {
    content: "";
    position: absolute;
    top: 0.7em;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--brand);
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 14px;
    align-items: start;
    padding: 12px 0 28px;
}

.data-form {
    display: grid;
    gap: 15px;
    margin-top: 18px;
}

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

.data-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 14px;
    font-weight: 800;
}

.data-form input,
.data-form select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
}

.data-form input:focus,
.data-form select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(27, 95, 193, 0.16);
}

.data-form button {
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.data-form button:hover {
    background: var(--brand-dark);
}

.form-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--line);
}

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

.form-actions button,
.form-actions .button {
    min-width: 160px;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.data-table-actions {
    min-width: 1120px;
}

.data-table th,
.data-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: var(--surface-soft);
    color: #475467;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.data-table td {
    color: #344054;
    font-size: 14px;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table td strong,
.data-table td span {
    display: block;
}

.data-table td strong {
    color: var(--text);
    font-size: 15px;
}

.data-table td span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-active {
    background: #e8f3ee;
    color: var(--ok);
}

.status-suspended {
    background: #fff4e5;
    color: var(--warning);
}

.status-inactive {
    background: #eef2f6;
    color: #475467;
}

.status-payment_blocked {
    background: var(--danger);
    color: #ffffff;
}

.table-link {
    color: var(--brand-dark);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 260px;
}

.row-actions form {
    margin: 0;
}

.button-small,
.row-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
}

.button-muted {
    background: var(--surface);
    border-color: var(--line);
    color: #344054;
}

.button-muted:hover {
    background: var(--surface-soft);
}

.button-warning {
    background: #fff4e5;
    border-color: #ffd69a;
    color: #8a4b00;
}

.button-warning:hover {
    background: #ffe8c2;
}

.button-danger {
    background: var(--danger);
    color: #ffffff;
}

.button-danger:hover {
    background: #8f1d14;
}

@media (max-width: 900px) {
    .auth-page {
        place-items: stretch;
        background: #f7f9fc;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-brand {
        min-height: 260px;
    }

    .dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .app-topbar,
    .app-topbar div,
    .app-topbar nav {
        align-items: flex-start;
    }

    .app-topbar {
        flex-direction: column;
        gap: 10px;
    }

    .app-topbar div,
    .app-topbar nav {
        width: 100%;
        overflow-x: auto;
    }

    .hero,
    .admin-grid,
    .form-layout {
        grid-template-columns: 1fr;
        padding-top: 24px;
    }

    .hero-copy {
        padding: 22px;
    }

    .module-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    h1 {
        font-size: 36px;
    }
}

@media (max-width: 520px) {
    main {
        width: min(100% - 24px, 1180px);
    }

    .auth-page {
        padding: 12px;
    }

    .auth-brand,
    .auth-card {
        padding: 24px;
    }

    .auth-brand h1 {
        font-size: 34px;
    }

    .button {
        width: 100%;
    }
}
