/* ===== NextScan Design System v2 — Clean White Theme ===== */

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

:root {
    /* ─ Colors ─ */
    --primary: #2563EB;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-50: rgba(37,99,235,0.06);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-light: #f0fdf4;
    --success-dark: #166534;
    --success-border: #bbf7d0;
    --error: #ef4444;
    --error-light: #fef2f2;
    --error-dark: #991b1b;
    --error-border: #fecaca;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;
    --warning-border: #fde68a;
    --white: #ffffff;

    /* ─ Typography Scale ─ */
    --text-xs: 0.72rem;
    --text-sm: 0.82rem;
    --text-base: 0.92rem;
    --text-md: 1rem;
    --text-lg: 1.1rem;
    --text-xl: 1.2rem;
    --text-2xl: 1.4rem;
    --text-3xl: 1.6rem;
    --text-4xl: 1.8rem;
    --text-5xl: 2.6rem;

    /* ─ Spacing Scale ─ */
    --sp-1: 4px;
    --sp-2: 6px;
    --sp-3: 8px;
    --sp-4: 10px;
    --sp-5: 12px;
    --sp-6: 14px;
    --sp-7: 16px;
    --sp-8: 18px;
    --sp-9: 20px;
    --sp-10: 24px;
    --sp-12: 28px;
    --sp-14: 32px;
    --sp-16: 36px;
    --sp-20: 40px;
    --sp-24: 48px;
    --sp-32: 56px;

    /* ─ Borders & Radii ─ */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ─ Shadows ─ */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

    /* ─ Fonts ─ */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

    /* ─ Layout ─ */
    --max-w: 1100px;
    --header-h: 56px;
    --sidebar-w: 210px;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
code { font-family: var(--font-mono); font-size: 0.88em; }
img { max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

/* --- Container --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; width: 100%; }

/* ========== HEADER ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

/* Logo */
.logo { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none !important; }
.logo-icon { display: block; flex-shrink: 0; }
.logo-wordmark {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
}
.logo-wordmark span { font-weight: 400; color: var(--text-secondary); }

.main-nav { display: flex; align-items: center; gap: var(--sp-1); }
.main-nav a {
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.12s;
    text-decoration: none;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--bg-muted); }
.nav-btn {
    background: var(--primary) !important;
    color: var(--white) !important;
    font-weight: 600 !important;
}
.nav-btn:hover { background: var(--primary-hover) !important; }
.nav-link-muted { color: var(--text-muted) !important; }
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: var(--sp-1);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 8px 16px;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none !important;
    line-height: 1.4;
    font-family: var(--font);
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); box-shadow: 0 1px 2px rgba(37,99,235,0.25); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 2px 8px rgba(37,99,235,0.25); transform: translateY(-1px); }
.btn-outline { background: var(--bg); border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: none; border-color: transparent; color: var(--text-muted); padding: 6px 10px; }
.btn-ghost:hover { color: var(--primary); background: var(--primary-50); }
.btn-full { width: 100%; }
.btn-lg { padding: 12px 24px; font-size: var(--text-md); border-radius: var(--radius-lg); }
.btn-sm { padding: 5px 12px; font-size: var(--text-xs); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--bg);
    color: var(--text);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}
input::placeholder { color: var(--text-muted); }

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.88rem;
    font-weight: 500;
}
.alert-error { background: var(--error-light); color: var(--error-dark); border: 1px solid var(--error-border); }
.alert-success { background: var(--success-light); color: var(--success-dark); border: 1px solid var(--success-border); }

/* ========== PROGRESS BAR ========== */
.progress-section { margin: 0 0 24px; }
.progress-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress-stage {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress-pct { font-size: 0.88rem; font-weight: 700; color: var(--primary); font-family: var(--font-mono); }
.progress-bar-track {
    width: 100%;
    height: 6px;
    background: var(--bg-muted);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}
.progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-details { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); }

/* ========== AUTH ========== */
.auth-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 24px; text-align: center; font-weight: 700; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--text-muted); }

/* ========== HERO ========== */
.hero {
    padding: 72px 0 56px;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}
