/* ═══════════════════════════════════════════════════════════════════════════
   CinaptixAI Design System
   "The Obsidian Logic" — Tonal layering, no-line rule, glassmorphism.
   Segoe UI system stack throughout. Navy + Electric Blue + Slate.
   Light theme default. Toggle dark via data-theme="dark" on <html>.
   ═══════════════════════════════════════════════════════════════════════════ */

/* System font stack — no external font downloads needed */

/* ── High-Contrast Light Theme (default) ──────────────────────────────── */
:root {
    --sidebar-width:   240px;

    /* Surface hierarchy (tonal layering) */
    --bg:              #F0F2F5;
    --surface:         #FFFFFF;
    --card:            #F8F9FB;
    --card-alt:        #F0F2F5;
    --input:           #ECEEF2;
    --overlay:         #10141a;

    /* Primary — Electric Blue */
    --teal:            #2563EB;
    --teal-dim:        #1D4ED8;
    --teal-muted:      #DBEAFE;
    --teal-glow:       rgba(37, 99, 235, 0.08);
    --teal-bg:         rgba(37, 99, 235, 0.04);

    /* Secondary — Slate (no purple) */
    --purple:          #64748B;
    --purple-dim:      #475569;
    --purple-muted:    #E2E8F0;
    --purple-glow:     rgba(100, 116, 139, 0.08);
    --purple-light:    #94A3B8;

    /* Accent */
    --amber:           #F59E0B;
    --amber-glow:      rgba(245, 158, 11, 0.08);

    /* Typography */
    --text:            #0F172A;
    --text-secondary:  #334155;
    --text-muted:      #64748B;
    --text-dim:        #94A3B8;

    /* Status — saturated, luminescent */
    --success:         #10B981;
    --warning:         #F59E0B;
    --error:           #EF4444;

    /* Ghost borders (no-line rule — 15% opacity outlines) */
    --border:          rgba(15, 23, 42, 0.07);
    --border-active:   rgba(37, 99, 235, 0.25);

    /* Ambient shadows */
    --card-shadow:     none;
    --elevated-shadow: 0 12px 40px -4px rgba(15, 23, 42, 0.08);
    --ambient-glow:    0 12px 40px -4px rgba(37, 99, 235, 0.06);

    /* Radii */
    --radius-sm:       8px;
    --radius-md:       14px;
    --radius-lg:       16px;
    --radius-pill:     12px;
    --radius-input:    12px;

    /* Fonts */
    --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-data:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Motion */
    --ease-neural:     cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Glass */
    --glass-bg:        rgba(255, 255, 255, 0.60);
    --glass-blur:      20px;
}

/* ── Obsidian Dark Theme ──────────────────────────────────────────────── */
[data-theme="dark"] {
    /* Surface hierarchy — obsidian sheet stack */
    --bg:              #0D1117;
    --surface:         #10141a;
    --card:            #161b24;
    --card-alt:        #131820;
    --input:           #1f2a3a;
    --overlay:         #0D1117;

    /* Primary — Electric Blue (brighter for dark) */
    --teal:            #3B82F6;
    --teal-dim:        #2563EB;
    --teal-muted:      #1e3a5f;
    --teal-glow:       rgba(59, 130, 246, 0.12);
    --teal-bg:         rgba(59, 130, 246, 0.06);

    /* Secondary — Slate */
    --purple:          #94A3B8;
    --purple-dim:      #64748B;
    --purple-muted:    #1e293b;
    --purple-glow:     rgba(148, 163, 184, 0.10);
    --purple-light:    #CBD5E1;

    /* Accent */
    --amber:           #F59E0B;
    --amber-glow:      rgba(245, 158, 11, 0.12);

    /* Typography */
    --text:            #E2E8F0;
    --text-secondary:  #94A3B8;
    --text-muted:      #64748B;
    --text-dim:        #334155;

    /* Status */
    --success:         #10B981;
    --warning:         #F59E0B;
    --error:           #EF4444;

    /* Ghost borders */
    --border:          rgba(226, 232, 240, 0.06);
    --border-active:   rgba(59, 130, 246, 0.25);

    /* Ambient shadows — deeper in obsidian */
    --card-shadow:     none;
    --elevated-shadow: 0 12px 40px -4px rgba(0, 0, 0, 0.45);
    --ambient-glow:    0 12px 40px -4px rgba(59, 130, 246, 0.08);

    /* Glass — obsidian variant */
    --glass-bg:        rgba(16, 20, 26, 0.60);
    --glass-blur:      20px;
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    min-height: 100vh;
    position: relative;
}

