/* ═══════════════════════════════════════════════════════════
   main.css — IoT Emergency Platform Design System
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Design Tokens) ──────────────── */
:root {
    /* Colors */
    --color-bg:         #0a0e1a;
    --color-surface:    #111827;
    --color-surface2:   #1c2535;
    --color-border:     #1e2d45;
    --color-accent:     #00c2ff;
    --color-accent2:    #ff6b35;
    --color-success:    #00e57a;
    --color-warning:    #ffb300;
    --color-danger:     #ff2d55;
    --color-text:       #e8edf5;
    --color-text-muted: #7a8fa6;
    
    /* Typography */
    --font-display: 'Exo 2', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
    
    /* Layout */
    --nav-height:     60px;
    --submenu-width:  220px;
    --panel-padding:  32px;
    
    /* Radius */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 100px;
    
    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 24px rgba(0,194,255,0.2);
}

/* ── 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-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    /* Circuit-board background pattern */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 40h80M40 0v80' stroke='%231e2d45' stroke-width='0.5' fill='none'/%3E%3Ccircle cx='40' cy='40' r='1.5' fill='%231e2d45'/%3E%3Ccircle cx='0' cy='0' r='1.5' fill='%231e2d45'/%3E%3Ccircle cx='80' cy='0' r='1.5' fill='%231e2d45'/%3E%3Ccircle cx='0' cy='80' r='1.5' fill='%231e2d45'/%3E%3Ccircle cx='80' cy='80' r='1.5' fill='%231e2d45'/%3E%3Cpath d='M0 0h20M60 0h20M0 80h20M60 80h20M0 0v20M0 60v20M80 0v20M80 60v20' stroke='%231e2d45' stroke-width='0.3' fill='none'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated drift glow */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse 80vw 60vh at 50% 40%,
        rgba(0,194,255,0.04) 0%, transparent 70%);
    animation: driftGlow 20s ease-in-out infinite;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 150ms ease;
}
a:hover {
    color: #33d4ff;
}

img { max-width: 100%; display: block; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 16px; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); margin-bottom: 14px; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); margin-bottom: 12px; }
h4 { font-size: 1.1rem; margin-bottom: 10px; }

p { margin-bottom: 12px; color: var(--color-text-muted); }

.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }
.text-muted   { color: var(--color-text-muted); }

code, .mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: rgba(0,194,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-accent);
}

/* ── Top Navigation Bar ──────────────────────────────────── */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--color-text); }
.logo-accent { color: var(--color-accent); }
.logo-icon { flex-shrink: 0; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-item {
    padding: 8px 14px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color 150ms, background 150ms;
    white-space: nowrap;
    position: relative;
}
.nav-item:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.04);
}
.nav-item.active {
    color: var(--color-accent);
    background: rgba(0,194,255,0.08);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--dur-fast, 150ms) cubic-bezier(0.16,1,0.3,1),
                box-shadow var(--dur-fast, 150ms) cubic-bezier(0.16,1,0.3,1),
                background var(--dur-fast, 150ms) cubic-bezier(0.16,1,0.3,1);
    text-decoration: none;
    line-height: 1;
}
.btn:active {
    transform: scale(0.96);
    box-shadow: none;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 0 24px rgba(0,194,255,0.35);
}
.btn-primary:hover {
    color: #fff;
    box-shadow: 0 0 36px rgba(0,194,255,0.55);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.btn-ghost:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
    background: rgba(0,194,255,0.06);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 0 16px rgba(255,45,85,0.3);
}

.btn-success {
    background: var(--color-success);
    color: #0a0e1a;
    box-shadow: 0 0 16px rgba(0,229,122,0.3);
}

.btn-warning {
    background: var(--color-warning);
    color: #0a0e1a;
}

/* Hero buttons */
.btn-hero-primary {
    padding: 14px 32px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #00c2ff, #0080ff);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 0 32px rgba(0,194,255,0.4), 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 150ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 300ms cubic-bezier(0.16,1,0.3,1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-hero-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 52px rgba(0,194,255,0.65), 0 16px 40px rgba(0,0,0,0.4);
    color: #fff;
}

