/* ================================================================
   DispatchDB — Glass Command / 2026
   Aurora mesh, grain texture, gradient borders, alive.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ----------------------------------------------------------------
   Tokens
   ---------------------------------------------------------------- */
:root {
    --bg-deep:    #08090e;
    --bg-primary: #0c0d14;
    --bg-elevated:rgba(18,20,30,0.65);
    --bg-surface: rgba(24,27,40,0.6);
    --bg-hover:   rgba(32,36,55,0.7);

    --border-subtle:  rgba(255,255,255,0.04);
    --border-default: rgba(255,255,255,0.06);
    --border-active:  rgba(255,140,50,0.3);

    --text-primary:   #f0f1f5;
    --text-secondary: #848c9e;
    --text-muted:     #42475a;

    --accent:        #ff8c32;
    --accent-hover:  #ff7a18;
    --accent-soft:   rgba(255,140,50,0.08);
    --accent-mid:    rgba(255,140,50,0.18);

    --rose:          #e54086;
    --rose-soft:     rgba(229,64,134,0.06);

    --signal:        #00d4ff;
    --signal-soft:   rgba(0,212,255,0.08);

    --red:     #ff4757;
    --orange:  #ff8c32;
    --yellow:  #ffbe0b;
    --green:   #06d6a0;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --font-display: 'Syne', system-ui, sans-serif;
    --font-body:    'Outfit', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    --container: 1140px;

    --shadow-card:  0 1px 2px rgba(0,0,0,0.4), 0 4px 20px rgba(0,0,0,0.15);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,140,50,0.06);
    --shadow-glow:  0 0 80px rgba(255,140,50,0.06);
}


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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 15px;
    position: relative;
    overflow-x: hidden;
}

/* Aurora gradient mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 60% at 10% 10%, rgba(255,140,50,0.045) 0%, transparent 100%),
        radial-gradient(ellipse 40% 50% at 90% 20%, rgba(0,160,255,0.035) 0%, transparent 100%),
        radial-gradient(ellipse 35% 45% at 50% 80%, rgba(229,64,134,0.025) 0%, transparent 100%),
        radial-gradient(ellipse 60% 35% at 70% 50%, rgba(100,80,220,0.02) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Noise grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.025;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

body > * { position: relative; z-index: 1; }

::selection { background: rgba(255,140,50,0.3); color: #fff; }

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

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

code, .mono { font-family: var(--font-mono); font-size: 0.85em; }


/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

h1 { font-weight: 700; font-size: 1.75rem; }
h2 { font-weight: 600; font-size: 1.15rem; }
h3 { font-weight: 600; font-size: 1.05rem; }

small { font-size: 0.8em; }


/* ----------------------------------------------------------------
   Layout
   ---------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }


/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8,9,14,0.75);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding: 0;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 20%,
        var(--rose) 40%,
        var(--signal) 60%,
        var(--accent) 80%,
        transparent 100%
    );
    opacity: 0.3;
    background-size: 300% 100%;
    animation: header-shimmer 10s ease-in-out infinite;
}

@keyframes header-shimmer {
    0%, 100% { background-position: 0% 0; opacity: 0.25; }
    50%      { background-position: 100% 0; opacity: 0.4; }
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    transition: opacity 0.2s;
}
.logo:hover { color: var(--text-primary); opacity: 0.85; }
.logo-mark { flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(255,140,50,0.3)); }
.logo-accent { color: var(--accent); }

/* Navigation */
.main-nav { display: flex; align-items: center; gap: 0.15rem; }

.main-nav a,
.main-nav button.nav-link {
    position: relative;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.main-nav a:hover,
.main-nav button.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.nav-link { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.nav-link:hover { color: var(--text-primary); }

.user-nav { display: flex; align-items: center; gap: 0.5rem; }
.user-nav .user-name { color: var(--text-secondary); font-size: 0.85rem; }


/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}


/* ----------------------------------------------------------------
   Dev Banner
   ---------------------------------------------------------------- */
.dev-banner {
    background: linear-gradient(90deg, rgba(255,190,11,0.06), rgba(255,140,50,0.08), rgba(255,190,11,0.06));
    border-bottom: 1px solid rgba(255,190,11,0.12);
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--yellow);
    letter-spacing: 0.03em;
}