/* Ambient gradient — subtle Electric Blue glow in corners */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 700px 700px at 0% 0%, rgba(37, 99, 235, 0.03), transparent),
        radial-gradient(ellipse 500px 500px at 100% 100%, rgba(37, 99, 235, 0.02), transparent);
}

[data-theme="dark"] body::before {
    background:
        radial-gradient(ellipse 700px 700px at 0% 0%, rgba(59, 130, 246, 0.04), transparent),
        radial-gradient(ellipse 500px 500px at 100% 100%, rgba(59, 130, 246, 0.02), transparent);
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.3s var(--ease-neural);
}

a:hover { color: var(--teal-dim); }

img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Glassmorphism floating panel
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    transition: background 0.4s var(--ease-neural);
}

/* Brand area */
.sidebar-brand {
    padding: 28px 24px 16px;
}

.sidebar-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: center !important;
}

.sidebar-brand-name .brand-teal { color: var(--teal); }
.sidebar-brand-name .brand-purple { color: var(--text-secondary); }

.sidebar-brand-overline {
    display: block;
    font-family: var(--font-data);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 2.5px;
    /* text-transform: uppercase; */
    margin-top: 4px;
    text-align: center !important;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Navigation links */
.sidebar-nav {
    flex: 1;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s var(--ease-neural);
    text-decoration: none;
}

.sidebar-nav-link:hover {
    color: var(--teal);
    background: var(--surface);
}

.sidebar-nav-link.active {
    color: var(--teal);
    background: var(--surface);
}

.sidebar-nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* "New Idea" highlighted pill link */
.sidebar-nav-link.new-idea {
    font-weight: 600;
    border-radius: var(--radius-pill);
    margin-top: 4px;
}

.sidebar-nav-link.new-idea:not(.active) {
    color: var(--teal);
}

.sidebar-nav-link.new-idea:hover:not(.active) {
    background: var(--surface);
}

/* Divider — tonal shift instead of line */
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 24px;
}

/* Bottom section (Settings, Support) */
.sidebar-bottom {
    padding: 8px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-bottom-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: all 0.3s var(--ease-neural);
    text-decoration: none;
}

.sidebar-bottom-link:hover {
    color: var(--teal);
    background: var(--surface);
}

.sidebar-bottom-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* "New Idea" CTA button */
.sidebar-new-idea-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 14px 4px;
    padding: 12px 18px;
    background: #3B82F6;
    color: #FFFFFF;
    font-family: var(--font);
    font-size: 0.87rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s var(--ease-neural);
    text-decoration: none;
    box-shadow: none;
}

.sidebar-new-idea-btn:hover {
    background: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.2);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA — Offset by sidebar, scrollable
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: var(--surface);
}

.main-content.no-sidebar {
    margin-left: 0;
}

.page-container {
    width: 100%;
}

.main-content-inner {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 36px 56px;
}

.main-content-inner.wide {
    max-width: 1200px;
}

/* ── Typography — Manrope display + Inter labels ──────────────────────── */
.display-title {
    font-family: var(--font);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.display-accent {
    font-family: var(--font);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--teal);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.page-title {
    font-family: var(--font);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.card-title {
    font-family: var(--font);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.body-text {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.65;
}

.caption {
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.overline {
    font-family: var(--font-data);
    /*font-size: 0.68rem;*/
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 2.5px;
    /* text-transform: uppercase; */
}

.form-label {
    display: block;
    font-family: var(--font-data);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    /* text-transform: uppercase; */
    margin-bottom: 8px;
}

/* ── Cards — Tonal layering, zero divider lines ───────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.4s var(--ease-neural);
}

.card-elevated {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--elevated-shadow);
}

/* ── Stat Cards ──────────────────────────────────────────────────────── */
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    transition: all 0.4s var(--ease-neural);
}

.stat-card-number {
    font-family: var(--font);
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-card-label {
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-card-dot {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stat-card-dot.teal { background: var(--teal); box-shadow: 0 0 8px rgba(37, 99, 235, 0.4); }
.stat-card-dot.purple { background: var(--purple); }
.stat-card-dot.amber { background: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }

/* ── Buttons — Pill-shaped, gradient CTA ──────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-neural);
    text-decoration: none;
    line-height: 1;
}

/* Primary — subtle solid CTA */
.btn-primary {
    background: #3B82F6;
    color: #FFFFFF;
    box-shadow: none;
}

.btn-primary:hover {
    background: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.2);
}

/* Secondary CTA */
.btn-purple {
    background: #3B82F6;
    color: #FFFFFF;
    box-shadow: none;
}

.btn-purple:hover {
    background: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 12px 40px -4px rgba(37, 99, 235, 0.2);
}

/* Ghost — 15% outline border, no fill */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--card);
    border-color: var(--border-active);
}

/* Danger */
.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--error);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ── Input Fields — 56px, bottom-glow focus ───────────────────────────── */
.form-group {
    margin-bottom: 24px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    height: 56px;
    background: var(--input);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-input);
    padding: 16px 18px;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    transition: all 0.3s var(--ease-neural);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-bottom-color: var(--teal);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-dim);
}

