/* ============================================================
   DESIGN SYSTEM — CSS Custom Properties
   ============================================================ */
:root {
    /* Palette */
    --color-primary:     #0A1628;
    --color-secondary:   #0D2137;
    --color-accent:      #00D4FF;
    --color-accent-alt:  #7B2FFF;
    --color-success:     #00FF88;
    --color-warning:     #FF6B35;
    --color-text:        #E8EDF5;
    --color-text-muted:  #6B8CAE;
    --color-border:      #1A3050;
    --color-glass:       rgba(13, 33, 55, 0.7);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body:    'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* Border radius */
    --radius-card:   8px;
    --radius-button: 4px;
    --radius-input:  2px;

    /* Glow */
    --glow-accent: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-accent-strong: 0 0 40px rgba(0, 212, 255, 0.4);
    --glow-purple: 0 0 20px rgba(123, 47, 255, 0.3);

    /* Aliases for pipeline app templates (legacy variable names) */
    --bg-primary:        var(--color-primary);
    --bg-secondary:      var(--color-secondary);
    --bg-card:           var(--color-secondary);
    --bg-input:          #0A1220;
    --border-color:      var(--color-border);
    --text-primary:      var(--color-text);
    --text-bright:       #FFFFFF;
    --text-secondary:    #B0C4DE;
    --text-muted:        var(--color-text-muted);
    --accent-primary:    var(--color-accent);
    --accent-highlight:  var(--color-accent);
    --accent-info:       #3B82F6;
    --accent-success:    var(--color-success);
    --accent-warning:    var(--color-warning);
    --accent-danger:     #EF4444;
    --navbar-height:     60px;
    --statusbar-height:  0px;
}

/* ============================================================
   SHARED UTILITY CLASSES (used by pipeline app templates)
   ============================================================ */

/* Layout */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }

/* Spacing */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }

/* Typography */
.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-button);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    background: rgba(255,255,255,0.04);
}
.btn-primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(0, 212, 255, 0.08);
}
.btn-primary:hover {
    background: rgba(0, 212, 255, 0.16);
    box-shadow: var(--glow-accent);
}
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.72rem; }
.btn-xs { padding: 2px 8px; font-size: 0.65rem; }

/* Form controls */
.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.form-control {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    transition: border-color 0.15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.2);
}
select.form-control {
    appearance: auto;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-primary);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img, svg {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   SVG GRID BACKGROUND
   ============================================================ */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

/* ============================================================
   SHELL LAYOUT — top navbar + optional sidebar + main
   ============================================================ */
.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.shell__top {
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.shell__body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.shell__main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    padding: 0.75rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(10, 22, 40, 0.97);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Brand / Logo */
.navbar__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar__logo {
    height: 68px;
    width: auto;
    transition: opacity 0.2s ease;
}

.navbar__brand:hover .navbar__logo {
    opacity: 0.85;
}

/* Nav Links */
.navbar__links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar__links a {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
    position: relative;
    padding: 0.25rem 0;
}

.navbar__links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    right: 50%;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
    transition: left 0.3s ease, right 0.3s ease;
}

.navbar__links a:hover::after,
.navbar__links a.active::after {
    left: 0;
    right: 0;
}

.navbar__links a:hover {
    color: var(--color-accent);
}

.navbar__links a.active {
    color: var(--color-accent);
}

/* Right side group */
.navbar__right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Language Switcher */
.navbar__lang {
    display: flex;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.navbar__lang a {
    color: var(--color-text-muted);
    padding: 0.3rem 0.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    transition: all 0.25s ease;
}

.navbar__lang a:hover {
    color: var(--color-text);
    border-color: var(--color-border);
}

.navbar__lang a.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(0, 212, 255, 0.08);
}

/* CTA Button */
.navbar__cta {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--color-accent), #00b8d9);
    border: none;
    color: var(--color-primary);
    border-radius: var(--radius-button);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar__cta:hover {
    box-shadow: var(--glow-accent-strong);
    transform: translateY(-1px);
    color: var(--color-primary);
}

/* Mobile hamburger */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    z-index: 1001;
}

.navbar__hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.navbar__hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5.5px, 5.5px);
}

.navbar__hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.navbar__hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5.5px, -5.5px);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

.mobile-overlay.open {
    display: flex;
}

