:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --primary-50: rgba(99,102,241,.06);
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.05);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

/* ═══ LAYOUT ═══ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, var(--gray-900) 0%, #0c1222 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width .3s ease, min-width .3s ease, transform .3s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
}

.sidebar-logo {
    padding: 24px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
}
.sidebar-logo span { color: var(--primary); }
.sidebar-logo a { color: inherit; }
.sidebar-logo a:hover { color: inherit; }

.sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--gray-400);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

.sidebar-nav .nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 24px 14px 8px;
    font-weight: 600;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,.15);
}
.sidebar-user-email {
    font-size: 13px;
    color: var(--gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.main-content {
    min-height: 100vh;
    margin-left: 260px;
    width: calc(100vw - 260px);
    max-width: calc(100vw - 260px);
    transition: margin-left .3s ease, width .3s ease, max-width .3s ease;
}
.app-layout.sidebar-collapsed .main-content { margin-left: 0; width: 100vw; max-width: 100vw; }

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 246px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-800);
    border: 2px solid var(--gray-700);
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left .3s ease, background .2s, color .2s;
    z-index: 101;
    padding: 0;
}
.sidebar-toggle:hover { background: var(--gray-700); color: #fff; }
.sidebar-toggle svg { transition: transform .3s; }

.app-layout.sidebar-collapsed .sidebar { width: 0; min-width: 0; border: none; }
.app-layout.sidebar-collapsed .sidebar > * { opacity: 0; pointer-events: none; transition: opacity .15s; }
.app-layout.sidebar-collapsed .sidebar-toggle { left: 8px; }
.app-layout.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--gray-900); }

.page-content { padding: 28px 32px; max-width: 1400px; overflow-x: auto; }

/* ═══ CARDS ═══ */
.card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}
.card-header h2 { font-size: 15px; font-weight: 700; color: var(--gray-800); letter-spacing: -.2px; }
.card-body { padding: 24px; }

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(99,102,241,.4); }

.btn-success { background: linear-gradient(135deg, var(--success), #34d399); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.3); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #f87171); color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,.3); }
.btn-warning { background: linear-gradient(135deg, var(--warning), #fbbf24); color: #fff; }

.btn-outline {
    background: #fff;
    border-color: var(--gray-200);
    color: var(--gray-700);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); box-shadow: var(--shadow); }

.btn-ghost { background: transparent; color: var(--gray-600); border: none; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { padding: 8px; }

.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.btn-active, .btn-outline.btn-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--gray-700); }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 6px; }

.form-input, .form-select, .form-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: #fff;
    transition: all var(--transition);
    color: var(--gray-800);
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--gray-300); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-input::placeholder { color: var(--gray-400); }

.form-textarea { resize: vertical; min-height: 120px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ═══ TABLES ═══ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-400);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    vertical-align: middle;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--primary-50); }
tbody tr:last-child td { border-bottom: none; }

/* ═══ BADGES ═══ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}
.badge-success { background: var(--success-light); color: #059669; }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger { background: var(--danger-light); color: #dc2626; }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ═══ POSITION INDICATORS ═══ */
.pos-up { color: var(--success); font-weight: 700; }
.pos-down { color: var(--danger); font-weight: 700; }
.pos-same { color: var(--gray-400); font-weight: 500; }
.pos-new { color: var(--primary); font-weight: 700; font-size: 11px; }

/* Position heatmap cells */
.pos-cell { border-radius: 6px; padding: 4px 6px; display: inline-block; min-width: 32px; text-align: center; font-weight: 700; font-size: 13px; }
.pos-top3 { background: #d1fae5; color: #065f46; }
.pos-top10 { background: #dbeafe; color: #1e40af; }
.pos-top30 { background: #fef3c7; color: #92400e; }
.pos-top100 { background: var(--gray-100); color: var(--gray-600); }
.pos-notfound { color: var(--gray-300); font-weight: 400; }

/* ═══ TABS ═══ */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.tab {
    padding: 8px 20px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition);
}
.tab:hover { color: var(--gray-700); background: rgba(255,255,255,.5); }
.tab.active {
    color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow);
}

/* ═══ STAT CARDS ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    opacity: 0;
    transition: opacity var(--transition);
}
.stat-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ═══ ALERTS ═══ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown .3s ease;
}
.alert-error { background: var(--danger-light); color: #b91c1c; border-left: 4px solid var(--danger); }
.alert-success { background: var(--success-light); color: #047857; border-left: 4px solid var(--success); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: var(--primary-light); color: #3730a3; border-left: 4px solid var(--primary); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ TOAST ═══ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-xl);
    pointer-events: auto;
    animation: toastIn .4s cubic-bezier(.16,1,.3,1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 440px;
    backdrop-filter: blur(8px);
    cursor: pointer;
}
.toast-success { background: rgba(16,185,129,.95); }
.toast-error { background: rgba(239,68,68,.95); }
.toast-info { background: rgba(99,102,241,.95); }
.toast-warning { background: rgba(245,158,11,.95); }
.toast.removing { animation: toastOut .3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px) scale(.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(100px) scale(.9); }
}

/* ═══ PAGINATION ═══ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    justify-content: center;
    padding: 12px 0;
}
.pagination a, .pagination span {
    padding: 7px 13px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
    transition: all var(--transition);
}
.pagination a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 6px rgba(99,102,241,.3); }

/* ═══ MODAL ═══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .3s cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition);
    line-height: 1;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

/* ═══ PROGRESS ═══ */
.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 100px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ═══ PROJECT CARDS ═══ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.project-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #818cf8, var(--success));
    opacity: .7;
}
.project-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.project-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.project-card-domain { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }
.project-card-stats {
    display: flex;
    gap: 20px;
}
.project-card-stat {
    text-align: center;
}
.project-card-stat-value { font-size: 18px; font-weight: 700; color: var(--gray-800); }
.project-card-stat-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* ═══ UTILITIES ═══ */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-400); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.desktop-only { display: flex; }
.w-full { width: 100%; }