.form-textarea {
    height: auto;
    resize: vertical;
    min-height: 120px;
}

.form-select {
    appearance: none;
    cursor: pointer;
}

.form-select option {
    background: var(--surface);
    color: var(--text);
}

/* ── Category Pills ───────────────────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-data);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1px;
    /* text-transform: uppercase; */
}

.pill-architecture { background: var(--teal-bg); color: var(--teal); }
.pill-neural       { background: var(--teal-bg); color: var(--teal); }
.pill-design       { background: var(--purple-glow); color: var(--purple); }
.pill-concept      { background: var(--amber-glow); color: var(--amber); }
.pill-reference    { background: rgba(100, 116, 139, 0.08); color: var(--text-muted); }

/* ── Tags — tonal, no border ──────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--card);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── AI Badge ─────────────────────────────────────────────────────────── */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--teal-bg);
    border-radius: var(--radius-pill);
    font-family: var(--font-data);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 0.5px;
    /* text-transform: uppercase; */
}

/* ── Filter Chips ─────────────────────────────────────────────────────── */
.chip {
    display: inline-block;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--ease-neural);
}

.chip:hover {
    border-color: var(--border-active);
    color: var(--text);
    background: var(--surface);
}

/* Active chip — "lit" module */
.chip.active {
    background: var(--teal-bg);
    border-color: transparent;
    color: var(--teal);
    box-shadow: 0 0 0 1px var(--teal-glow);
}

/* ── Idea Card — tonal separation, no hard borders ────────────────────── */
.idea-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    transition: all 0.4s var(--ease-neural);
    color: inherit;
    text-decoration: none;
}

.idea-card:hover {
    background: var(--surface);
    border-color: var(--border-active);
    box-shadow: var(--ambient-glow);
    color: inherit;
}

.idea-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.idea-card .idea-title {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 8px 0 6px;
    letter-spacing: -0.01em;
}

.idea-card .idea-body {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 14px;
}

.idea-card .idea-meta {
    display: flex;
    gap: 16px;
    font-family: var(--font-data);
    font-size: 0.75rem;
    color: var(--text-muted);
    align-items: center;
    flex-wrap: wrap;
}

.idea-card .idea-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.idea-card .idea-action-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s var(--ease-neural);
    background: transparent;
    border: none;
    font-size: 1rem;
}

.idea-card .idea-action-icon:hover {
    color: var(--text);
    background: var(--card-alt);
}

/* ── Enrichment Banner ────────────────────────────────────────────────── */
.enrichment-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: var(--teal-bg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.87rem;
    color: var(--teal);
}

.enrichment-banner-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.enrichment-banner-text {
    flex: 1;
    color: var(--text-secondary);
}

.enrichment-banner-text strong {
    color: var(--teal);
}

/* ── Node Detail Popup (Graph View) — glass floating panel ────────────── */
.node-popup {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--elevated-shadow);
    position: absolute;
    z-index: 50;
    min-width: 280px;
    max-width: 380px;
}

.node-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.node-popup-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s var(--ease-neural);
}

.node-popup-close:hover {
    background: var(--card);
    color: var(--text);
}

