/* BOL — Beginning of Life Simulator
   Splunk-themed dark dashboard design system
   Aligned with ITL2 / UAL / SAIS platform conventions */

/* ========================================
   Design System Variables
   ======================================== */
:root {
    /* Background Palette */
    --bg-primary: #0b0f14;
    --bg-secondary: #0f1720;
    --bg-tertiary: #151e2b;
    --bg-elevated: #1a2535;
    --bg-surface: #111a2e;

    /* Border & Lines */
    --border-color: #1f2a36;
    --border-subtle: rgba(31, 42, 54, 0.65);

    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: #9fb0c0;
    --text-muted: #6b7f94;

    /* Accent Colours — cyan primary (matching ITL2) */
    --accent: #4cc9f0;
    --accent-strong: #38b6db;
    --accent-glow: rgba(76, 201, 240, 0.15);
    --accent2: #7c3aed;

    /* Status Colours */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #4ea1ff;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 18px 48px rgba(6, 12, 24, 0.45);

    /* Layout */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 56px;
    --navbar-height: 48px;
    --topbar-height: 48px;
    --radius: 10px;
    --radius-sm: 6px;

    /* Fonts */
    --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

/* ========================================
   Base Reset & Typography
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    font-size: 14px;
    background:
        radial-gradient(1200px 900px at 10% 10%, rgba(124, 58, 237, 0.08), transparent 60%),
        radial-gradient(900px 600px at 90% 20%, rgba(76, 201, 240, 0.06), transparent 55%),
        var(--bg-primary);
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-primary); margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #7edcf5; }

/* ========================================
   App Shell — Top Navbar above Sidebar + Main
   ======================================== */
.app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
}

.app-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
}

/* ========================================
   Top Navigation Bar
   ======================================== */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    padding: 0 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    z-index: 200;
    flex-shrink: 0;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    flex-shrink: 0;
}

.navbar-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding-right: 20px;
    margin-right: 8px;
    border-right: 1px solid var(--border-color);
    height: 60%;
}

.navbar-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.navbar-brand-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.06em;
}

.navbar-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: var(--sans);
    line-height: 1;
}

.navbar-link:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--text-primary);
    border-color: rgba(31, 42, 54, 0.5);
}

.navbar-link.active {
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.15), rgba(12, 19, 27, 0.5));
    color: var(--accent);
    border-color: rgba(76, 201, 240, 0.28);
}

.navbar-link i { font-size: 13px; }
.navbar-link .dd-arrow { font-size: 9px; margin-left: 2px; opacity: 0.6; }

/* ---- Dropdown ---- */
.navbar-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 300;
}

.navbar-dropdown:hover > .dropdown-menu,
.navbar-dropdown:focus-within > .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.12s ease;
}

.dropdown-item:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--text-primary);
}

.dropdown-item.active {
    color: var(--accent);
    background: rgba(76, 201, 240, 0.06);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
}

/* ---- Navbar Right ---- */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-pill {
    font-size: 10px;
}

.navbar-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(12, 19, 27, 0.55);
    color: var(--text-muted);
    font-size: 16px;
    text-decoration: none;
    transition: all 0.15s;
}

.navbar-profile:hover {
    border-color: rgba(76, 201, 240, 0.4);
    color: var(--accent);
    background: rgba(76, 201, 240, 0.08);
}

.navbar-profile.active {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================================
   Sidebar (sits below top navbar)
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* ---- Sidebar Header ---- */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--accent);
    border-color: rgba(76, 201, 240, 0.3);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0 auto;
}

/* ---- Nav Items ---- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}

.nav-item i {
    font-size: 15px;
    width: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--text-primary);
    border-color: rgba(31, 42, 54, 0.5);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.15), rgba(12, 19, 27, 0.5));
    color: var(--accent);
    border-color: rgba(76, 201, 240, 0.28);
}

.nav-item.active i {
    color: var(--accent);
}

/* ---- Section Labels ---- */
.nav-section-label {
    padding: 16px 12px 6px;
    overflow: hidden;
    white-space: nowrap;
}

.nav-section-label span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Collapsed: hide labels, show tooltips */
.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-label {
    padding: 12px 0 4px;
    text-align: center;
}

.sidebar.collapsed .nav-section-label span {
    font-size: 0;
}

.sidebar.collapsed .nav-section-label::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--border-color);
    margin: 0 auto;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-nav {
    padding: 8px 6px;
}