.hero h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; color: var(--text); }
.text-accent { color: var(--primary); }
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 14px auto 28px;
    max-width: 480px;
    line-height: 1.5;
}
.hero-form { max-width: 540px; margin: 0 auto; }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--sp-24);
    margin-top: var(--sp-16);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.hero-stats strong { display: block; font-size: 1.4rem; font-weight: 700; color: var(--text); }

/* ========== SCANNER FORM ========== */
.scanner-hero { text-align: center; padding: 40px 0 28px; }
.scanner-hero h1 { font-size: 1.8rem; font-weight: 700; }
.subtitle { color: var(--text-secondary); margin: 6px 0 24px; font-size: 1rem; }
.scan-form { max-width: 520px; margin: 0 auto; }
.scan-input-group {
    display: flex;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.scan-input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.scan-input-group input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    padding: 12px 16px;
    font-size: 0.95rem;
    background: transparent;
}
.scan-input-group input:focus { box-shadow: none !important; }
.scan-input-group .btn { border-radius: 0; padding: 10px 20px; white-space: nowrap; }
.scan-input-lg .btn { padding: 12px 24px; font-size: var(--text-md); }

/* ========== CAPTCHA ========== */
.captcha-group { display: flex; align-items: center; gap: var(--sp-5); margin-top: var(--sp-6); justify-content: center; }
.captcha-image { border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.captcha-input { display: flex; gap: var(--sp-2); }
.captcha-input input { width: 90px !important; text-align: center; }
.captcha-refresh {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 9px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all 0.12s;
}
.captcha-refresh:hover { color: var(--primary); border-color: var(--primary); }

/* ========== RESULTS ========== */
.results-section { margin: 20px 0 48px; }
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-7);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}
.results-header h1, .results-header h2 { font-size: 1.2rem; font-weight: 700; }
.results-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; line-height: 1.7; }
.results-actions { display: flex; gap: var(--sp-3); }
.results-filter { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.results-filter input { max-width: 260px; padding: 7px 12px; font-size: 0.88rem; }
.filter-count { font-size: 0.82rem; color: var(--text-muted); }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
}
.results-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.results-table th {
    background: var(--bg-subtle);
    padding: 9px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
}
.results-table th:hover { color: var(--primary); }
.results-table td { padding: 7px 14px; border-bottom: 1px solid var(--border-light); }
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--primary-50); }
.results-table code {
    background: var(--bg-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--text);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-cached { background: var(--warning-light); color: var(--warning-dark); }
.badge-free { background: var(--bg-muted); color: var(--text-muted); }
.badge-basic { background: var(--primary-light); color: var(--primary-hover); }
.badge-pro { background: #ede9fe; color: #5b21b6; }
.badge-pending { background: var(--warning-light); color: var(--warning-dark); }
.badge-completed { background: var(--success-light); color: var(--success-dark); }
.badge-failed { background: var(--error-light); color: var(--error-dark); }
.badge-unlimited { background: #fce7f3; color: #9d174d; }

/* ========== FEATURES ========== */
.features { padding: 56px 0; background: var(--bg-subtle); }
.features h2 { text-align: center; font-size: 1.6rem; font-weight: 700; margin-bottom: 36px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-9); }
.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon { margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 6px; font-weight: 700; }
.feature-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* ========== HOW IT WORKS ========== */
.how-it-works {
    padding: var(--sp-32) 0;
    text-align: center;
}
.how-it-works h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--sp-16);
}
.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--sp-10);
    max-width: 800px;
    margin: 0 auto;
}
.step {
    flex: 1;
    text-align: center;
}
.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: var(--text-xl);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-5);
}
.step h3 {
    font-size: var(--text-md);
    font-weight: 700;
    margin-bottom: var(--sp-2);
}
.step p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}
.step-arrow {
    font-size: var(--text-xl);
    color: var(--text-muted);
    padding-top: 12px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .steps-grid { flex-direction: column; gap: var(--sp-9); }
    .step-arrow { transform: rotate(90deg); }
}