/* ----------------------------------------------------------------
   Hero
   ---------------------------------------------------------------- */
.hero {
    position: relative;
    text-align: center;
    padding: 5rem 0 3.5rem;
    overflow: visible;
}

/* Animated ambient orb */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: conic-gradient(
        from 180deg,
        rgba(255,140,50,0.06),
        rgba(229,64,134,0.04),
        rgba(0,160,255,0.05),
        rgba(100,80,220,0.03),
        rgba(255,140,50,0.06)
    );
    border-radius: 50%;
    filter: blur(100px);
    animation: hero-glow 15s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes hero-glow {
    0%, 100% { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 0.7; }
    33%      { transform: translateX(-50%) scale(1.1) rotate(120deg); opacity: 1; }
    66%      { transform: translateX(-50%) scale(0.95) rotate(240deg); opacity: 0.8; }
}

.hero-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    padding: 0.3rem 0.9rem;
    border: 1px solid rgba(255,140,50,0.2);
    border-radius: 100px;
    background: rgba(255,140,50,0.05);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
    line-height: 1.08;
    background: linear-gradient(
        135deg,
        var(--text-primary) 0%,
        var(--text-primary) 50%,
        var(--accent) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-live {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.75rem;
    padding: 0.45rem 1.1rem;
    background: var(--signal-soft);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--signal);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(0,212,255,0.05);
}


/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */
section { margin-top: 3rem; }

section h2 {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}


/* ----------------------------------------------------------------
   Breadcrumb
   ---------------------------------------------------------------- */
.breadcrumb {
    padding: 1.25rem 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); opacity: 0.4; font-size: 0.7rem; }


/* ----------------------------------------------------------------
   Glass Card Mixin (shared)
   ---------------------------------------------------------------- */
.region-card, .county-card, .incident-card, .page-entry,
.auth-card, .account-section, .admin-section, .stat-card, .incident-info {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}

/* Gradient top border on all glass cards */
.region-card::before, .county-card::before, .incident-info::before,
.auth-card::before, .account-section::before, .admin-section::before,
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,140,50,0.25) 30%,
        rgba(0,212,255,0.15) 70%,
        transparent 100%
    );
    z-index: 2;
}


/* ----------------------------------------------------------------
   Cards — Grid: Regions & Counties
   ---------------------------------------------------------------- */
.region-grid, .county-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.85rem;
}

.region-card, .county-card {
    padding: 1.3rem 1.4rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.region-card:hover, .county-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-active);
    box-shadow: var(--shadow-hover), 0 0 40px rgba(255,140,50,0.04);
    transform: translateY(-3px);
    color: var(--text-primary);
}

.region-card h3, .county-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.region-abbr {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.county-stats {
    color: var(--text-muted);
    font-size: 0.72rem;
    display: flex;
    gap: 1rem;
    margin-top: 0.35rem;
    font-family: var(--font-mono);
}


/* ----------------------------------------------------------------
   Feed Header
   ---------------------------------------------------------------- */
.feed-header {
    padding: 1.75rem 0 1rem;
}

.feed-header h1 {
    margin-bottom: 0.3rem;
}

.feed-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* ----------------------------------------------------------------
   Live Indicator — Sonar
   ---------------------------------------------------------------- */
.live-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--signal);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,212,255,0.6), 0 0 20px rgba(0,212,255,0.2);
}

.live-dot::before,
.live-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--signal);
    transform: translate(-50%, -50%);
    animation: sonar 3s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.live-dot::after { animation-delay: 1.5s; }

.live-dot.connected { background: var(--signal); }

@keyframes sonar {
    0%   { width: 8px; height: 8px; opacity: 0.8; }
    100% { width: 40px; height: 40px; opacity: 0; }
}