/* Tooltips on hover when collapsed */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 300;
    box-shadow: var(--shadow-md);
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.pill {
    font-family: var(--mono);
    font-size: 11px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(12, 19, 27, 0.65);
    color: var(--text-muted);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.running {
    background: var(--success);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-dot.paused {
    background: var(--warning);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-content::-webkit-scrollbar { width: 8px; }
.page-content::-webkit-scrollbar-track { background: var(--bg-primary); }
.page-content::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
.page-content::-webkit-scrollbar-thumb:hover { background: var(--bg-elevated); }

/* ========================================
   Panel Component
   ======================================== */
.panel {
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(15, 23, 32, 0.82), rgba(12, 19, 27, 0.72));
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h3 i { color: var(--accent); font-size: 13px; }

.panel-body { padding: 16px; }
.panel-body.no-pad { padding: 0; }

/* ========================================
   KPI Cards
   ======================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 16px 18px;
    transition: border-color 0.15s;
}

.kpi-card:hover { border-color: rgba(76, 201, 240, 0.3); }

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-label i { font-size: 12px; }

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-family: var(--sans);
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 6px;
}

.kpi-trend.up { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.kpi-trend.down { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.kpi-trend.flat { background: rgba(107, 127, 148, 0.12); color: var(--text-muted); }

/* ========================================
   Charts Layout
   ======================================== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.chart-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(15, 23, 32, 0.82), rgba(12, 19, 27, 0.72));
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.chart-panel .panel-header {
    padding: 12px 16px;
}

.chart-container {
    padding: 12px 16px 16px;
    position: relative;
    height: 260px;
}

/* ========================================
   Controls Bar
   ======================================== */
.controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.controls-bar label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.controls-bar select,
.controls-bar input {
    font-family: var(--sans);
    font-size: 13px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(11, 15, 20, 0.55);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.controls-bar select:focus,
.controls-bar input:focus {
    border-color: rgba(76, 201, 240, 0.55);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(12, 19, 27, 0.72);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    border-color: rgba(76, 201, 240, 0.38);
    background: rgba(15, 23, 32, 0.85);
}

.btn-primary {
    border-color: rgba(76, 201, 240, 0.42);
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.22), rgba(12, 19, 27, 0.72));
    color: var(--accent);
}

.btn-primary:hover {
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.32), rgba(12, 19, 27, 0.72));
}

.btn-success {
    border-color: rgba(34, 197, 94, 0.42);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(12, 19, 27, 0.72));
    color: var(--success);
}

.btn-success:hover {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.28), rgba(12, 19, 27, 0.72));
}

.btn-danger {
    border-color: rgba(239, 68, 68, 0.42);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.18), rgba(12, 19, 27, 0.72));
    color: var(--danger);
}

.btn-danger:hover {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.28), rgba(12, 19, 27, 0.72));
}

.btn-warning {
    border-color: rgba(245, 158, 11, 0.42);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.18), rgba(12, 19, 27, 0.72));
    color: var(--warning);
}

.btn i { font-size: 13px; }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   Event Log
   ======================================== */
.event-log {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-muted);
    max-height: 280px;
    overflow-y: auto;
    padding: 12px 14px;
}

.event-log::-webkit-scrollbar { width: 6px; }
.event-log::-webkit-scrollbar-track { background: transparent; }
.event-log::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }

.event-line {
    padding: 2px 0;
    display: flex;
    gap: 10px;
}

.event-line .step-num { color: var(--accent); min-width: 60px; }
.event-line .ev-metric { color: var(--text-secondary); }

/* ========================================
   Tables
   ======================================== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

tr:hover td { background: rgba(76, 201, 240, 0.03); }

/* ========================================
   Scenario Cards
   ======================================== */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.scenario-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.scenario-card:hover {
    border-color: rgba(76, 201, 240, 0.4);
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.06);
}

.scenario-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(76, 201, 240, 0.1);
}

.scenario-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenario-card h3 i { color: var(--accent); font-size: 14px; }

.scenario-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.scenario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: var(--mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(12, 19, 27, 0.55);
    color: var(--text-muted);
}

.tag.active { border-color: rgba(34, 197, 94, 0.4); color: var(--success); }

/* ========================================
   Sweep Page
   ======================================== */
.sweep-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group select,
.form-group input {
    font-family: var(--sans);
    font-size: 13px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(11, 15, 20, 0.55);
    color: var(--text-primary);
    outline: none;
}

.form-group select:focus,
.form-group input:focus {
    border-color: rgba(76, 201, 240, 0.55);
}

/* ========================================
   About / Hero
   ======================================== */
.hero {
    max-width: 800px;
    padding: 48px 0 32px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero h1 span { color: var(--accent); }

.hero-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 28px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.feature-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 18px 20px;
    transition: border-color 0.15s;
}