/* ========== PRICING ========== */
.pricing-hero { text-align: center; padding: 40px 0 28px; }
.pricing-hero h1 { font-size: 1.8rem; font-weight: 700; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-7); margin-bottom: var(--sp-20); }
.price-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    position: relative;
    transition: all 0.2s;
}
.price-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.price-card-featured { border-color: var(--primary); box-shadow: var(--shadow-md); }
.price-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.price-card-header { text-align: center; margin-bottom: 18px; }
.price-card-header h3 { font-size: 1.1rem; margin-bottom: 6px; font-weight: 700; }
.price { font-size: 2rem; font-weight: 800; color: var(--text); }
.price span { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }
.price-features { list-style: none; margin-bottom: 20px; }
.price-features li {
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.price-features li:last-child { border-bottom: none; }
.price-features strong { color: var(--text); }

.pricing-preview { padding: 56px 0; text-align: center; }
.pricing-preview h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.pricing-grid-compact { max-width: 680px; margin: 28px auto; }
.price-card-mini {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    transition: all 0.15s;
}
.price-card-mini:hover { border-color: var(--primary); }
.price-card-mini.featured { border-color: var(--primary); background: var(--primary-light); }
.price-card-mini h3 { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.price-card-mini .price { font-size: 1.4rem; font-weight: 800; }
.price-card-mini p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ========== DASHBOARD ========== */
.dashboard-header { padding: 28px 0 8px; }
.dashboard-header h1 { font-size: 1.6rem; font-weight: 700; }
.dashboard-header p { color: var(--text-muted); font-size: 0.9rem; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); margin: var(--sp-9) 0; }
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }

.dash-section { margin-bottom: 32px; }
.dash-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.api-key-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-6);
    padding: var(--sp-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
    transition: box-shadow 0.15s;
}
.api-key-card:hover { box-shadow: var(--shadow-xs); }
.api-key-value { display: flex; align-items: center; gap: var(--sp-3); }
.api-key-value code {
    background: var(--bg-muted);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    word-break: break-all;
}
.api-key-meta { display: flex; gap: var(--sp-4); align-items: center; margin-top: var(--sp-2); font-size: var(--text-xs); color: var(--text-muted); flex-wrap: wrap; }
.api-key-actions { display: flex; gap: var(--sp-3); align-items: center; }
.empty-state { color: var(--text-muted); padding: 24px; text-align: center; font-size: 0.9rem; }

.code-block {
    background: #1e293b;
    border-radius: var(--radius-lg);
    padding: 16px;
    overflow-x: auto;
    margin: 10px 0;
}
.code-block pre { margin: 0; }
.code-block code { color: #e2e8f0; font-size: 0.82rem; line-height: 1.6; }

/* ========== CHECKOUT ========== */
.checkout-summary { text-align: center; }
.checkout-plan { margin-bottom: 14px; }
.checkout-plan h3 { font-size: 1.05rem; }
.checkout-price { font-size: 1.6rem; font-weight: 800; margin: 6px 0; }
.checkout-price span { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.checkout-note { font-size: 0.82rem; color: var(--text-muted); margin: 14px 0; }

/* ========== DOCS ========== */
.docs-page { max-width: 720px; margin: 0 auto; padding: 40px 0; }
.docs-page h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 6px; }
.docs-section { margin-top: 36px; }
.docs-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.endpoint-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 14px 0;
}
.endpoint-card h3 { font-size: 0.95rem; margin-bottom: 10px; font-weight: 700; }
.endpoint-card h4 { font-size: 0.85rem; margin: 14px 0 6px; color: var(--text-muted); }
.method-badge {
    display: inline-block;
    background: var(--success);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-right: 5px;
}
.params-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 6px 0; }
.params-table th {
    text-align: left;
    padding: 7px 10px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}
.params-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); }
.params-table code { background: var(--bg-muted); padding: 1px 5px; border-radius: 3px; font-size: 0.82rem; }