/* ----------------------------------------------------------------
   Feed Notification
   ---------------------------------------------------------------- */
.feed-notification {
    background: linear-gradient(90deg, rgba(255,140,50,0.06), rgba(255,140,50,0.1), rgba(255,140,50,0.06));
    border: 1px solid rgba(255,140,50,0.15);
    border-radius: var(--radius);
    padding: 0.8rem;
    text-align: center;
    margin-bottom: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.feed-notification button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
}
.feed-notification button:hover { text-decoration: underline; }


/* ----------------------------------------------------------------
   Incident Cards (Feed)
   ---------------------------------------------------------------- */
.incident-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.incident-card {
    display: block;
    border-left: 3px solid var(--text-muted);
    padding: 1rem 1.3rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.incident-card::before { display: none; }

.incident-card:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: var(--text-primary);
}

/* Severity left borders + glow */
.incident-card.severity-critical {
    border-left-color: var(--red);
    box-shadow: var(--shadow-card), inset 4px 0 16px -6px rgba(255,71,87,0.12);
}
.incident-card.severity-major    { border-left-color: var(--orange); }
.incident-card.severity-moderate { border-left-color: var(--yellow); }
.incident-card.severity-minor    { border-left-color: var(--text-muted); }

/* Critical pulse */
.incident-card.severity-critical::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--red);
    animation: critical-pulse 2s ease-in-out infinite;
}

@keyframes critical-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255,71,87,0.3); }
    50%      { box-shadow: 0 0 12px rgba(255,71,87,0.6); }
}

.incident-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
}

.incident-category {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
}

.incident-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.incident-headline {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
}

.incident-location {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.45rem;
}

.incident-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.incident-agencies { color: var(--text-secondary); font-size: 0.8rem; }
.incident-county   { color: var(--text-secondary); font-size: 0.8rem; }


/* ----------------------------------------------------------------
   Staggered Load Animation
   ---------------------------------------------------------------- */