.node-popup-title {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.node-popup-description {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 14px;
}

.node-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.node-popup-expand {
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 1px;
    /* text-transform: uppercase; */
    text-decoration: none;
    transition: color 0.3s var(--ease-neural);
}

.node-popup-expand:hover {
    color: var(--teal-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HOME PAGE — Hero splash with ripple drop
   ═══════════════════════════════════════════════════════════════════════════ */

.hero-splash {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
    margin: -40px -36px 0;
    padding-left: 36px;
    padding-right: 36px;
}

.hero-ripple {
    position: absolute;
    top: -40px;
    right: -80px;
    width: 520px;
    height: 380px;
    pointer-events: none;
    opacity: 0.85;
}

.hero-ripple svg {
    width: 100%;
    height: 100%;
}

/* Gentle float animation for the droplet */
@keyframes ripple-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-ripple {
    animation: ripple-float 6s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.hero-title {
    font-family: var(--font);
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-accent {
    color: var(--teal);
}

.hero-subtitle {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.home-section {
    margin-bottom: 40px;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Ideas grid — 2 columns */
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* Empty state icon */
.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* ── Mobile adjustments for home ─────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-splash {
        padding: 40px 16px 40px;
        margin: -24px -16px 0;
    }

    .hero-ripple {
        width: 280px;
        height: 200px;
        top: 10px;
        right: -30px;
        opacity: 0.5;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .ideas-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .hero-title {
        font-size: 2.6rem;
    }

    .hero-ripple {
        width: 400px;
        height: 300px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE — Full viewport, ambient background
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 800px 600px at 30% 20%, rgba(37, 99, 235, 0.05), transparent),
        radial-gradient(ellipse 600px 500px at 70% 80%, rgba(37, 99, 235, 0.03), transparent),
        var(--bg);
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* Hide sidebar on login */
.login-page ~ .sidebar,
body.login-body .sidebar {
    display: none;
}

body.login-body .main-content {
    margin-left: 0;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--elevated-shadow);
    padding: 52px 44px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card .login-brand {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.login-card .login-brand .brand-teal { color: var(--teal); }
.login-card .login-brand .brand-purple { color: var(--text-secondary); }

.login-card .login-overline {
    font-family: var(--font-data);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 2.5px;
    /* text-transform: uppercase; */
    margin-bottom: 32px;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn-purple {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    margin-top: 8px;
}

.login-system-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 0.5px;
}

.login-system-badge::before {
    content: "\25CF";
    font-size: 0.5rem;
}

.login-access-link {
    display: block;
    margin-top: 20px;
    font-size: 0.87rem;
    color: var(--text-muted);
}

.login-access-link a {
    color: var(--teal);
    font-weight: 500;
}

.login-access-link a:hover {
    color: var(--teal-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER — tonal separation, no line
   ═══════════════════════════════════════════════════════════════════════════ */
.footer {
    background: var(--card-alt);
    border-top: none;
    padding: 24px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-data);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-text {
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.3s var(--ease-neural);
}

.footer-links a:hover {
    color: var(--text);
}

/* ── Alerts — tonal, no hard borders ──────────────────────────────────── */
.alert {
    padding: 16px 22px;
    border-radius: var(--radius-md);
    font-size: 0.87rem;
    margin-bottom: 20px;
    border: none;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
}

/* ── Accent Bar ───────────────────────────────────────────────────────── */
.accent-bar {
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--teal-dim));
    border-radius: 2px;
}

/* ── Avatar — tonal, no hard border ───────────────────────────────────── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal);
}

/* ── Loading Spinner ──────────────────────────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--card);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs         { gap: 4px; }
.gap-sm         { gap: 8px; }
.gap-md         { gap: 16px; }
.gap-lg         { gap: 32px; }
.gap-xl         { gap: 48px; }
.mt-xs          { margin-top: 4px; }
.mt-sm          { margin-top: 8px; }
.mt-md          { margin-top: 16px; }
.mt-lg          { margin-top: 32px; }
.mb-xs          { margin-bottom: 4px; }
.mb-sm          { margin-bottom: 8px; }
.mb-md          { margin-bottom: 16px; }
.mb-lg          { margin-bottom: 32px; }
.ml-auto        { margin-left: auto; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-muted     { color: var(--text-muted); }
.text-teal      { color: var(--teal); }
.text-purple    { color: var(--purple); }
.text-error     { color: var(--error); }
.hidden         { display: none; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full         { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Sidebar collapse on mobile (< 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s var(--ease-neural);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--elevated-shadow);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }

    .main-content-inner {
        padding: 24px 16px 40px;
    }

    /* Login adjustments */
    .login-card {
        padding: 36px 24px;
    }

    /* Typography scale-down */
    .display-title,
    .display-accent {
        font-size: 2.25rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Footer stacks */
    .footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px 16px;
    }

    .footer-links {
        justify-content: center;
    }

    /* Overlay behind sidebar when open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(13, 17, 23, 0.5);
        z-index: 199;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}