/* ========== FOOTER ========== */
.site-footer {
    margin-top: auto;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 36px 0 0;
}
.footer-inner { display: flex; justify-content: space-between; gap: var(--sp-16); flex-wrap: wrap; }
.footer-brand { max-width: 260px; }
.footer-brand strong { font-size: 1.05rem; }
.footer-brand p { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.footer-links { display: flex; gap: var(--sp-20); }
.footer-links h4 { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.05em; font-weight: 600; }
.footer-links a { display: block; font-size: 0.82rem; color: var(--text-secondary); padding: 2px 0; text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
    text-align: center;
    padding: 16px 0;
    margin-top: 28px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== SPINNER ========== */
.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== FLOATING SIDEBAR ========== */
.latest-sidebar {
    position: fixed;
    right: 0;
    top: calc(var(--header-h) + 16px);
    width: var(--sidebar-w);
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 80;
}
.latest-sidebar::-webkit-scrollbar { width: 3px; }
.latest-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.latest-sidebar h4 {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    padding: 10px 12px 7px;
    margin: 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg);
    font-weight: 700;
}
.sidebar-list { list-style: none; }
.sidebar-list li a {
    display: flex;
    flex-direction: column;
    padding: 6px 12px;
    text-decoration: none;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-list li:last-child a { border-bottom: none; }
.sidebar-list li a:hover { background: var(--primary-50); }
.sidebar-domain {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-meta { font-size: 0.66rem; color: var(--text-muted); }

/* ========== ADMIN ========== */
.admin-layout { display: flex; gap: var(--sp-10); margin: var(--sp-10) 0 var(--sp-24); min-height: 60vh; }
.admin-nav {
    width: 170px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: flex-start;
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    padding: 6px;
}
.admin-nav a {
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.1s;
}
.admin-nav a:hover { background: var(--bg); color: var(--text); }
.admin-nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.admin-content { flex: 1; min-width: 0; }
.admin-content h1 { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--sp-8); }
.admin-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-5);
    margin-bottom: var(--sp-9);
}
.admin-header h1,
.admin-header h2 { margin: 0; padding: 0; border: none; }
.admin-header-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.admin-search {
    display: flex;
    gap: var(--sp-3);
    margin-bottom: var(--sp-7);
}
.admin-pagination {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-7);
    align-items: center;
}
.admin-pagination a {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
}
.admin-pagination a:hover { border-color: var(--primary); color: var(--primary); }
.admin-pagination .current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    padding: 6px 12px;
    font-size: var(--text-sm);
}
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Admin components */
.admin-search input { max-width: 280px; }
.chart-bar { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-1) 0; }
.chart-bar-fill { height: 20px; background: var(--primary); border-radius: var(--radius); min-width: 2px; }
.chart-bar-label { font-size: var(--text-xs); color: var(--text-secondary); min-width: 100px; }
.chart-bar-value { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); margin-top: var(--sp-9); }
.info-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-8); }
.info-card h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--sp-5); color: var(--text); }
.danger-zone { border-color: var(--error); }
.danger-zone h3 { color: var(--error); }
.kv-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; font-size: var(--text-sm); border-bottom: 1px solid var(--border-light); }
.kv-row:last-child { border-bottom: none; }
.kv-label { color: var(--text-muted); }
.kv-value { font-weight: 600; color: var(--text); font-family: var(--font-mono); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: var(--radius-full); transition: 0.2s; }
.toggle-slider:before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }

/* ========== RESULT EXPIRY ========== */
.result-expiry-banner {
    background: var(--warning-light);
    color: var(--warning-dark);
    padding: 9px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--warning-border);
    margin-bottom: 18px;
    font-size: var(--text-sm);
    text-align: center;
}

/* ========== SHARE LINK ========== */
.share-link { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.share-link input {
    flex: 1;
    padding: 5px 10px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-muted);
    font-family: var(--font-mono);
    color: var(--text-secondary);
}
.share-link .btn { white-space: nowrap; }

/* ========== TLD GRID ========== */
.tld-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--sp-4);
    margin: var(--sp-6) 0;
}
.tld-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-align: center;
    transition: all 0.15s;
}
.tld-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.tld-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.tld-count { font-size: 0.75rem; color: var(--text-muted); margin: 3px 0 8px; }
.tld-buy { margin: 0; }