.region-grid > *,
.county-grid > *,
.incident-list > * {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.region-grid > *:nth-child(1), .county-grid > *:nth-child(1), .incident-list > *:nth-child(1)  { animation-delay: 0.04s; }
.region-grid > *:nth-child(2), .county-grid > *:nth-child(2), .incident-list > *:nth-child(2)  { animation-delay: 0.08s; }
.region-grid > *:nth-child(3), .county-grid > *:nth-child(3), .incident-list > *:nth-child(3)  { animation-delay: 0.12s; }
.region-grid > *:nth-child(4), .county-grid > *:nth-child(4), .incident-list > *:nth-child(4)  { animation-delay: 0.16s; }
.region-grid > *:nth-child(5), .county-grid > *:nth-child(5), .incident-list > *:nth-child(5)  { animation-delay: 0.20s; }
.region-grid > *:nth-child(6), .county-grid > *:nth-child(6), .incident-list > *:nth-child(6)  { animation-delay: 0.24s; }
.region-grid > *:nth-child(7), .county-grid > *:nth-child(7), .incident-list > *:nth-child(7)  { animation-delay: 0.28s; }
.region-grid > *:nth-child(8), .county-grid > *:nth-child(8), .incident-list > *:nth-child(8)  { animation-delay: 0.32s; }
.region-grid > *:nth-child(9), .county-grid > *:nth-child(9), .incident-list > *:nth-child(9)  { animation-delay: 0.36s; }
.region-grid > *:nth-child(10), .county-grid > *:nth-child(10), .incident-list > *:nth-child(10) { animation-delay: 0.40s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ----------------------------------------------------------------
   Status & Severity Badges
   ---------------------------------------------------------------- */
.incident-status {
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
}

.status-active     { color: var(--green); background: rgba(6,214,160,0.1); }
.status-controlled { color: var(--yellow); background: rgba(255,190,11,0.1); }
.status-cleared    { color: var(--text-secondary); background: rgba(132,140,158,0.08); }
.status-closed     { color: var(--text-muted); background: rgba(66,71,90,0.12); }

.severity-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
}

.severity-critical { background: rgba(255,71,87,0.12); color: var(--red); }
.severity-major    { background: rgba(255,140,50,0.12); color: var(--orange); }
.severity-moderate { background: rgba(255,190,11,0.12); color: var(--yellow); }
.severity-minor    { background: rgba(66,71,90,0.15); color: var(--text-secondary); }


/* ----------------------------------------------------------------
   Incident Detail
   ---------------------------------------------------------------- */
.incident-detail {
    padding-top: 0.5rem;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.incident-header { margin-bottom: 2rem; }
.incident-header .incident-meta {
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.incident-header h1 {
    font-size: 1.65rem;
    margin-bottom: 0.3rem;
}
.incident-id {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.incident-body { display: flex; flex-direction: column; gap: 1.75rem; }

.incident-info {
    padding: 0.25rem 1.4rem;
}

.info-row {
    display: flex;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-muted);
    width: 130px;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 0.1rem;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.incident-description { color: var(--text-secondary); line-height: 1.8; }

.incident-description h2, .incident-pages h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: none;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
}


/* ----------------------------------------------------------------
   Page Entries (Dispatch History)
   ---------------------------------------------------------------- */
.incident-pages { margin-top: 0.5rem; }

.page-entry {
    padding: 1.1rem 1.3rem;
    margin-bottom: 0.65rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.page-entry::before { display: none; }
.page-entry:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-hover);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.page-type {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.page-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.page-headline { font-weight: 600; margin-bottom: 0.4rem; font-size: 0.95rem; }

.page-transcript {
    position: relative;
    background: rgba(8,9,14,0.5);
    border-left: 2px solid var(--accent);
    padding: 0.9rem 1.15rem;
    margin: 0.5rem 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.75;
}

.page-agencies {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.8rem;
}


/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, var(--accent) 0%, #e06820 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,140,50,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #cc5a18 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,140,50,0.2), 0 0 0 1px rgba(255,140,50,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
}

.btn-full { width: 100%; text-align: center; padding: 0.75rem; font-size: 0.95rem; }

.btn-danger {
    background: linear-gradient(135deg, var(--red) 0%, #d03040 100%);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #e8303f 0%, #c02838 100%);
    box-shadow: 0 4px 16px rgba(255,71,87,0.2);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.1);
    box-shadow: none;
    transform: translateY(-1px);
}


/* ----------------------------------------------------------------
   Forms
   ---------------------------------------------------------------- */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: rgba(8,9,14,0.5);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,140,50,0.08), 0 0 20px rgba(255,140,50,0.04);
}

.form-group input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.required { color: var(--red); }


/* ----------------------------------------------------------------
   Auth Pages
   ---------------------------------------------------------------- */
.auth-wrapper {
    max-width: 440px;
    margin: 3.5rem auto;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), 0 0 120px rgba(255,140,50,0.03), 0 0 60px rgba(0,212,255,0.02);
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}


/* ----------------------------------------------------------------
   Alerts
   ---------------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(255,71,87,0.08);
    color: var(--red);
    border: 1px solid rgba(255,71,87,0.15);
}

.alert-success {
    background: rgba(6,214,160,0.08);
    color: var(--green);
    border: 1px solid rgba(6,214,160,0.15);
}


/* ----------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.pagination-info {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}


/* ----------------------------------------------------------------
   Empty & Error States
   ---------------------------------------------------------------- */
.empty-section, .empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem 1rem;
    font-size: 0.95rem;
}

.error-page {
    text-align: center;
    padding: 6rem 1rem;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.error-page h1 {
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-muted) 0%, var(--accent) 50%, var(--rose) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}


/* ----------------------------------------------------------------
   Account Pages
   ---------------------------------------------------------------- */
.account-section {
    padding: 1.5rem 1.6rem;
    margin-bottom: 1.25rem;
}

.account-section h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    border-bottom: none;
    padding-bottom: 0;
}