.btn-hero-secondary {
    padding: 14px 32px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: border-color 150ms, background 150ms,
                transform 150ms cubic-bezier(0.34,1.56,0.64,1);
}
.btn-hero-secondary:hover {
    border-color: var(--color-accent);
    background: rgba(0,194,255,0.06);
    transform: translateY(-2px);
    color: var(--color-text);
}

/* ── App Layout (3-panel) ────────────────────────────────── */
.app-layout {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
    position: relative;
    z-index: 1;
}

.full-content {
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
}

/* ── Left Submenu Rail ───────────────────────────────────── */
.submenu-rail {
    width: var(--submenu-width);
    min-width: var(--submenu-width);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--color-border);
    height: calc(100vh - var(--nav-height));
    position: sticky;
    top: var(--nav-height);
    overflow-y: auto;
    z-index: 50;
    animation: slideInLeft 300ms cubic-bezier(0.16,1,0.3,1) forwards;
}

.submenu-header {
    padding: 20px 20px 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.submenu-nav {
    display: flex;
    flex-direction: column;
    padding: 0 8px 20px;
    gap: 2px;
}

.submenu-item {
    padding: 10px 14px;
    color: var(--color-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color 150ms, background 150ms, padding-left 200ms;
    display: flex;
    align-items: center;
    gap: 10px;
}
.submenu-item:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.04);
    padding-left: 18px;
}
.submenu-item.active {
    color: var(--color-accent);
    background: rgba(0,194,255,0.08);
    border-left: 2px solid var(--color-accent);
}

/* ── Right Content Panel ─────────────────────────────────── */
.right-panel {
    flex: 1;
    min-width: 0;
    padding: var(--panel-padding);
    overflow-y: auto;
    min-height: calc(100vh - var(--nav-height));
}

/* Right panel mandatory components */
.rp-header {
    margin-bottom: 28px;
}
.rp-header h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin-bottom: 8px;
}
.breadcrumb {
    font-size: 13px;
    color: var(--color-text-muted);
}
.breadcrumb a {
    color: var(--color-text-muted);
}
.breadcrumb a:hover {
    color: var(--color-accent);
}
.breadcrumb .sep {
    margin: 0 6px;
    opacity: 0.4;
}

.rp-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.rp-metrics-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.rp-main-block {
    margin-bottom: 32px;
}

.rp-scenario-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}
.rp-scenario-block h3 {
    color: var(--color-accent2);
    margin-bottom: 12px;
    font-size: 1rem;
}

.rp-chart-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.rp-related-links {
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
    margin-bottom: 32px;
}
.rp-related-links h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}
.rp-related-links .links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rp-related-links .link-chip {
    padding: 6px 14px;
    background: var(--color-surface2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--color-text-muted);
    transition: all 150ms;
}
.rp-related-links .link-chip:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(0,194,255,0.06);
}

.rp-api-note {
    background: rgba(0,194,255,0.06);
    border: 1px solid rgba(0,194,255,0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 32px;
}
.rp-api-note h4 {
    color: var(--color-accent);
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.rp-api-note code {
    display: block;
    margin-top: 8px;
    padding: 10px;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Metric Cards ────────────────────────────────────────── */
.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 200ms, box-shadow 200ms;
}
.metric-card:hover {
    border-color: rgba(0,194,255,0.3);
    box-shadow: var(--shadow-glow);
}
.metric-card .metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    font-weight: 600;
}
.metric-card .metric-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
}
.metric-card .metric-sub {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform 300ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 300ms cubic-bezier(0.16,1,0.3,1),
                border-color 150ms cubic-bezier(0.16,1,0.3,1);
}
.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0,194,255,0.12), 0 8px 24px rgba(0,0,0,0.4);
    border-color: var(--color-accent);
}