.feature-card:hover { border-color: rgba(76, 201, 240, 0.35); }

.feature-card .fc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(76, 201, 240, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.feature-card .fc-icon i { color: var(--accent); font-size: 15px; }

.feature-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .navbar-menu { display: none; }
    .sidebar { width: var(--sidebar-collapsed-width); }
    .sidebar .nav-label { opacity: 0; width: 0; overflow: hidden; }
    .sidebar .sidebar-title { opacity: 0; width: 0; overflow: hidden; }
    .sidebar .nav-section-label span { font-size: 0; }
    .sidebar .nav-section-label::after { content: ''; display: block; width: 24px; height: 1px; background: var(--border-color); margin: 0 auto; }
    .sidebar .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
    .sidebar .sidebar-nav { padding: 8px 6px; }
    .sidebar .sidebar-brand { justify-content: center; padding: 0; }
    .sidebar .sidebar-toggle { margin: 0 auto; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
}

@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .controls-bar { flex-direction: column; align-items: stretch; }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

/* Sparkline inline */
.sparkline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

/* ========================================
   Documentation Panels
   ======================================== */
.doc-panel {
    margin-bottom: 16px;
}

.doc-details {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(15, 23, 32, 0.82), rgba(12, 19, 27, 0.72));
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.doc-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.15s;
}

.doc-summary::-webkit-details-marker { display: none; }

.doc-summary::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    transition: transform 0.2s;
    width: 14px;
    text-align: center;
}

details.doc-details[open] > .doc-summary::before {
    transform: rotate(90deg);
}

.doc-summary:hover {
    background: rgba(76, 201, 240, 0.06);
}

.doc-summary i {
    font-size: 14px;
}

.doc-body {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.doc-body h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-body ul {
    margin: 0 0 12px 0;
    padding-left: 18px;
}

.doc-body li {
    margin-bottom: 4px;
}

.doc-body p {
    margin-bottom: 10px;
}

.doc-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* ========================================
   3D Microscope Viewer
   ======================================== */
.viewer-wrapper {
    flex: 1;
    position: relative;
    min-height: 500px;
    background: #0a0f1e;
}

.viewer-canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.viewer-toolbar-left,
.viewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-sm.active {
    border-color: rgba(76, 201, 240, 0.5);
    color: var(--accent);
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.18), rgba(12, 19, 27, 0.72));
}

.viewer-stat {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.viewer-stat i { color: var(--accent); font-size: 12px; }

/* Legend overlay — bottom-left of viewer */
.viewer-legend-panel {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(11, 15, 20, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    max-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    z-index: 5;
}

.viewer-legend-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-legend-title i { color: var(--accent); }

.viewer-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-mol-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    image-rendering: auto;
}

.legend-count {
    margin-left: auto;
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 10px;
}

/* Help overlay — bottom-right of viewer */
.viewer-help-panel {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(11, 15, 20, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    max-width: 200px;
    backdrop-filter: blur(6px);
    z-index: 5;
}

.viewer-help-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-help-title i { color: var(--accent); }

.viewer-help-body {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.viewer-help-body div {
    margin-bottom: 4px;
}

.viewer-help-body small {
    color: var(--text-muted);
    font-size: 10px;
}

/* ========================================
   Software Showcase Page
   ======================================== */
.showcase-section {
    margin-bottom: 32px;
}

.showcase-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.showcase-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.15), rgba(124, 58, 237, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.showcase-section-icon i {
    color: var(--accent);
    font-size: 18px;
}

.showcase-section-header h2 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
}

.showcase-section-header p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.showcase-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.showcase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s;
}

.showcase-card:hover {
    border-color: rgba(76, 201, 240, 0.45);
    box-shadow: 0 4px 20px rgba(76, 201, 240, 0.08);
    transform: translateY(-2px);
    color: inherit;
}

.showcase-card:hover::before {
    opacity: 1;
}

.showcase-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.showcase-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.showcase-badge {
    font-family: var(--mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(76, 201, 240, 0.3);
    background: rgba(76, 201, 240, 0.08);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.showcase-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 14px;
}

.showcase-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.showcase-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.showcase-meta i {
    font-size: 11px;
    color: var(--accent);
    opacity: 0.7;
}

/* ========================================
   Home Page
   ======================================== */
.home-hero {
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 48px 0 40px;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 999px;
    background: rgba(76, 201, 240, 0.08);
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
}

.hero-title span { color: var(--accent); }

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 580px;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 11px 22px;
    font-size: 14px;
}

/* Hero Orb Animation */
.hero-visual {
    flex-shrink: 0;
}

.hero-orb {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: orbSpin linear infinite;
}

.ring-1 {
    width: 160px; height: 160px;
    border-color: rgba(76, 201, 240, 0.2);
    animation-duration: 12s;
}

.ring-2 {
    width: 120px; height: 120px;
    border-color: rgba(124, 58, 237, 0.2);
    animation-duration: 8s;
    animation-direction: reverse;
}

.ring-3 {
    width: 80px; height: 80px;
    border-color: rgba(34, 197, 94, 0.2);
    animation-duration: 6s;
}

.orb-core {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 0 40px rgba(76, 201, 240, 0.3);
    z-index: 1;
}

@keyframes orbSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Home Sections */
.home-section {
    margin-bottom: 40px;
}

.section-header-centered {
    text-align: center;
    margin-bottom: 28px;
}

.section-header-centered h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-header-centered p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Capability Grid */
.capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.capability-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.capability-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s;
}