/* ----------------------------------------------------------------
   Admin: Dashboard
   ---------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent) 0%, #e06820 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.35rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.admin-section {
    padding: 1.3rem 1.4rem;
    margin-bottom: 1rem;
}

.admin-section h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: none;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
}


/* ----------------------------------------------------------------
   Admin: Tables
   ---------------------------------------------------------------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.admin-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.admin-table tr {
    transition: background 0.15s;
}
.admin-table tr:hover { background: rgba(255,255,255,0.02); }

.admin-table code {
    color: var(--accent);
    font-size: 0.8em;
}

.admin-table a { font-weight: 500; }


/* ----------------------------------------------------------------
   Queue & Processing Badges
   ---------------------------------------------------------------- */
.queue-stats { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }

.queue-stat {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.22rem 0.6rem;
    border-radius: 100px;
}

.status-badge-pending    { background: rgba(255,190,11,0.08); color: var(--yellow); }
.status-badge-processing { background: rgba(0,212,255,0.08); color: var(--signal); }
.status-badge-complete   { background: rgba(6,214,160,0.08); color: var(--green); }
.status-badge-failed     { background: rgba(255,71,87,0.08); color: var(--red); }


/* ----------------------------------------------------------------
   Filter Bar
   ---------------------------------------------------------------- */
.filter-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}


/* ----------------------------------------------------------------
   Inline Admin Controls
   ---------------------------------------------------------------- */
.inline-select {
    background: rgba(8,9,14,0.5);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.78rem;
    transition: border-color 0.2s;
}
.inline-select:focus { border-color: var(--accent); outline: none; }

.inline-input {
    background: rgba(8,9,14,0.5);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.83rem;
    width: 100%;
    min-width: 200px;
    transition: border-color 0.2s;
}
.inline-input:focus { border-color: var(--accent); outline: none; }


/* ----------------------------------------------------------------
   About Page
   ---------------------------------------------------------------- */
.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding-top: 1rem;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.about-page .about-tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border-bottom: none;
}

.about-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.about-section p:last-child { margin-bottom: 0; }

.about-section a { font-weight: 500; }

/* Pipeline steps */
.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.pipeline-step {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}

.pipeline-step::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,140,50,0.2), transparent);
}

.pipeline-step-num {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
}

.pipeline-step-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.pipeline-step-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Stat highlight row */
.about-stat-row {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.about-stat {
    text-align: center;
}

.about-stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), var(--rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-stat-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.15rem;
}

.about-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 2.5rem 0;
}

.about-footer-note {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.7;
    margin-top: 1rem;
}


/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    :root { --container: 100%; }

    body { font-size: 14px; }

    .site-header .container { height: 50px; }

    .main-nav { gap: 0; }
    .main-nav a, .main-nav button.nav-link {
        padding: 0.35rem 0.45rem;
        font-size: 0.78rem;
    }

    .hero { padding: 3rem 0 2rem; }
    .hero h1 { font-size: 2rem; }
    .hero::before { width: 350px; height: 350px; }
    .hero-sub { font-size: 0.95rem; }

    .region-grid, .county-grid { grid-template-columns: 1fr; }

    .info-row { flex-direction: column; }
    .info-label { width: auto; margin-bottom: 0.1rem; }

    .incident-header h1 { font-size: 1.25rem; }

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

    .stats-grid { grid-template-columns: repeat(3, 1fr); }

    .form-row { grid-template-columns: 1fr; }

    .admin-table { font-size: 0.72rem; }
    .admin-table th, .admin-table td { padding: 0.4rem 0.5rem; }

    .about-page h1 { font-size: 1.6rem; }
    .pipeline-steps { grid-template-columns: 1fr 1fr; }
    .about-stat-row { gap: 1rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-label { font-size: 0.6rem; }

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

    .logo { font-size: 1.05rem; }

    .site-header .container { height: 46px; }

    .error-page h1 { font-size: 5rem; }
}


/* ----------------------------------------------------------------
   Scrollbar
   ---------------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
