:root {
    --green: #16a34a;
    --green-dark: #15803d;
    --green-light: #22c55e;
    --green-soft: #ecfdf5;
    --black: #0b0f0d;
    --black-soft: #161b18;
    --white: #ffffff;
    --gray-50: #f6f8f7;
    --gray-100: #eef1ef;
    --gray-200: #dfe4e1;
    --gray-400: #9aa5a0;
    --gray-600: #5b6661;
    --gray-900: #1f2925;
    --red: #dc2626;
    --amber: #d97706;
    --blue: #2563eb;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(11, 15, 13, .08);
    --shadow-lg: 0 20px 50px rgba(11, 15, 13, .14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 15px;
    line-height: 1.55;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }

h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8rem; }

/* ---------------- Layout ---------------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--black);
    color: #cfd6d2;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--white); font-weight: 800; font-size: 1.15rem;
    padding: 6px 10px 18px; letter-spacing: .3px;
}
.sidebar .brand span.logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--green); color: var(--white); font-weight: 800;
}
.sidebar .nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: #6d7a74; padding: 14px 10px 6px;
}
.sidebar a.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 9px; color: #cfd6d2; font-size: .92rem;
}
.sidebar a.nav-link:hover { background: var(--black-soft); color: var(--white); }
.sidebar a.nav-link.active { background: var(--green); color: var(--white); font-weight: 600; }
.sidebar .spacer { flex: 1 1 auto; }

.main-area { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar .topbar-right { display: flex; align-items: center; gap: 12px; }

.page { padding: 24px; flex: 1 1 auto; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-header {
    padding: 16px 18px; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--gray-100); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------------- Stat cards ---------------- */
.stat {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px;
}
.stat .stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-600); }
.stat .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat .stat-hint { font-size: .8rem; color: var(--gray-400); }
.stat.accent { background: linear-gradient(135deg, var(--black) 0%, #16321f 100%); color: var(--white); border-color: transparent; }
.stat.accent .stat-label, .stat.accent .stat-hint { color: #a7b3ad; }
.stat.green { background: var(--green); color: var(--white); border-color: transparent; }
.stat.green .stat-label, .stat.green .stat-hint { color: rgba(255,255,255,.8); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
    font-size: .92rem; font-weight: 600; cursor: pointer;
    background: var(--green); color: var(--white); transition: .15s ease;
}
.btn:hover { background: var(--green-dark); color: var(--white); }
.btn-black { background: var(--black); }
.btn-black:hover { background: var(--black-soft); }
.btn-outline { background: transparent; border-color: var(--gray-200); color: var(--gray-900); }
.btn-outline:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--green-soft); color: var(--black); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: var(--white); border-color: rgba(255,255,255,.2); }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); color: var(--white); }
.btn-danger { background: var(--red); }
.btn-danger:hover { filter: brightness(.92); color: var(--white); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Forms ---------------- */
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 5px; color: var(--gray-900); }
.input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200);
    border-radius: 9px; background: var(--white); font-size: .92rem; font-family: inherit; color: var(--gray-900);
}
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(22,163,74,.25); border-color: var(--green); }
textarea { min-height: 90px; resize: vertical; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: 16px; height: 16px; }
.form-check label { margin: 0; font-weight: 500; }
.help { font-size: .78rem; color: var(--gray-600); margin-top: 4px; }
.inline-form { display: inline; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.table th {
    text-align: left; padding: 11px 14px; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); font-size: .76rem;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); white-space: nowrap;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.table tbody tr:hover { background: var(--green-soft); }
table.table .right, th.right { text-align: right; }
.empty { padding: 32px 16px; text-align: center; color: var(--gray-400); }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; letter-spacing: .03em;
}
.badge-success { background: rgba(22,163,74,.12); color: var(--green-dark); }
.badge-warning { background: rgba(217,119,6,.13); color: var(--amber); }
.badge-danger { background: rgba(220,38,38,.12); color: var(--red); }
.badge-info { background: rgba(37,99,235,.12); color: var(--blue); }
.badge-dark { background: var(--black); color: var(--white); }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 12px 15px; border-radius: 10px; margin-bottom: 18px;
    border: 1px solid transparent; font-size: .9rem;
}
.alert-success { background: var(--green-soft); border-color: rgba(22,163,74,.3); color: var(--green-dark); }
.alert-error { background: #fef2f2; border-color: rgba(220,38,38,.25); color: var(--red); }
.alert-info { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-900); }