.device-card { /* alias */ }
.solution-card { /* alias */ }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Card accent bar (top-left colored stripe) */
.card[data-accent="cyan"]   { border-top: 3px solid var(--color-accent); }
.card[data-accent="blue"]   { border-top: 3px solid #0080ff; }
.card[data-accent="amber"]  { border-top: 3px solid var(--color-warning); }
.card[data-accent="green"]  { border-top: 3px solid var(--color-success); }
.card[data-accent="orange"] { border-top: 3px solid var(--color-accent2); }
.card[data-accent="purple"] { border-top: 3px solid #a855f7; }
.card[data-accent="red"]    { border-top: 3px solid var(--color-danger); }

/* ── Status Pills ────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.pill-success {
    background: rgba(0,229,122,0.12);
    color: var(--color-success);
    border: 1px solid rgba(0,229,122,0.25);
}
.pill-warning {
    background: rgba(255,179,0,0.12);
    color: var(--color-warning);
    border: 1px solid rgba(255,179,0,0.25);
}
.pill-danger {
    background: rgba(255,45,85,0.12);
    color: var(--color-danger);
    border: 1px solid rgba(255,45,85,0.25);
}
.pill-info {
    background: rgba(0,194,255,0.12);
    color: var(--color-accent);
    border: 1px solid rgba(0,194,255,0.25);
}
.pill-muted {
    background: rgba(122,143,166,0.12);
    color: var(--color-text-muted);
    border: 1px solid rgba(122,143,166,0.25);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.online  { background: var(--color-success); }
.status-dot.offline { background: var(--color-text-muted); }
.status-dot.warning { background: var(--color-warning); }
.status-dot.critical{ background: var(--color-danger); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 200ms, box-shadow 200ms;
    outline: none;
}
.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,194,255,0.12);
}
.form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8fa6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 6px;
}

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 24px;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead {
    background: var(--color-surface);
}
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(30,45,69,0.5);
    color: var(--color-text);
}
tbody tr {
    transition: background 150ms;
}
tbody tr:hover {
    background: rgba(0,194,255,0.03);
}

/* ── Hero Section ────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 80px 48px 60px;
    background:
        radial-gradient(ellipse 100% 80% at 70% 50%,
            rgba(0,194,255,0.06) 0%,
            rgba(0,100,180,0.03) 40%,
            transparent 70%),
        radial-gradient(ellipse 60% 60% at 10% 80%,
            rgba(255,107,53,0.04) 0%,
            transparent 60%),
        linear-gradient(160deg, #0a0e1a 0%, #0d1525 50%, #0a0e1a 100%);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    gap: 60px;
}

.hero-left {
    flex: 0 0 55%;
    max-width: 55%;
}

.hero-right {
    flex: 0 0 42%;
    max-width: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(0,194,255,0.08);
    border: 1px solid rgba(0,194,255,0.25);
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 24px;
}
.hero-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: breathe 2s ease-in-out infinite;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 5vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 24px;
}
.hero h1 .highlight {
    background: linear-gradient(135deg, #00c2ff 0%, #0080ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subline {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-cta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-metrics {
    display: flex;
    gap: 32px;
}
.hero-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hero-metric-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
}
.hero-metric-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-metric + .hero-metric {
    padding-left: 32px;
    border-left: 1px solid var(--color-border);
}

/* Hero ticker */
.hero-ticker {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: rgba(0,194,255,0.05);
    border-top: 1px solid rgba(0,194,255,0.12);
    display: flex;
    align-items: center;
    overflow: hidden;
}
.ticker-track {
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    font-size: 12px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    display: flex;
    gap: 40px;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ticker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ticker-dot.health  { background: var(--color-accent); }
.ticker-dot.vehicle  { background: #0080ff; }
.ticker-dot.factory  { background: var(--color-warning); }
.ticker-dot.worker   { background: var(--color-accent2); }
.ticker-dot.fleet    { background: #a855f7; }
.ticker-dot.home     { background: var(--color-success); }

/* ── Home Page Sections ──────────────────────────────────── */
.section {
    padding: 80px 48px;
    position: relative;
    z-index: 1;
}
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.section-title {
    text-align: center;
    margin-bottom: 16px;
}
.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 48px;
}

/* Trust bar */
.trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
}
.trust-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

/* Solution cards on home */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.solution-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: transform 300ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 300ms cubic-bezier(0.16,1,0.3,1),
                border-color 150ms;
}
.solution-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0,194,255,0.12), 0 8px 24px rgba(0,0,0,0.4);
    border-color: var(--color-accent);
}
.solution-card .card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}
.solution-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.solution-card p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.solution-card .card-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.solution-card .card-link:hover {
    gap: 8px;
}