/* ═══ GUEST / AUTH ═══ */
.guest-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}
.guest-layout::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
    top: -200px; right: -100px;
}
.guest-layout::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,.1) 0%, transparent 70%);
    bottom: -100px; left: -100px;
}

.auth-card {
    background: rgba(255,255,255,.98);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99,102,241,.08);
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
}
.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -1px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--gray-400);
    margin-bottom: 36px;
    font-size: 14px;
}

.guest-page-full {
    background: #f8fafc;
}

.guest-layout.guest-layout-full {
    display: block;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    overflow: visible;
}

.guest-layout.guest-layout-full::before,
.guest-layout.guest-layout-full::after {
    display: none;
}

.guest-page-report {
    background: #fff;
}

.guest-layout.guest-layout-report {
    display: block;
    background: #fff;
    align-items: stretch;
    justify-content: stretch;
    overflow: visible;
}

.guest-layout.guest-layout-report::before,
.guest-layout.guest-layout-report::after {
    display: none;
}

/* ═══ LANDING PAGE ═══ */
.landing-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 24px 60px;
    color: var(--gray-700);
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
}

.landing-logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--gray-900);
}

.landing-logo span {
    color: #818cf8;
}

.landing-nav {
    display: flex;
    gap: 20px;
}

.landing-nav a {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
}

.landing-nav a:hover {
    color: var(--gray-900);
}

.landing-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-hero {
    display: grid;
    grid-template-columns: .85fr 1.45fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}

.landing-hero-content,
.landing-hero-visual {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.landing-chip {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

.landing-hero h1 {
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -.8px;
    color: var(--gray-900);
    margin: 12px 0 10px;
}

.landing-hero p {
    font-size: 16px;
    color: var(--gray-600);
    max-width: 680px;
}

.landing-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 12px;
}

.landing-hero-points {
    list-style: none;
    display: grid;
    gap: 10px;
}

.landing-hero-points li {
    position: relative;
    padding-left: 24px;
    color: var(--gray-700);
    font-size: 14px;
}

.landing-hero-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399, #22d3ee);
}

/* Hero screenshots */
.landing-hero-visual {
    display: grid;
    gap: 0;
    align-content: start;
}

.landing-shot {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.landing-shot-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-200);
}

.landing-shot-head span {
    color: var(--gray-800);
    font-size: 13px;
    font-weight: 600;
}

.landing-shot-head small {
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 500;
}