/* ---------------- Progress ---------------- */
.progress { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

/* ---------------- Public site ---------------- */
.public-body { background: var(--white); }
.site-header {
    background: var(--black); color: var(--white);
    padding: 16px 0; position: sticky; top: 0; z-index: 30;
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: #c7d0cb; font-size: .93rem; font-weight: 500; }
.site-nav a:hover { color: var(--green-light); }
.brand-light { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; font-size: 1.2rem; }
.brand-light span.logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--green); color: var(--white);
}

.hero {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(34,197,94,.25), transparent 60%),
        linear-gradient(160deg, var(--black) 0%, #0d1a12 100%);
    color: var(--white);
    padding: 80px 0 90px;
}
.hero h1 { font-size: 2.9rem; letter-spacing: -.02em; max-width: 15ch; }
.hero h1 span { color: var(--green-light); }
.hero p.lead { font-size: 1.05rem; color: #b6c1bb; max-width: 60ch; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.ticker { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.ticker .tick {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 12px 16px; min-width: 150px;
}
.ticker .tick b { display: block; font-size: 1.25rem; color: var(--green-light); }
.ticker .tick span { font-size: .78rem; color: #97a39d; text-transform: uppercase; letter-spacing: .08em; }

.section { padding: 64px 0; }
.section.alt { background: var(--gray-50); }
.section.dark { background: var(--black); color: var(--white); }
.section-head { max-width: 62ch; margin-bottom: 34px; }
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--gray-600); }
.section.dark .section-head p { color: #a7b3ad; }

.feature { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .icon {
    width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
    background: var(--green-soft); color: var(--green-dark); font-weight: 800; margin-bottom: 12px;
}
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--gray-600); font-size: .92rem; margin: 0; }

.price-card {
    background: var(--white); border: 2px solid var(--gray-200); border-radius: 16px;
    padding: 24px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.price-card.featured { border-color: var(--green); box-shadow: var(--shadow-lg); }
.price-card .tag {
    position: absolute; top: -12px; right: 18px; background: var(--green); color: var(--white);
    font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; letter-spacing: .06em;
}
.price-card .amount { font-size: 2.2rem; font-weight: 800; }
.price-card ul { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; font-size: .92rem; }
.price-card ul li::before { content: "\2713"; color: var(--green); font-weight: 800; margin-right: 8px; }

.cta-band { background: var(--green); color: var(--white); padding: 54px 0; text-align: center; }
.cta-band h2 { font-size: 1.9rem; }
.cta-band p { color: rgba(255,255,255,.9); }

.site-footer { background: var(--black); color: #93a09a; padding: 40px 0; font-size: .88rem; }
.site-footer .cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: #c7d0cb; }
.site-footer a:hover { color: var(--green-light); }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--black) 0%, #0d1a12 100%); color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { font-size: 1.9rem; }
.auth-side p { color: #a7b3ad; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--gray-50); }
.auth-card { width: 100%; max-width: 430px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .sub { color: var(--gray-600); font-size: .9rem; margin-bottom: 18px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-weight: 700; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------------- Misc ---------------- */
.muted { color: var(--gray-600); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.text-green { color: var(--green-dark); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.code-box {
    background: var(--black); color: var(--green-light); padding: 16px; border-radius: 10px;
    font-size: 1.4rem; font-weight: 800; letter-spacing: .18em; text-align: center;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; font-weight: 600; font-size: .9rem; color: var(--gray-600); }
.tabs a.active { color: var(--green-dark); border-bottom-color: var(--green); }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; flex-wrap: wrap; }
.pagination li span, .pagination li a {
    display: block; padding: 7px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
    background: var(--white); font-size: .85rem;
}
.pagination li.active span { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 700; }
.rank-card { border-left: 4px solid var(--gray-200); }
.rank-card.held { border-left-color: var(--green); }
.rank-level { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-600); }
.badge-light { background: var(--gray-100); color: var(--gray-600); }
.badge-green { background: var(--green); color: var(--white); }
table.table-sm td, table.table-sm th { padding: 7px 10px; font-size: .82rem; }
.wallet-tile { display: flex; flex-direction: column; gap: 2px; }
.wallet-tile .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); }
.wallet-tile .value { font-size: 1.3rem; font-weight: 800; }
.member-row { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft);
    color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: .82rem;
}
@media (max-width: 1024px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; overflow-x: auto; }
    .sidebar .nav-label { display: none; }
    .sidebar .spacer { display: none; }
    .sidebar .brand { padding-bottom: 6px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}