.capability-card:hover {
    border-color: rgba(76, 201, 240, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(76, 201, 240, 0.06);
}

.capability-card:hover::before { opacity: 1; }

.cap-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(76, 201, 240, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.cap-icon i { color: var(--accent); font-size: 17px; }

.capability-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.capability-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

.cap-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.cap-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
}

.cap-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Scenario Showcase */
.scenario-showcase {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scenario-showcase-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.scenario-showcase-card:hover {
    border-color: rgba(76, 201, 240, 0.35);
    background: var(--bg-elevated);
    transform: translateX(4px);
    color: inherit;
}

.ssc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ssc-icon i { font-size: 20px; }

.ssc-content {
    flex: 1;
    min-width: 0;
}

.ssc-content h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ssc-content p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.ssc-arrow {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.scenario-showcase-card:hover .ssc-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* Quick Start Steps */
.quickstart-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.qs-step {
    flex: 1;
    min-width: 220px;
    max-width: 320px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 24px;
    text-align: center;
}

.qs-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.qs-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.qs-body p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
}

.qs-connector {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 40px;
}

/* Home Stats Bar */
.home-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    flex-wrap: wrap;
}

.home-stat {
    text-align: center;
}

.home-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.home-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.home-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* ========================================
   Security Page
   ======================================== */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.security-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 24px;
    transition: border-color 0.15s;
}

.security-card:hover { border-color: rgba(76, 201, 240, 0.3); }

.sec-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(76, 201, 240, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.sec-icon i { color: var(--accent); font-size: 17px; }

.security-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.security-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

.sec-detail {
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sec-detail-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sec-detail-value {
    font-size: 13px;
    color: var(--text-secondary);
}

.sec-detail-value code {
    font-family: var(--mono);
    font-size: 12px;
    padding: 2px 6px;
    background: rgba(12, 19, 27, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--accent);
}

/* ========================================
   Build Timeline
   ======================================== */
.build-timeline {
    padding: 20px 24px;
    position: relative;
}

.build-timeline::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--border-color);
}

.build-entry {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    position: relative;
}

.build-entry:last-child { margin-bottom: 0; }

.build-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    margin-top: 6px;
    z-index: 1;
}

.build-marker.done {
    background: var(--accent);
    border-color: var(--accent);
}

.build-marker.active {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.build-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.build-entry:last-child .build-content {
    border-bottom: none;
}

.build-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.build-tag {
    font-family: var(--mono);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(76, 201, 240, 0.3);
    background: rgba(76, 201, 240, 0.08);
    color: var(--accent);
}

.build-date {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

.build-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.build-content p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ========================================
   Profile Page
   ======================================== */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.profile-meta i { font-size: 11px; color: var(--accent); opacity: 0.7; }

/* Form messages */
.form-error {
    padding: 10px 14px;
    margin-top: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    font-size: 13px;
}

.form-success {
    padding: 10px 14px;
    margin-top: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
    font-size: 13px;
}

/* ========================================
   Responsive Additions
   ======================================== */
@media (max-width: 768px) {
    .home-hero {
        flex-direction: column;
        text-align: center;
    }
    .hero-description { margin: 0 auto 28px; }
    .hero-actions { justify-content: center; }
    .hero-visual { display: none; }
    .quickstart-steps { flex-direction: column; align-items: center; }
    .qs-connector { transform: rotate(90deg); margin: 8px 0; }
    .home-stats-bar { gap: 16px; }
    .home-stat-divider { width: 40px; height: 1px; }
    .capability-grid { grid-template-columns: 1fr; }
    .security-grid { grid-template-columns: 1fr; }
}