.landing-shot-placeholder {
    height: 460px;
    background: linear-gradient(145deg, #eef2ff, #f8fafc);
    color: var(--gray-500);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}

.landing-shot-main .landing-shot-placeholder {
    height: 460px;
}

.landing-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.landing-section h2 {
    color: var(--gray-900);
    font-size: 30px;
    letter-spacing: -.7px;
    margin-bottom: 10px;
}

.landing-section-subtitle {
    color: var(--gray-600);
    font-size: 15px;
    margin-bottom: 20px;
}

/* Full-size showcase with tabs */
.landing-showcase {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.landing-showcase h2 {
    color: var(--gray-900);
    font-size: 30px;
    letter-spacing: -.7px;
    margin-bottom: 10px;
}

.landing-showcase-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.landing-showcase-tab {
    border: 1px solid var(--gray-200);
    background: #f8fafc;
    color: var(--gray-700);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.landing-showcase-tab:hover {
    border-color: #c7d2fe;
    color: #4338ca;
}

.landing-showcase-tab.is-active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

.landing-showcase-body {
    min-height: 72vh;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: #f8fafc;
    padding: 16px;
}

.landing-showcase-panel {
    display: none;
    height: 100%;
}

.landing-showcase-panel.is-active {
    display: block;
}

.landing-showcase-shot {
    height: 58vh;
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
    background: linear-gradient(145deg, #eef2ff, #f8fafc);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-size: 14px;
}

.landing-showcase-panel p {
    margin-top: 12px;
    color: var(--gray-700);
    font-size: 15px;
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.landing-feature-card {
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 18px;
}

.landing-feature-card h3 {
    color: var(--gray-900);
    font-size: 18px;
    margin-bottom: 8px;
}

.landing-feature-card p {
    color: var(--gray-600);
    font-size: 14px;
}

.landing-steps {
    display: grid;
    gap: 12px;
}

.landing-step {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
}

.landing-step span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.landing-step h3 {
    color: var(--gray-900);
    font-size: 18px;
    margin-bottom: 4px;
}

.landing-step p {
    color: var(--gray-600);
    font-size: 14px;
}

.landing-section-highlight {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
}

.landing-audience-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.landing-audience-grid article {
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 18px;
}

.landing-audience-grid h3 {
    color: var(--gray-900);
    margin-bottom: 6px;
    font-size: 18px;
}

.landing-audience-grid p {
    color: var(--gray-600);
    font-size: 14px;
}

.landing-faq-list {
    display: grid;
    gap: 10px;
}

.landing-faq-list details {
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px 16px;
}

.landing-faq-list summary {
    color: var(--gray-900);
    font-size: 15px;
    font-weight: 600;
}

.landing-faq-list details p {
    margin-top: 10px;
    color: var(--gray-600);
    font-size: 14px;
}

.landing-bottom-cta {
    background: linear-gradient(145deg, #eef2ff, #f0f9ff);
    border: 1px solid #c7d2fe;
    border-radius: 18px;
    padding: 34px;
    text-align: center;
}

.landing-bottom-cta h2 {
    font-size: 34px;
    color: var(--gray-900);
    letter-spacing: -.8px;
}

.landing-bottom-cta p {
    margin-top: 8px;
    color: var(--gray-600);
    font-size: 16px;
}

.landing-bottom-cta .landing-cta-row {
    justify-content: center;
    margin-top: 20px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 260px; min-width: 260px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100vw !important; max-width: 100vw !important; }
    .topbar { padding: 0 16px; height: 56px; }
    .topbar h1 { font-size: 16px; }
    .page-content { padding: 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .project-grid { grid-template-columns: 1fr; }
    .tabs { width: 100%; overflow-x: auto; }
    .mobile-only { display: flex !important; }
    .desktop-only { display: none !important; }

    .landing-page {
        padding: 16px 14px 30px;
    }

    .landing-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-bottom: 18px;
    }

    .landing-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .landing-actions {
        width: 100%;
        justify-content: center;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .landing-hero-content,
    .landing-hero-visual,
    .landing-section,
    .landing-bottom-cta {
        padding: 18px;
        border-radius: 14px;
    }

    .landing-hero h1 {
        font-size: 28px;
    }

    .landing-shot-placeholder,
    .landing-shot-main .landing-shot-placeholder {
        height: 260px;
    }

    .landing-section h2 {
        font-size: 24px;
    }

    .landing-showcase h2 {
        font-size: 24px;
    }

    .landing-showcase-body {
        min-height: auto;
        padding: 12px;
    }

    .landing-showcase-shot {
        height: 240px;
    }

    .landing-bottom-cta h2 {
        font-size: 26px;
    }

    .landing-feature-grid,
    .landing-audience-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state h3 { font-size: 17px; color: var(--gray-700); margin-bottom: 8px; font-weight: 700; }
.empty-state p { margin-bottom: 24px; font-size: 14px; max-width: 320px; margin-left: auto; margin-right: auto; }
.empty-state-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* ═══ LOADING ═══ */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-xl);
}

/* ═══ DETAILS/SUMMARY ═══ */
details > summary { list-style: none; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 5px solid var(--gray-400);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-right: 8px;
    transition: transform .2s ease;
}
details[open] > summary::before { transform: rotate(90deg); }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══ SECTION DIVIDER ═══ */
/* ═══ METRIC CHIPS ═══ */
.metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    font-size: 13px;
    transition: all var(--transition);
    cursor: help;
    white-space: nowrap;
}
.metric-chip:hover { border-color: var(--primary-light); background: var(--primary-50); }
.metric-chip-label { color: var(--gray-400); font-weight: 600; font-size: 12px; }
.metric-chip-value { font-weight: 800; color: var(--gray-900); font-size: 15px; }
.metric-chip-pct { color: var(--gray-500); font-weight: 600; font-size: 12px; }
.metric-chip-diff { font-size: 11px; font-weight: 700; }

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}
