/* ServiceAlert.ai - Shared Design System */

/*
 * ── Z-INDEX STACKING ORDER ──────────────────────────────────────────
 *
 *  -1   Background decorations (hero gradients, bg shapes)
 *   1   Inline hover lifts (heatmap cells, calendar days)
 *   2   Chart overlays, demo overlays
 *  10   Tooltips, sticky sub-headers, floating elements
 *  50   Back-to-top button
 * 100   Navbar (default)
 * 101   Navbar dropdown menus
 * 150   Settings sidebar (mobile)
 * 175   Settings sidebar overlay (mobile)
 * 200   Settings tab bar (sticky)
 * 800   Map overlays (outage-map legend)
 * 900   Map panels (outage-map side panel, mobile drawer)
 * 999   Map floating search
 * 1000  Modals & overlays (brand, cert, dashboard, settings, alerts)
 * 1100  Nested modals (cert detail modal, map mobile filters)
 * 2000  Toast notifications
 * 9999  Temporary progress overlays
 * 10000 Skip-to-content link (accessibility, topmost)
 *
 * Rules:
 *  - Page-local z-index (1–10) can be used freely within components
 *  - Global overlays must use 1000+
 *  - Toasts must float above modals (2000)
 *  - Never exceed 10000 (reserved for skip link)
 */

/* Utility: hidden */
.hidden { display: none !important; }

