/* ============================================================
   Jinxed Platform -- Dark Gaming UI
   Brand: #0f0f1a bg, #1a1a2e cards, #2d2d4a border,
          #7c3aed purple, #06b6d4 teal,
          #e2e8f0 text, #94a3b8 muted
   ============================================================ */

/* --- Reset / Normalize --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:          #0f0f1a;
    --bg-elevated: #141425;
    --surface:     #1a1a2e;
    --surface-2:   #222240;
    --border:      #2d2d4a;
    --border-light:#3d3d5c;
    --purple:      #7c3aed;
    --purple-hover:#8b5cf6;
    --purple-dim:  rgba(124, 58, 237, .15);
    --teal:        #06b6d4;
    --teal-hover:  #22d3ee;
    --teal-dim:    rgba(6, 182, 212, .12);
    --text:        #e2e8f0;
    --text-dim:    #94a3b8;
    --text-dark:   #64748b;
    --danger:      #ef4444;
    --danger-dim:  rgba(239, 68, 68, .12);
    --success:     #22c55e;
    --success-dim: rgba(34, 197, 94, .12);
    --warning:     #f59e0b;
    --warning-dim: rgba(245, 158, 11, .12);
    --radius:      8px;
    --radius-lg:   8px;
    --radius-sm:   4px;
    --transition:  .2s ease;
    --font:        'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow:      0 2px 12px rgba(0,0,0,.2);
    --shadow-sm:   0 1px 4px rgba(0,0,0,.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--purple); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--purple-hover); }

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p  { color: var(--text-dim); }

.gradient-text {
    background: linear-gradient(135deg, var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: .5rem;
}

.section-heading {
    font-size: 2rem;
    margin-bottom: .75rem;
}

.section-sub {
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    font-size: 1.05rem;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section { padding: 2.5rem 0; }
.section--sm { padding: 1.5rem 0; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1.5rem;
    background: rgba(15, 15, 26, .85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.navbar .logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

.nav-links a.btn { color: #fff; }

.nav-user {
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    padding: .25rem .5rem;
    border-radius: var(--radius-sm);
    background: var(--purple-dim);
    white-space: nowrap;
}

.nav-logout-btn {
    font-size: .8rem;
    color: var(--text-dim);
    cursor: pointer;
    border: none;
    background: none;
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: var(--font);
    font-weight: 500;
}

.nav-logout-btn:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: .25rem;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 1rem 2rem;
        gap: .75rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: .5rem 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .5rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    background: var(--purple);
    color: #fff;
    white-space: nowrap;
}

.btn:hover {
    background: var(--purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, .35);
    color: #fff;
}

.btn:active { transform: translateY(0); }

.btn--teal { background: var(--teal); }
.btn--teal:hover { background: var(--teal-hover); box-shadow: 0 4px 16px rgba(6,182,212,.35); }

.btn--outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text);
}
.btn--outline:hover {
    background: var(--surface-2);
    border-color: var(--purple);
    color: var(--text);
    box-shadow: none;
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--text-dim);
    padding: .35rem .75rem;
}
.btn--ghost:hover { color: var(--text); background: var(--surface-2); box-shadow: none; }

.btn--sm { padding: .3rem .7rem; font-size: .78rem; }
.btn--lg { padding: .6rem 1.5rem; font-size: .95rem; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #dc2626; box-shadow: 0 4px 16px rgba(239,68,68,.35); }

.btn--success { background: var(--success); }
.btn--success:hover { background: #16a34a; box-shadow: 0 4px 16px rgba(34,197,94,.35); }

.btn--full { width: 100%; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-group--center { justify-content: center; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 65%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    position: relative;
}

.hero .hero-sub {
    font-size: 1.05rem;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
}

.hero .hero-note {
    color: var(--text-dark);
    font-size: .8rem;
    margin-top: 1rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    transition: all .25s ease;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.card--glow:hover {
    border-color: var(--purple);
    box-shadow: 0 0 16px rgba(124,58,237,.06);
}

.card h3 { margin-bottom: .5rem; }
.card p { font-size: .925rem; }

/* Feature cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple), var(--teal));
    opacity: 0;
    transition: opacity .3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.feature-card:hover::before { opacity: 1; }

.feature-card .feature-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .6rem;
    background: var(--purple-dim);
    color: var(--purple);
}

.feature-card .feature-icon--teal {
    background: var(--teal-dim);
    color: var(--teal);
}

.feature-card h3 { margin-bottom: .5rem; }
.feature-card p { font-size: .875rem; color: var(--text-dim); line-height: 1.5; }

.feature-card ul {
    list-style: none;
    margin-top: .75rem;
    padding: 0;
}

.feature-card ul li {
    padding: .3rem 0;
    font-size: .85rem;
    color: var(--text-dim);
    padding-left: 1.25rem;
    position: relative;
}

.feature-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

/* ============================================================
   PRICING
   ============================================================ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.plan {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: all .3s ease;
    position: relative;
}

.plan:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.plan.featured {
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(124,58,237,.08);
}

.plan.featured::before {
    content: 'Popular';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--purple);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .25rem .75rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.plan h2 { margin-bottom: .25rem; font-size: 1.25rem; }

.plan .plan-desc {
    color: var(--text-dim);
    font-size: .85rem;
    margin-bottom: 1rem;
}

.plan .price {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .15rem;
}

.plan .price span {
    font-size: .9rem;
    font-weight: 400;
    color: var(--text-dim);
}

.plan .price--purple { color: var(--purple); }
.plan .price--teal { color: var(--teal); }

.plan ul {
    list-style: none;
    margin: .75rem 0;
    text-align: left;
}

.plan ul li {
    padding: .3rem 0;
    color: var(--text-dim);
    font-size: .875rem;
    padding-left: 1.5rem;
    position: relative;
}

.plan ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.plan ul li.disabled {
    color: var(--text-dark);
    text-decoration: line-through;
}

.plan ul li.disabled::before {
    content: '\2717';
    color: var(--text-dark);
}

/* Bundle table */
.bundle-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.bundle-table th,
.bundle-table td {
    padding: .55rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}