.mobile-overlay a {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.mobile-overlay a:hover {
    color: var(--color-accent);
}

.mobile-overlay .navbar__cta {
    font-size: 1rem;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 960px) {
    .navbar {
        padding: 0.75rem 1.5rem;
    }

    .navbar__links,
    .navbar__lang,
    .navbar__cta-desktop {
        display: none;
    }

    .navbar__hamburger {
        display: flex;
    }

    .navbar__logo {
        height: 52px;
    }
}

@media (min-width: 961px) and (max-width: 1200px) {
    .navbar {
        padding: 0.75rem 2rem;
    }

    .navbar__links {
        gap: 1.75rem;
    }

    .navbar__links a {
        font-size: 0.9rem;
    }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero__bg svg {
    width: 100%;
    height: 100%;
}

.hero__content {
    max-width: 800px;
    z-index: 1;
}

.hero__logo {
    max-width: 360px;
    height: auto;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero__logo {
        max-width: 240px;
    }
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero__title .highlight {
    color: var(--color-accent);
    position: relative;
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: var(--color-primary);
    border: none;
    border-radius: var(--radius-button);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    box-shadow: var(--glow-accent-strong);
    transform: translateY(-1px);
    color: var(--color-primary);
}

.btn-secondary {
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: var(--color-text-muted);
}

.hero__scroll svg {
    width: 24px;
    height: 24px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================================
   SECTIONS — Common
   ============================================================ */
.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 1rem;
}

.section__subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
}

/* Fade-in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.problem-card {
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: all 0.3s ease;
}

.problem-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--glow-accent);
    transform: translateY(-4px);
}

.problem-card__icon {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: 1.25rem;
}

.problem-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.problem-card__stat {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.problem-card__text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   SOLUTION / THREE PILLARS
   ============================================================ */
.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.pillar {
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.pillar:hover {
    border-color: var(--color-accent);
    box-shadow: var(--glow-accent);
    transform: translateY(-4px);
}

.pillar__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--color-accent);
}

.pillar__title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.pillar__text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   MAP SECTION (embedded in welcome)
   ============================================================ */
.map-section {
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.map-container {
    height: 60vh;
    width: 100%;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--color-border);
    position: relative;
}

/* Full-page map */
.map-fullpage {
    height: calc(100vh - 70px);
    margin-top: 70px;
    position: relative;
}

.map-fullpage .map-container {
    height: 100%;
    border-radius: 0;
    border: none;
}

.map-sidebar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 320px;
    max-height: calc(100% - 2rem);
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    z-index: 800;
    overflow-y: auto;
    color: var(--color-text);
}

.map-sidebar__title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.map-sidebar__content {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.map-sidebar__content p {
    margin-bottom: 0.5rem;
}

.map-sidebar__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .map-sidebar {
        width: calc(100% - 2rem);
        top: auto;
        bottom: 1rem;
        max-height: 40%;
    }
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
    background: var(--color-secondary) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--glow-accent) !important;
}

.leaflet-popup-tip {
    background: var(--color-secondary) !important;
}

.leaflet-popup-content {
    font-family: var(--font-body) !important;
    font-size: 0.85rem !important;
}

.leaflet-popup-content strong {
    font-family: var(--font-heading);
    color: var(--color-accent);
}

/* ============================================================
   METRICS / TRACTION
   ============================================================ */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.metric {
    padding: 2rem 1rem;
}

.metric__value {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.metric__label {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   WAITLIST CTA SECTION
   ============================================================ */
.cta-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    text-align: center;
}

.cta-section__inner {
    max-width: 600px;
    margin: 0 auto;
}

.cta-section__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.cta-section__subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--color-secondary);
    border-top: 1px solid var(--color-border);
    padding: 4rem 2rem 2rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer__brand {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.footer__logo {
    height: 32px;
    width: auto;
}

.footer__tagline {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.footer__socials {
    display: flex;
    gap: 1rem;
}

.footer__socials a {
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

.footer__socials a:hover {
    color: var(--color-accent);
}

.footer__socials svg {
    width: 20px;
    height: 20px;
}

.footer__heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.footer__link-list {
    list-style: none;
}

.footer__link-list li {
    margin-bottom: 0.5rem;
}

.footer__link-list a {
    color: var(--color-text);
    font-size: 0.9rem;
}

.footer__link-list a:hover {
    color: var(--color-accent);
}

.footer__bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero__title {
        font-size: 2rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .problems,
    .pillars {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR USER MENU
   ═══════════════════════════════════════════════════════════════ */

/* Login button (unauthenticated) */
.navbar__login-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button, 4px);
    transition: all 0.2s ease;
}
.navbar__login-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* User button (authenticated) */
.navbar__user { position: relative; }

.navbar__user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button, 4px);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: all 0.2s ease;
}
.navbar__user-btn:hover,
.navbar__user-btn.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.navbar__user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown */
.navbar__user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--color-glass, rgba(13, 33, 55, 0.95));
    border: 1px solid var(--color-border);
    border-radius: 6px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    padding: 0.35rem 0;
}
.navbar__user-dropdown.open { display: block; }