/* ========== PAGE INFO (below scan forms) ========== */
.page-info {
    max-width: 680px;
    margin: var(--sp-14) auto var(--sp-24);
}
.info-stats {
    display: flex;
    justify-content: center;
    gap: var(--sp-20);
    padding: var(--sp-10) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--sp-10);
}
.info-stat {
    text-align: center;
}
.info-stat strong {
    display: block;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary);
}
.info-stat span {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.recent-lookups {
    margin-bottom: var(--sp-10);
}
.recent-lookups h3 {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-3);
    font-weight: 600;
}
.lookup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}
.lookup-tag {
    display: inline-block;
    padding: var(--sp-1) var(--sp-4);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.12s;
    font-family: var(--font-mono);
}
.lookup-tag:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-9);
}
.info-block h3 {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--sp-2);
    color: var(--text);
}
.info-block p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}
.info-block code {
    background: var(--bg-muted);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: var(--text-xs);
}

@media (max-width: 768px) {
    .info-stats { flex-direction: column; gap: var(--sp-7); }
    .info-grid { grid-template-columns: 1fr; }
}

/* ========== TICKETS ========== */
.ticket-list { list-style: none; }
.ticket-item {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    padding: var(--sp-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-3);
    transition: box-shadow 0.1s;
    text-decoration: none !important;
    color: var(--text);
}
.ticket-item:hover { box-shadow: var(--shadow-sm); }
.ticket-id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); min-width: 40px; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-subject { font-weight: 600; font-size: var(--text-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.ticket-status {
    font-size: var(--text-xs);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-open { background: var(--success-light); color: var(--success-dark); }
.status-closed { background: var(--bg-muted); color: var(--text-muted); }
.priority-urgent { border-left: 3px solid var(--error) !important; }
.priority-high { border-left: 3px solid var(--warning) !important; }
.reply-bubble { padding: 14px 16px; border-radius: var(--radius-lg); margin-bottom: 10px; max-width: 85%; }
.reply-user { background: var(--primary-light); border: 1px solid #dbeafe; margin-left: auto; }
.reply-admin { background: var(--bg-subtle); border: 1px solid var(--border); margin-right: auto; }
.reply-header { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 6px; }
.reply-body { font-size: var(--text-base); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.reply-admin-badge { background: var(--primary); color: var(--white); padding: 1px 6px; border-radius: 3px; font-size: 0.68rem; font-weight: 700; }
.ticket-filters { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-7); }
.ticket-filters a {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-muted);
    text-decoration: none;
    transition: all 0.1s;
}
.ticket-filters a:hover, .ticket-filters a.active { background: var(--primary); color: var(--white); }
.ticket-detail-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ticket-detail-header h1 { font-size: var(--text-xl); margin-bottom: 4px; }
.ticket-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--sp-3); }
.mt-2 { margin-top: var(--sp-7); }
.mt-3 { margin-top: var(--sp-10); }
.mt-4 { margin-top: var(--sp-14); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-3); }
.mb-2 { margin-bottom: var(--sp-7); }
.mb-3 { margin-bottom: var(--sp-10); }
.gap-1 { gap: var(--sp-2); }
.gap-2 { gap: var(--sp-3); }
.gap-3 { gap: var(--sp-5); }
.d-flex { display: flex; }
.d-inline { display: inline; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 500px; }
.max-w-lg { max-width: 600px; }
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: var(--text-base);
    resize: vertical;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .latest-sidebar { width: 180px; }
}

@media (max-width: 768px) {
    .latest-sidebar { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .features-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { flex-direction: column; gap: var(--sp-4); }
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-h);
        right: 16px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 8px;
        box-shadow: var(--shadow-lg);
        min-width: 180px;
    }
    .main-nav.open { display: flex; }
    .mobile-menu-btn { display: flex; }
    .api-key-card { flex-direction: column; align-items: flex-start; }
    .results-header { flex-direction: column; }
    .scan-input-group { flex-direction: column; }
    .scan-input-group .btn { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
    .admin-layout { flex-direction: column; }
    .admin-nav { width: 100%; flex-direction: row; overflow-x: auto; position: static; border-radius: var(--radius); }
    .tld-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-links { gap: var(--sp-10); }
}

@media (max-width: 480px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .footer-links { flex-direction: column; }
    .auth-card { margin: 20px auto; padding: 20px; }
    .hero { padding: 40px 0 28px; }
    .container { padding: 0 14px; }
}