.bundle-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bundle-table tr:hover td {
    background: var(--surface);
}

.bundle-table .bundle-price {
    color: var(--teal);
    font-weight: 700;
}

/* ============================================================
   HOW-IT-WORKS Steps
   ============================================================ */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    counter-increment: step;
}

.step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple-dim);
    color: var(--purple);
    font-weight: 800;
    font-size: .9rem;
    margin-bottom: .6rem;
}

.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step p { font-size: .875rem; color: var(--text-dim); }

/* ============================================================
   PROBLEM SECTION
   ============================================================ */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.problem-card {
    padding: 1rem;
    border-left: 3px solid var(--danger);
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.problem-card h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--text); }
.problem-card p { font-size: .875rem; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: .75rem 0;
}

.faq-q {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0;
}

.faq-q::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-dim);
    transition: transform .2s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-q::after {
    content: '\2212';
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
}

.faq-item.open .faq-a {
    max-height: 300px;
    padding-top: .75rem;
}

.faq-a p { font-size: .875rem; color: var(--text-dim); line-height: 1.5; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.testimonial {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
}

.testimonial blockquote {
    font-size: .875rem;
    color: var(--text-dim);
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial cite {
    font-style: normal;
    font-size: .8rem;
    color: var(--text-dark);
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.cta-section {
    text-align: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,.08) 0%, transparent 65%);
    pointer-events: none;
}

.cta-section h2 { font-size: 1.75rem; margin-bottom: .5rem; position: relative; }
.cta-section p { margin-bottom: 1.25rem; position: relative; }

/* ============================================================
   AUTH FORMS
   ============================================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.auth-form {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
}

.auth-card .auth-sub {
    color: var(--text-dim);
    font-size: .875rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: .85rem;
}

.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .5rem .7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input::placeholder { color: var(--text-dark); }

.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-group { flex: 1; }

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
}

.form-check label {
    font-size: .85rem;
    color: var(--text-dim);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--text-dim);
}

.auth-footer a { color: var(--purple); font-weight: 500; }

.form-error {
    color: var(--danger);
    font-size: .8rem;
    margin-top: .25rem;
    display: none;
}

.form-group.has-error input { border-color: var(--danger); }
.form-group.has-error .form-error { display: block; }
.form-check.has-error { color: var(--danger); }
.form-check.has-error label { color: var(--danger); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}

.stat-label {
    font-size: .8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: .25rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    color: var(--text-dim);
    word-break: break-all;
}

.api-key-display .copy-btn {
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: .3rem .6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .75rem;
    font-family: var(--font);
    transition: all var(--transition);
}

.api-key-display .copy-btn:hover {
    color: var(--text);
    border-color: var(--purple);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-dim); }
.info-value { color: var(--text); font-weight: 600; }

/* ============================================================
   TABLES (shared)
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: .5rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    white-space: nowrap;
}

th {
    background: var(--surface);
    color: var(--text-dim);
    font-weight: 600;
    font-size: .75rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .45rem;
    border-radius: 100px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.badge--purple { background: var(--purple-dim); color: var(--purple); }
.badge--teal   { background: var(--teal-dim);   color: var(--teal); }
.badge--success{ background: var(--success-dim); color: var(--success); }
.badge--danger { background: var(--danger-dim);  color: var(--danger); }
.badge--warning{ background: var(--warning-dim); color: var(--warning); }
.badge--neutral{ background: rgba(148,163,184,.1); color: var(--text-dim); }
.badge--info   { background: var(--teal-dim);   color: var(--teal); }

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.legal h1 {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.legal .legal-updated {
    color: var(--text-dark);
    font-size: .85rem;
    margin-bottom: 2rem;
}

.legal h2 {
    font-size: 1.3rem;
    margin-top: 2.5rem;
    margin-bottom: .75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.legal h2:first-of-type { border-top: none; padding-top: 0; }

.legal h3 {
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}

.legal p {
    margin-bottom: 1rem;
    font-size: .925rem;
    line-height: 1.75;
}

.legal ul, .legal ol {
    margin: .75rem 0 1rem 1.5rem;
    color: var(--text-dim);
}

.legal li {
    padding: .25rem 0;
    font-size: .9rem;
    line-height: 1.7;
}

.legal strong { color: var(--text); }

.legal table {
    margin: 1rem 0;
    font-size: .85rem;
}

.legal table th {
    background: var(--surface);
}

.legal a { color: var(--teal); }
.legal a:hover { color: var(--teal-hover); }

.legal hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
body.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 230px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

.sidebar .sidebar-logo {
    padding: 0 1rem .5rem;
    font-size: 1.05rem;
    font-weight: 800;
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
    margin-bottom: .25rem;
}

.sidebar-nav {
    list-style: none;
    padding: .5rem 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    color: var(--text);
    background: var(--bg);
    border-left-color: var(--border-light);
}

.sidebar-nav li a.active {
    color: var(--purple);
    background: var(--purple-dim);
    border-left-color: var(--purple);
}

.sidebar-nav li a .nav-icon {
    font-size: .9rem;
    width: 18px;
    text-align: center;
}

.sidebar-category {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 10px 1rem 3px;
    margin-top: 6px;
    user-select: none;
}

.sidebar-category:first-child {
    margin-top: 0;
}

.sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-dark);
}

.admin-main {
    flex: 1;
    margin-left: 230px;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1.25rem;
    background: rgba(15, 15, 26, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 800;
}

.admin-topbar h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-topbar .admin-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    color: var(--text-dim);
}

.admin-content {
    padding: 1.25rem;
}

/* Stats grid for admin dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem;
    transition: all .25s ease;
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-card .stat-icon {
    font-size: 1.1rem;
    margin-bottom: .25rem;
}

.stat-card h4 {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
}

.stat-card .stat-change {
    font-size: .75rem;
    margin-top: .25rem;
}

.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* Admin search bar */
.search-bar {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: .6rem .875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .875rem;
    font-family: var(--font);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.pagination a:hover {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.pagination .active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}

/* Admin page heading area */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

.page-header h2 { font-size: 1.2rem; margin: 0; }

/* Two-column admin layout */
.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .admin-two-col { grid-template-columns: 1fr; }
}

/* Admin form cards */
.admin-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.admin-form-card h3 {
    margin-bottom: .85rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

/* Date range selector */
.date-range {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.date-range input[type="date"] {
    padding: .5rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .85rem;
}

.date-range input[type="date"]:focus {
    outline: none;
    border-color: var(--purple);
}

/* Charts placeholder */
.chart-placeholder {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: .875rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   MOBILE SIDEBAR
   ============================================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.35rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-two-col { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    font-size: .875rem;
    color: var(--text);
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: toastIn .3s ease;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--teal); }

.toast.fade-out { animation: toastOut .3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

.spinner--sm { width: 18px; height: 18px; border-width: 2px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* SPA loading state applied to #main-content during navigation */
#main-content.spa-loading {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
    min-height: 200px;
    transition: opacity 0.15s ease;
}
#main-content.spa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--border, #333);
    border-top-color: var(--purple, #8b5cf6);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 10;
}

/* Smooth fade-in for freshly loaded SPA content */
#main-content.spa-ready {
    animation: spaFadeIn 0.2s ease;
}
@keyframes spaFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Active sidebar link highlight (set by SPA for admin) */
.sidebar-nav a.spa-active {
    color: var(--purple, #8b5cf6) !important;
    background: rgba(139, 92, 246, 0.08);
}

/* ============================================================
   CALCULATOR SECTION
   ============================================================ */
.calculator {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.calculator h3 { margin-bottom: 1rem; }

.calc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
    font-size: .9rem;
}

.calc-row label { color: var(--text-dim); flex: 1; }

.calc-row input[type="number"],
.calc-row select {
    width: 120px;
    padding: .5rem .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    font-family: var(--font);
    text-align: right;
}

.calc-result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-result .calc-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--teal);
}

/* ============================================================
   ANNUAL DISCOUNT CALLOUT
   ============================================================ */
.discount-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    margin: 2rem 0;
}

.discount-banner h3 { margin-bottom: .35rem; }
.discount-banner p { font-size: .9rem; }
.discount-banner .discount-pct {
    color: var(--teal);
    font-weight: 800;
    font-size: 1.5rem;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-dim    { color: var(--text-dim); }
.text-purple { color: var(--purple); }
.text-teal   { color: var(--teal); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: .85rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
    color: var(--text-dark);
    font-size: .75rem;
    margin-top: .5rem;
}