.navbar__user-dropdown-header {
    padding: 0.5rem 0.85rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.25rem;
}

.navbar__user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}
.navbar__user-dropdown a:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}
.navbar__user-logout {
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
    padding-top: 0.45rem !important;
}
.navbar__user-logout:hover { color: #EF4444 !important; }

/* Mobile overlay divider */
.mobile-overlay__divider {
    width: 60%;
    height: 1px;
    background: var(--color-border);
    margin: 0.75rem auto;
}

/* ═══════════════════════════════════════════════════════════════
   INTELLIGENCE SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

/* Navbar toggle button — always visible for staff */
.navbar__intell-toggle {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--color-accent, #00D4FF);
    border-radius: var(--radius-button, 4px);
    background: rgba(0, 212, 255, 0.10);
    color: var(--color-accent, #00D4FF);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 10;
    white-space: nowrap;
}
.navbar__intell-toggle:hover {
    background: rgba(0, 212, 255, 0.20);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}
.navbar__intell-toggle.active {
    background: rgba(0, 212, 255, 0.22);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5);
}
.navbar__intell-toggle-label {
    display: none;
}
@media (min-width: 768px) {
    .navbar__intell-toggle-label { display: inline; }
}

/* Sidebar overlay (mobile backdrop) */
.intell-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}
.intell-sidebar-overlay.open { display: block; }

/* Sidebar panel — sits inside .shell__body flex row.
   VISIBLE by default (240px). .collapsed hides it. */
.intell-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--color-glass, rgba(13, 33, 55, 0.92));
    border-right: 1px solid var(--color-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
/* Transition only applies AFTER first paint (JS adds this class) */
.intell-sidebar.animated {
    transition: width 0.25s ease, min-width 0.25s ease, border-color 0.25s ease;
}
.intell-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right-color: transparent;
    overflow: hidden;
}

/* Close button */
.intell-sidebar__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.intell-sidebar__close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
}

/* Brand header */
.intell-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1.25rem 1rem;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
}

/* Section labels */
.intell-sidebar__section-label {
    padding: 0.75rem 1.25rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    user-select: none;
}

/* Navigation links */
.intell-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}
.intell-sidebar__link:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(0, 212, 255, 0.3);
}
.intell-sidebar__link.active {
    color: var(--color-accent);
    background: rgba(0, 212, 255, 0.06);
    border-left-color: var(--color-accent);
    font-weight: 500;
}
.intell-sidebar__link svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.intell-sidebar__link:hover svg,
.intell-sidebar__link.active svg {
    opacity: 1;
}

/* Sub-links (indented children, e.g. RSS/Telegram/X under Capture) */
.intell-sidebar__sublink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.25rem 0.35rem 2.6rem;
    font-size: 0.72rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    opacity: 0.8;
}
.intell-sidebar__sublink:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(0, 212, 255, 0.2);
    opacity: 1;
}
.intell-sidebar__sublink.active {
    color: var(--color-accent);
    background: rgba(0, 212, 255, 0.04);
    border-left-color: var(--color-accent);
    opacity: 1;
}
.intell-sidebar__sublink svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.intell-sidebar__sublink:hover svg,
.intell-sidebar__sublink.active svg {
    opacity: 1;
}

/* Mobile: sidebar starts collapsed, becomes fixed overlay when shown */
@media (max-width: 959px) {
    .intell-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 0 !important;
        min-width: 0 !important;
        z-index: 999;
        padding-top: 1rem;
        overflow: hidden;
    }
    /* On mobile, NOT collapsed = visible as overlay */
    .intell-sidebar:not(.collapsed) {
        width: 260px !important;
        min-width: 260px !important;
    }
    /* On mobile, start collapsed */
    .intell-sidebar { width: 0 !important; min-width: 0 !important; }
}

/* Pipeline LED indicator */
.led { font-size: 0.55rem; line-height: 1; vertical-align: middle; }
.led--green  { color: var(--color-success, #22c55e); }
.led--yellow { color: var(--color-warning, #eab308); }
.led--orange { color: #f97316; }
.led--red    { color: var(--color-error,   #ef4444); }
.led--grey   { color: var(--color-text-muted, #6b7280); }