/* Utility: table-responsive — wraps tables for horizontal scroll on small screens */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    list-style: none;
    margin: 0;
}
.breadcrumb a { color: var(--text-tertiary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { font-size: 0.7rem; opacity: 0.5; }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

/* Skip Link (accessibility) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* Focus Visible (keyboard accessibility) */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
/* Don't show focus ring on mouse clicks */
:focus:not(:focus-visible) {
    outline: none;
}

/* Screen Reader Only (visible to assistive tech, hidden visually) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global slim dark scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}
/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
[data-theme="light"] * {
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

/* Design Tokens */
:root {
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-subtle: rgba(59, 130, 246, 0.08);

    --status-operational: #34D399;
    --status-degraded: #E8A317;
    --status-partial: #E8742C;
    --status-major: #E5484D;
    --status-maintenance: #3B82F6;
    --status-unknown: #6B7280;

    /* Status glow shadows (dark theme) — bottom-left directional glow */
    --glow-operational: -4px 6px 14px rgba(16, 185, 129, 0.2);
    --glow-degraded: -4px 6px 14px rgba(232, 163, 23, 0.22);
    --glow-partial: -4px 6px 14px rgba(232, 116, 44, 0.25);
    --glow-major: -4px 6px 16px rgba(229, 72, 77, 0.3);
    --glow-maintenance: -4px 6px 14px rgba(59, 130, 246, 0.2);
    --glow-unknown: -2px 3px 8px rgba(107, 114, 128, 0.05);

    --glow-operational-hover: -5px 7px 18px rgba(16, 185, 129, 0.3);
    --glow-degraded-hover: -5px 7px 18px rgba(232, 163, 23, 0.32);
    --glow-partial-hover: -5px 7px 18px rgba(232, 116, 44, 0.35);
    --glow-major-hover: -5px 7px 20px rgba(229, 72, 77, 0.4);
    --glow-maintenance-hover: -5px 7px 18px rgba(59, 130, 246, 0.3);
    --glow-unknown-hover: -4px 6px 14px rgba(107, 114, 128, 0.1);

    --bg-primary: #0F0F11;
    --bg-secondary: #161618;
    --bg-tertiary: #1C1C1F;
    --bg-elevated: #222225;

    --text-primary: #FAFAF9;
    --text-secondary: #A0A0A8;
    --text-tertiary: #A8A8B0;

    --border-color: rgba(255, 255, 255, 0.10);
    --border-subtle: rgba(255, 255, 255, 0.05);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Spacing scale (4px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 72px;

    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;

    --success: #10B981;
    --success-light: #34D399;
    --error: #E5484D;
    --error-text: #f1a1a4;
    --accent-light: #60A5FA;
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #FAFAFA;
    --bg-secondary: #F4F4F5;
    --bg-tertiary: #E4E4E7;
    --bg-elevated: #D4D4D8;

    --text-primary: #111113;
    --text-secondary: #3F3F46;
    --text-tertiary: #52525B;

    --border-color: rgba(0, 0, 0, 0.13);
    --border-subtle: rgba(0, 0, 0, 0.07);

    --accent-subtle: rgba(59, 130, 246, 0.08);
    --error-text: #DC2626;
    --shadow-color: rgba(0, 0, 0, 0.08);

    --glow-operational: -3px 5px 12px rgba(16, 185, 129, 0.15);
    --glow-degraded: -3px 5px 12px rgba(232, 163, 23, 0.18);
    --glow-partial: -3px 5px 12px rgba(232, 116, 44, 0.2);
    --glow-major: -3px 5px 14px rgba(229, 72, 77, 0.25);
    --glow-maintenance: -3px 5px 12px rgba(59, 130, 246, 0.15);
    --glow-unknown: -2px 3px 6px rgba(107, 114, 128, 0.04);

    --glow-operational-hover: -5px 7px 18px rgba(16, 185, 129, 0.22);
    --glow-degraded-hover: -5px 7px 18px rgba(232, 163, 23, 0.26);
    --glow-partial-hover: -5px 7px 18px rgba(232, 116, 44, 0.28);
    --glow-major-hover: -5px 7px 20px rgba(229, 72, 77, 0.32);
    --glow-maintenance-hover: -5px 7px 18px rgba(59, 130, 246, 0.22);
    --glow-unknown-hover: -3px 5px 12px rgba(107, 114, 128, 0.08);
}

/* Typography & Layout */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
    font-size: 15px;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@supports (font-variation-settings: normal) {
    body {
        font-family: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Heading Scale */
h1, .h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; }
h2, .h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h3, .h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
h4, .h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
h5, .h5 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
h6, .h6 { font-size: 0.8125rem; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }

/* Responsive Typography */
@media (max-width: 768px) {
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.375rem; }
    h3, .h3 { font-size: 1.125rem; }
}

@media (max-width: 480px) {
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.25rem; }
}

/* Accessibility: Focus indicators for keyboard navigation */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Mobile touch targets (WCAG 2.5.8: min 44x44px) */
@media (max-width: 768px) {
    button, a.btn, .nav-link, .filter-tab, .nav-dropdown-item, .category-btn {
        min-height: 44px;
        min-width: 44px;
    }
    .nav-dropdown-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Navigation Bar (Pill Style) ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 17, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 200ms ease, border-color 200ms ease;
}
[data-theme="light"] .nav {
    background: rgba(250, 250, 250, 0.75);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navbar scroll behavior — compact + slightly more opaque */
.nav.scrolled {
    background: rgba(15, 15, 17, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .nav.scrolled {
    background: rgba(250, 250, 250, 0.88);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}
.nav.scrolled .nav-inner {
    height: 3.5rem;
}

.nav > .container {
    max-width: 1280px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
    gap: 12px;
    transition: height 200ms ease;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.nav-logo img {
    height: 44px;
    width: auto;
}

.nav-logo-light { display: none; }
.nav-logo-dark { display: inline-block; }
[data-theme="light"] .nav-logo-light { display: inline-block; }
[data-theme="light"] .nav-logo-dark { display: none; }

/* Center nav container */
.nav-center {
    flex: 1;
    display: none;
    justify-content: center;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 100%;
}

/* Nav links — flat text style */
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    padding: 6px 11px;
    border-radius: 0;
    transition: color 150ms ease;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
    background: none;
}
[data-theme="light"] .nav-link:hover {
    color: rgba(0, 0, 0, 0.75);
    background: none;
}

.nav-link.active {
    color: var(--text-primary);
    font-weight: 600;
    background: none;
}
[data-theme="light"] .nav-link.active {
    color: var(--text-primary);
    background: none;
}

/* Active link bottom indicator */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.nav-link.active:hover {
    color: var(--text-primary);
    background: none;
}
[data-theme="light"] .nav-link.active:hover {
    color: var(--text-primary);
    background: none;
}

/* Dashboard CTA link (blue text when not active) */
.nav-link-cta:not(.active) {
    color: var(--accent);
}

/* Dropdown inside pill */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > .nav-link::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 4px;
    vertical-align: 2px;
    transition: transform 0.2s;
}

/* Active dropdown: keep chevron on ::after, render underline via ::before
   (avoids the ::after collision that produced a blue diamond marker) */
.nav-dropdown > .nav-link.active::after {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    background: transparent;
    border-radius: 0;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}
.nav-dropdown > .nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.nav-dropdown-content {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(22, 22, 24, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    min-width: 200px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
    pointer-events: none;
}
[data-theme="light"] .nav-dropdown-content {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Invisible bridge to prevent gap hover loss */
.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    width: 100%;
    height: 16px;
}

.nav-dropdown:hover > .nav-dropdown-content,
.nav-dropdown:focus-within > .nav-dropdown-content,
.nav-dropdown.touch-open > .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.nav-dropdown-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}
[data-theme="light"] .nav-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.nav-dropdown-item.disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* What's New dot on Changelog link */
a.nav-dropdown-item[href="/changelog"]::after {
    content: ''; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: #10B981; margin-left: 6px; vertical-align: middle;
}

.nav-dropdown-label {
    display: block;
    padding: 8px 16px 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    cursor: default;
}

.nav-dropdown-label:not(:first-child) {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 12px;
}

/* 2-column dropdown (Services) */
.nav-dropdown-2col {
    display: flex;
    gap: 0;
    min-width: 380px;
    padding: 6px;
}

.nav-dropdown-2col .nav-dropdown-col {
    flex: 1;
    min-width: 0;
}

.nav-dropdown-2col .nav-dropdown-col:first-child {
    border-right: 1px solid var(--border-color);
    padding-right: 6px;
}

.nav-dropdown-2col .nav-dropdown-col:last-child {
    padding-left: 6px;
}

.nav-dropdown-2col .nav-dropdown-label:first-child {
    padding-top: 8px;
}

/* Right actions zone */
.nav-actions {
    display: none;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-auth-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.nav-auth-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .nav-auth-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-cta {
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.nav-cta:hover {
    background: var(--accent-hover);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .user-menu-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(22, 22, 24, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    min-width: 200px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
    pointer-events: none;
}
[data-theme="light"] .user-menu-dropdown {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.user-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    right: 0;
    width: 100%;
    height: 12px;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-menu-header {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.user-menu-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.user-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Mobile toggle */
.mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    transition: background 0.2s, border-color 0.2s;
}

.mobile-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.mobile-toggle .icon-close { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-open { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    background: rgba(15, 15, 17, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 16px 24px;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
[data-theme="light"] .mobile-menu {
    background: rgba(250, 250, 250, 0.95);
    border-top-color: rgba(0, 0, 0, 0.06);
}

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

.mobile-menu > .nav-link {
    display: block;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9375rem;
    white-space: normal;
}

.mobile-menu > .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mobile-menu > .nav-link.active {
    color: var(--accent);
    background: none;
    font-weight: 600;
}

.mobile-menu .nav-link-cta:not(.active) {
    color: var(--accent);
}

/* Mobile accordion dropdowns */
.mobile-menu .nav-dropdown {
    border-top: 1px solid var(--border-color);
}

.mobile-menu .nav-dropdown:last-of-type {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.mobile-menu .nav-dropdown > .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    border-radius: 0;
    font-size: 0.9375rem;
}

.mobile-menu .nav-dropdown > .nav-link::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.mobile-menu .nav-dropdown.expanded > .nav-link::after {
    transform: rotate(-135deg);
}

.mobile-menu .nav-dropdown-content {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 4px 0 8px;
    min-width: auto;
    transform: none;
    border-top: 1px solid var(--border-color);
}

/* Flatten 2-column dropdown in mobile */
.mobile-menu .nav-dropdown-2col {
    display: block;
    min-width: auto;
}

.mobile-menu .nav-dropdown-2col .nav-dropdown-col {
    border-right: none !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.mobile-menu .nav-dropdown.expanded > .nav-dropdown-content {
    display: block;
}

/* Override desktop hover in mobile menu */
.mobile-menu .nav-dropdown:hover > .nav-dropdown-content,
.mobile-menu .nav-dropdown:focus-within > .nav-dropdown-content {
    display: none;
}

.mobile-menu .nav-dropdown.expanded:hover > .nav-dropdown-content,
.mobile-menu .nav-dropdown.expanded:focus-within > .nav-dropdown-content {
    display: block;
}

.mobile-menu .nav-dropdown-item {
    padding: 10px 12px 10px 24px;
    font-size: 0.875rem;
}

.mobile-menu .nav-dropdown-label {
    padding: 10px 12px 4px 24px;
    font-size: 0.625rem;
}

.mobile-menu .nav-dropdown-label:not(:first-child) {
    margin-top: 2px;
    padding-top: 10px;
}

/* Mobile auth section */
.mobile-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.mobile-auth .theme-toggle {
    margin-right: auto;
}

/* Desktop breakpoint */
@media (min-width: 961px) {
    .nav-center { display: flex; }
    .nav-actions { display: flex; }
    .mobile-toggle { display: none; }
    .mobile-menu { display: none !important; }
}

@media (max-width: 480px) {
    .nav-logo img { height: 36px; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    border: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-primary {
    background: var(--accent);
    border: 1px solid transparent;
    color: white;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 1px 3px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .btn-secondary:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.02);
}

.btn:active {
    transform: scale(0.98);
    transition-duration: 50ms;
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.6875rem;
    gap: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 10px 22px;
    font-size: 0.9375rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.badge-error { background: rgba(239, 68, 68, 0.12); color: #EF4444; }
.badge-info { background: rgba(59, 130, 246, 0.12); color: var(--accent); }

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: rgba(229, 72, 77, 0.08);
    border: 1px solid rgba(229, 72, 77, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--error-text);
}

/* Footer */
.footer {
    background: #0C0C0E;
    color: #FAFAF9;
    padding: 4rem 0 1.5rem;
    margin-top: 72px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Force dark-mode colors inside footer regardless of theme */
    --text-primary: #FAFAF9;
    --text-secondary: #A8A8B0;
    --text-tertiary: #71717A;
    --bg-primary: #0C0C0E;
    --bg-secondary: #18181B;
    --bg-tertiary: #27272A;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent: #3B82F6;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand img {
    height: 3.5rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.65;
    max-width: 18rem;
}

.footer-col .footer-heading {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col a {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 0.2rem 0;
    transition: color var(--transition-fast);
}

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

/* Footer Newsletter */
.footer-newsletter {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-newsletter .footer-heading {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.footer-newsletter > p,
.footer-newsletter-text p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0;
}
.footer-newsletter-form {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.footer-newsletter-form input {
    padding: 8px 14px;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    width: 240px;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}
.footer-newsletter-form input::placeholder { color: #52525B; }
.footer-newsletter-form input:focus { border-color: var(--accent); }
.footer-newsletter-form .btn { padding: 8px 18px; font-size: 0.8125rem; white-space: nowrap; }
.footer-newsletter-status {
    width: 100%;
    font-size: 0.8125rem;
    margin-top: 4px;
}
.footer-newsletter-status.success { color: var(--success); }
.footer-newsletter-status.error { color: var(--error-text); }
@media (max-width: 768px) {
    .footer-newsletter { flex-direction: column; text-align: center; }
    .footer-newsletter-form { width: 100%; }
    .footer-newsletter-form input { flex: 1; width: auto; }
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.footer-bottom a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.footer-bottom a[href*="cia.dev"] {
    color: var(--accent);
}

.footer-bottom a[href*="cia.dev"]:hover {
    color: var(--accent-hover);
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Marketing Page Shared Styles */
.hero {
    text-align: center;
    padding: 72px 0 56px;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 650;
    letter-spacing: -0.035em;
    margin-bottom: 20px;
    line-height: 1.08;
}

.hero .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.65;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.section {
    padding: var(--space-3xl) 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

.cta-section {
    text-align: center;
    padding: 72px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
    border-top: 1px solid var(--border-color);
}

.cta-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1.0625rem;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Focus States */
.btn:focus,
.nav-link:focus,
.nav-dropdown-item:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* Show sun icon in dark mode, moon icon in light mode */
.theme-icon-light { display: block; }
.theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: block; }


/* Responsive - Shared */
@media (max-width: 768px) {
    .btn {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Category Dropdown */
.category-dropdown {
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s;
}

.category-dropdown:hover,
.category-dropdown:focus {
    border-color: var(--accent);
    outline: none;
}

.directory-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.directory-controls .directory-search {
    flex: 1;
}

/* Skeleton Loading Animation */
@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.skeleton {
    background: var(--bg-tertiary);
    border-radius: 6px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
}

/* Search no-results message */
.no-results-message {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

.no-results-message svg {
    display: block;
    margin: 0 auto 12px;
    opacity: 0.5;
}

/* Share buttons (reusable) */
.share-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.share-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.share-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}
.share-btn:active {
    transform: scale(0.95);
}

/* Dashboard empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.empty-state-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Auth error banner */
.auth-error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--error-text);
    font-size: 0.875rem;
    text-align: center;
    margin: 16px 24px;
    display: none;
}

.auth-error-banner a {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Incident AI Summary block */
.incident-ai-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 32px;
}

.incident-ai-summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.incident-ai-summary p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* Tool page "Why use this?" intro */
.tool-why {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 8px auto 0;
}

/* ── Print Stylesheet ─────────────────────────────────────────────── */
@media print {
    /* Hide non-content elements */
    .nav, .footer, .skip-link,
    .mobile-menu, .mobile-menu-toggle,
    .back-to-top, .btn, button,
    .user-menu, .nav-auth-btn,
    .tool-seo, .cta-buttons,
    .features-cta, .pricing-cta {
        display: none !important;
    }

    /* Reset backgrounds and colors for ink savings */
    body {
        background: #fff !important;
        color: #111 !important;
        font-size: 11pt;
    }

    *, *::before, *::after {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Preserve status colors */
    .check-icon { color: #059669 !important; }
    .dash-icon { color: #999 !important; }

    /* Full-width layout */
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Show link URLs */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
        word-break: break-all;
    }
    a[href^="/"]::after,
    .nav a::after,
    .footer a::after {
        content: none;
    }

    /* Avoid breaks inside cards/rows */
    .pricing-card, .finding-row, .cert-row,
    .comparison-table tr, .monitor-demo-row {
        break-inside: avoid;
    }

    /* Tables: keep header visible */
    thead { display: table-header-group; }
}