/* How it works - step flow */
.steps-flow {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding: 20px 0;
}
.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 130px;
    position: relative;
}
.step-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}
.step-icon svg {
    width: 24px;
    height: 24px;
}
.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    max-width: 100px;
}
.step-arrow {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    color: var(--color-border);
}

/* Live preview zone */
.preview-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.preview-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
}
.preview-panel .panel-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

/* Progress bar animation */
.progress-bar {
    height: 6px;
    background: var(--color-surface2);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-success));
    transition: width 1s ease;
}

/* Why this stack */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.stack-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.stack-card h3 {
    margin-bottom: 12px;
}

/* Footer CTA */
.footer-cta {
    text-align: center;
    padding: 60px 48px;
    background: linear-gradient(180deg, transparent, rgba(0,194,255,0.03));
    border-top: 1px solid var(--color-border);
}
.footer-cta h2 {
    margin-bottom: 12px;
}
.footer-cta p {
    max-width: 500px;
    margin: 0 auto 32px;
}
.footer-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Utility Classes ─────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ── Mobile Menu Toggle ──────────────────────────────────── */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 200ms;
}

/* ── Slide-over Panel ────────────────────────────────────── */
.slide-over {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 2000;
    transition: right 300ms cubic-bezier(0.16,1,0.3,1);
    padding: 24px;
    overflow-y: auto;
}
.slide-over.open {
    right: 0;
}
.slide-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms;
}
.slide-over-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    gap: 0;
}
.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 150ms;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-body);
}
.tab:hover {
    color: var(--color-text);
}
.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* ── Kanban Board ────────────────────────────────────────── */
.kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 400px;
}
.kanban-column {
    background: rgba(17,24,39,0.5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.kanban-column-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kanban-count {
    background: var(--color-surface2);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
}
.kanban-card {
    background: var(--color-surface2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: border-color 200ms, box-shadow 200ms;
}
.kanban-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ── Alert/Notification Row ──────────────────────────────── */
.alert-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(30,45,69,0.5);
    transition: background 150ms;
}
.alert-row:hover {
    background: rgba(0,194,255,0.03);
}
.alert-severity {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}
.alert-severity.critical { background: var(--color-danger); }
.alert-severity.warning  { background: var(--color-warning); }
.alert-severity.info     { background: var(--color-accent); }
.alert-info {
    flex: 1;
    min-width: 0;
}
.alert-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}
.alert-detail {
    font-size: 12px;
    color: var(--color-text-muted);
}
.alert-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--color-text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}
.empty-state h3 {
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* ── Feature Grid (for content pages) ────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.feature-item {
    display: flex;
    gap: 14px;
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0,194,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-icon svg {
    width: 20px;
    height: 20px;
}
.feature-text h4 {
    font-size: 14px;
    margin-bottom: 4px;
}
.feature-text p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* ── Battery/Signal Bar ──────────────────────────────────── */
.battery-bar {
    width: 32px;
    height: 14px;
    border: 1px solid var(--color-text-muted);
    border-radius: 3px;
    padding: 2px;
    position: relative;
    display: inline-flex;
}
.battery-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 3px;
    width: 3px;
    height: 6px;
    background: var(--color-text-muted);
    border-radius: 0 2px 2px 0;
}
.battery-fill {
    height: 100%;
    border-radius: 1px;
    background: var(--color-success);
}
.battery-fill.low { background: var(--color-danger); }
.battery-fill.mid { background: var(--color-warning); }

.signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}
.signal-bars .bar {
    width: 3px;
    border-radius: 1px;
    background: var(--color-text-muted);
}
.signal-bars .bar.active { background: var(--color-success); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .hero-left, .hero-right {
        flex: none;
        max-width: 100%;
    }
    .hero h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
    .hero-subline { margin: 0 auto 40px; }
    .hero-cta-row { justify-content: center; }
    .hero-metrics { justify-content: center; }
    
    .stack-grid {
        grid-template-columns: 1fr;
    }
    .kanban {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .nav-menu.open { 
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: 12px;
        gap: 4px;
    }
    .mobile-menu-toggle { display: flex; }
    
    .submenu-rail {
        position: fixed;
        left: -var(--submenu-width);
        top: var(--nav-height);
        z-index: 100;
        transition: left 300ms ease;
    }
    .submenu-rail.open {
        left: 0;
    }
    
    .right-panel {
        padding: 20px 16px;
    }
    
    .hero {
        padding: 60px 20px 50px;
    }
    .hero-metrics {
        flex-direction: column;
        gap: 16px;
    }
    .hero-metric + .hero-metric {
        padding-left: 0;
        padding-top: 16px;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }
    
    .section {
        padding: 48px 20px;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    .steps-flow {
        flex-direction: column;
        align-items: center;
    }
    .step-arrow {
        transform: rotate(90deg);
        margin: 0;
    }
    .kanban {
        grid-template-columns: 1fr;
    }
    
    .btn-hero-primary, .btn-hero-secondary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    .rp-metrics-strip {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 375px) {
    .hero h1 { font-size: 1.8rem; }
    .hero-eyebrow { font-size: 11px; }
    .rp-metrics-strip {
        grid-template-columns: 1fr;
    }
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero-svg-scene { animation: none !important; }
    .ticker-track { animation: none !important; }
    .hub-ring { animation: none !important; }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   Dashboard Components
   ═══════════════════════════════════════════════════════════ */

/* ── Component Block (generic panel) ────────────────────── */
.component-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 0;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color 200ms, box-shadow 200ms, transform 200ms;
    position: relative;
}
.stat-card:hover {
    border-color: rgba(0,194,255,0.2);
    box-shadow: 0 4px 20px rgba(0,194,255,0.06);
    transform: translateY(-2px);
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 500;
}
.stat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-success {
    background: rgba(0,229,122,0.12);
    color: var(--color-success);
    border: 1px solid rgba(0,229,122,0.25);
}
.badge-warning {
    background: rgba(255,179,0,0.12);
    color: var(--color-warning);
    border: 1px solid rgba(255,179,0,0.25);
}
.badge-danger {
    background: rgba(255,45,85,0.12);
    color: var(--color-danger);
    border: 1px solid rgba(255,45,85,0.25);
}
.badge-info {
    background: rgba(0,194,255,0.12);
    color: var(--color-accent);
    border: 1px solid rgba(0,194,255,0.25);
}
.badge-muted {
    background: rgba(122,143,166,0.12);
    color: var(--color-text-muted);
    border: 1px solid rgba(122,143,166,0.2);
}

/* Pulse animation for critical values */
.stat-value.pulse {
    animation: valuePulse 2s ease infinite;
}
@keyframes valuePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Data Tables ────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead {
    background: rgba(255,255,255,0.02);
}
.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid rgba(30,45,69,0.4);
    color: var(--color-text);
    vertical-align: middle;
}
.data-table tbody tr {
    transition: background 150ms;
}
.data-table tbody tr:hover {
    background: rgba(0,194,255,0.03);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-wrapper {
    overflow-x: auto;
}

/* ── Quick Action Cards ─────────────────────────────────── */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 200ms cubic-bezier(0.16,1,0.3,1);
    cursor: pointer;
    text-align: center;
}
.quick-action-card:hover {
    color: var(--color-accent);
    border-color: rgba(0,194,255,0.3);
    background: rgba(0,194,255,0.04);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,194,255,0.08);
}
.quick-action-card svg {
    opacity: 0.6;
    transition: opacity 200ms;
}
.quick-action-card:hover svg {
    opacity: 1;
    color: var(--color-accent);
}

/* ── Feature Grid ───────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 20px;
}

/* ── Flash Messages ─────────────────────────────────────── */
.flash-success, .flash-error {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ── Dashboard Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
    .feature-grid {
        --cols: 2;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .feature-grid {
        --cols: 1;
    }
    .quick-action-card {
        flex-direction: row;
        justify-content: flex-start;
    }
}

