:root {
    --bg: #f5f7f6;
    --panel: #ffffff;
    --ink: #17211f;
    --muted: #65716e;
    --line: #dfe6e3;
    --green: #0f8f6f;
    --green-dark: #07644e;
    --blue: #1d5fd1;
    --gold: #b7791f;
    --red: #bd2f2f;
    --shadow: 0 18px 50px rgba(23, 33, 31, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

button,
input,
textarea {
    font: inherit;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    letter-spacing: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
}

.topnav,
.button-row,
.download-row,
.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topnav a {
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.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(--ink);
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(23, 33, 31, .08);
}

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

.btn.secondary {
    border-color: #b8c6c1;
    background: #eef4f2;
    color: var(--green-dark);
}

.btn.ghost {
    background: transparent;
}

.btn.small {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 13px;
}

.btn.tiny {
    min-height: 30px;
    padding-inline: 10px;
    font-size: 12px;
}

.btn.wide {
    width: 100%;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 128px);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 72px) 0;
}

.hero-copy h1,
.auth-panel h1,
.price-card h1,
.page-head h1 {
    margin: 0;
    line-height: 1.04;
    letter-spacing: 0;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(36px, 6vw, 72px);
}

.hero-copy p {
    max-width: 680px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.dashboard-preview,
.auth-panel,
.price-card,
.install-panel,
.panel,
.premium-pop {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-preview {
    padding: 22px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.preview-header span {
    color: var(--muted);
    font-weight: 800;
}

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

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 18px;
}

.metric-grid.mini {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

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

.metric strong {
    display: block;
    margin-top: 12px;
    font-size: 28px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.metric.green {
    border-color: rgba(15, 143, 111, .25);
    background: #edf8f4;
}

.metric.blue {
    border-color: rgba(29, 95, 209, .22);
    background: #eef4ff;
}

.metric.gold {
    border-color: rgba(183, 121, 31, .26);
    background: #fff8e9;
}

.metric.ink {
    border-color: rgba(23, 33, 31, .24);
    background: #f2f5f4;
}

.download-row {
    margin-top: 18px;
}

.download-row a {
    flex: 1;
    min-width: 104px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    font-weight: 800;
}

.auth-shell,
.pricing-shell,
.install-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 128px);
    padding: 28px 16px;
}

.auth-panel,
.price-card,
.install-panel {
    width: min(100%, 480px);
    padding: 28px;
}

.install-panel {
    width: min(100%, 760px);
}

.price-card {
    width: min(100%, 560px);
}

.price {
    margin: 22px 0;
    color: var(--ink);
    font-size: 54px;
    font-weight: 900;
}

.price span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
}

.feature-list {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
    color: var(--muted);
    white-space: pre-wrap;
}

.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

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

input,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cdd8d4;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

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

input:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 143, 111, .14);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

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

.span-two {
    grid-column: 1 / -1;
}

.check-row {
    display: flex;
    align-items: center;
    min-height: 44px;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 22px;
    width: min(1360px, calc(100% - 32px));
    margin: 22px auto 48px;
}

.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.sidebar a {
    padding: 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.sidebar a:hover {
    background: #eef4f2;
    color: var(--green-dark);
}

.admin-sidebar a:hover {
    background: #eef4ff;
    color: var(--blue);
}

.profile-chip {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
}

.profile-chip span {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.content-panel {
    min-width: 0;
}

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

.page-head h1 {
    font-size: clamp(28px, 4vw, 42px);
}

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

.panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 18px;
}

.accent-panel {
    background: #17211f;
    color: #fff;
}

.accent-panel p {
    color: rgba(255, 255, 255, .76);
}

.status-word {
    font-size: 30px;
    font-weight: 900;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(15, 143, 111, .22);
    border-radius: 999px;
    background: #edf8f4;
    color: var(--green-dark);
    font-size: 13px;
}

.premium-pop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px;
    border-color: rgba(183, 121, 31, .35);
    background: #fff8e9;
}

.premium-pop h2,
.premium-pop p {
    margin: 0;
}

.premium-pop p {
    color: var(--muted);
}

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

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

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

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

td span {
    color: var(--muted);
    font-size: 12px;
}

.table-actions input {
    width: 70px;
    min-height: 30px;
    padding: 4px 8px;
}

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

.clean-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.clean-list span,
.muted-line {
    color: var(--muted);
}

.notice,
.toast {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 800;
}

.toast {
    width: min(980px, calc(100% - 32px));
    margin: 14px auto 0;
}

.success {
    border-color: rgba(15, 143, 111, .28);
    background: #edf8f4;
    color: var(--green-dark);
}

.danger {
    border-color: rgba(189, 47, 47, .26);
    background: #fff0f0;
    color: var(--red);
}

.warning {
    border-color: rgba(183, 121, 31, .26);
    background: #fff8e9;
    color: #8a5a12;
}

.referral-panel input[readonly] {
    background: #f7faf9;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 24px 16px 38px;
    color: var(--muted);
    font-size: 13px;
}

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

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

    .profile-chip {
        grid-column: 1 / -1;
    }

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

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

    .topnav {
        width: 100%;
    }

    .topnav a,
    .topnav .btn {
        flex: 1;
        justify-content: center;
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .dashboard-preview,
    .auth-panel,
    .price-card,
    .install-panel,
    .panel {
        padding: 16px;
    }

    .preview-grid,
    .metric-grid,
    .metric-grid.mini,
    .form-grid.two,
    .sidebar {
        grid-template-columns: 1fr;
    }

    .page-head,
    .premium-pop {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .price {
        font-size: 42px;
    }
}
