/* InCompass — Institutional Compass
   Splunk-themed dark dashboard design system
   Aligned with BOL / MICRO 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 platform) */
    --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
   ======================================== */
.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: 220px;
    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; }

/* ========================================
   Sidebar
   ======================================== */
.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-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); }

.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 sidebar */
.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; }

/* Sidebar tooltips 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;
}

.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); }

/* ========================================
   Pills & Status
   ======================================== */
.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);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--danger); }

/* ========================================
   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);
    margin-bottom: 16px;
}

.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 h2, .panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h2 i, .panel-header h3 i { color: var(--accent); font-size: 13px; }

.panel-body { padding: 16px; }
.panel-body.no-pad { padding: 0; }

/* ========================================
   Accordion
   ======================================== */
.accordion-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.accordion-controls button {
  padding: 4px 12px; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-secondary); color: var(--text-primary); cursor: pointer;
}
.accordion-controls button:hover { background: var(--bg-hover, rgba(255,255,255,.08)); }

.accordion-item {
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px;
  background: var(--bg-secondary); overflow: hidden;
}
.accordion-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; cursor: pointer; user-select: none;
}
.accordion-header:hover { background: rgba(255,255,255,.04); }
.accordion-title { margin: 0; color: var(--accent); font-size: 1rem; }
.accordion-icon {
  transition: transform 0.2s ease; font-size: 0.8rem; color: var(--text-muted);
}
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-content {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  padding: 0 16px;
}
.accordion-item.open .accordion-content {
  max-height: 5000px; padding: 0 16px 16px;
}

/* ========================================
   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-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    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-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-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(76, 201, 240, 0.06);
    color: var(--text-primary);
}

.btn i { font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Button group */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========================================
   Forms
   ======================================== */
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
.form-control,
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--sans);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    line-height: 1.5;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="url"]::placeholder,
input[type="search"]::placeholder,
.form-control::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.15);
    background: rgba(15, 23, 32, 0.95);
}

input:hover, select:hover, textarea:hover, .form-control:hover {
    border-color: rgba(76, 201, 240, 0.35);
}

textarea { resize: vertical; min-height: 80px; }

.form-group { margin-bottom: 16px; }
.form-group label { margin-bottom: 6px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ========================================
   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); }

/* ========================================
   Cards (legacy compat with existing stage JS)
   ======================================== */
.card {
    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);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-head h2 {
    font-size: 15px;
    font-weight: 700;
}

/* ========================================
   InCompass — Stage-specific styles
   ======================================== */

/* Stage actions bar */
.actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    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;
}

.actions button:hover {
    border-color: rgba(76, 201, 240, 0.38);
    background: rgba(15, 23, 32, 0.85);
}

.actions button.primary,
.actions button#submitBtn {
    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);
}

/* Status messages */
.status {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.status.success { color: var(--success); }
.status.error { color: var(--danger); }

/* Stage form elements */
.stage-view {
    padding: 16px;
}

.step-section {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(11, 15, 20, 0.35);
}

.step-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent);
}

.explain {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(76, 201, 240, 0.04);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guidance {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

/* Dynamic stage form fields (stage1, stage2 JS-rendered) */
.form-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field {
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(11, 15, 20, 0.35);
    transition: border-color 0.15s;
}

.form-field:hover {
    border-color: rgba(76, 201, 240, 0.25);
}

.form-field .subtitle {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.form-field .question {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.45;
}

.form-field .help {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(76, 201, 240, 0.04);
    border-left: 2px solid rgba(76, 201, 240, 0.3);
    border-radius: 0 4px 4px 0;
}

.form-field .form-control {
    width: 100%;
    box-sizing: border-box;
}

/* Module preview for unauthenticated visitors */
.module-preview {
    max-width: 660px;
    margin: 40px auto;
    padding: 36px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(11, 15, 20, 0.55);
}
.module-preview .mod-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(76, 201, 240, 0.08);
    border: 1px solid rgba(76, 201, 240, 0.2);
    border-radius: 4px;
    padding: 3px 10px;
    margin-bottom: 16px;
}
.module-preview h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}
.module-preview .mod-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 26px;
}
.module-preview .mod-steps-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.module-preview .mod-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}
.module-preview .mod-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    line-height: 1.45;
}
.module-preview .mod-steps li:last-child { border-bottom: none; }
.module-preview .mod-steps li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 5px;
    flex-shrink: 0;
}
.module-preview .mod-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.module-preview .mod-login-btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity 0.15s;
}
.module-preview .mod-login-btn:hover { opacity: 0.85; color: #000; }
.module-preview .mod-home-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}
.module-preview .mod-home-link:hover { color: var(--accent); }

/* Compass visualization area */
.compass-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(11, 15, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.compass-container canvas,
.compass-container svg,
.compass-container img {
    max-width: 100%;
    height: auto;
}

/* Data point cards */
.data-point-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}

.data-point-card:hover {
    border-color: rgba(76, 201, 240, 0.3);
}

.data-point-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Grid layouts for stage forms */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Row utility */
.row { display: flex; gap: 10px; align-items: center; }
.row.right { justify-content: flex-end; }

/* Small text */
.small { font-size: 12px; color: var(--text-muted); }
.sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ========================================
   Session cards on home page
   ======================================== */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.session-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 18px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.session-card:hover {
    border-color: rgba(76, 201, 240, 0.4);
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.06);
}

.session-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.session-card .meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
}

/* ========================================
   Login page
   ======================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(15, 23, 32, 0.92), rgba(12, 19, 27, 0.82));
    box-shadow: var(--shadow-xl);
    padding: 32px;
}

.login-card h2 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.login-card .login-icon {
    text-align: center;
    margin-bottom: 16px;
}

.login-card .login-icon i {
    font-size: 40px;
    color: var(--accent);
}

/* ========================================
   Hamburger Menu
   ======================================== */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--accent);
}

/* Mobile menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 400;
    opacity: 0;
    transition: opacity .2s ease;
}

.mobile-menu-overlay.open { display: block; opacity: 1; }

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 500;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.mobile-menu.open { display: block; transform: translateX(0); }

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-menu-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.mobile-menu-links { padding: 10px; }

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.12s;
}

.mobile-menu-link:hover { background: rgba(76, 201, 240, 0.08); color: var(--text-primary); }
.mobile-menu-link.active { color: var(--accent); background: rgba(76, 201, 240, 0.06); }
.mobile-menu-link i { width: 20px; text-align: center; }

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 14px;
}

.mobile-menu-section {
    display: block;
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .hamburger-btn { display: flex; }
    .navbar-menu { display: none; }

    .page-content { padding: 16px; }

    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .session-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Utilities
   ======================================== */
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; }
.hidden { display: none !important; }

/* ========================================
   Badges (MICRO-compatible)
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-cyan   { background: rgba(76,201,240,0.12);  color: var(--accent); }
.badge-purple { background: rgba(124,58,237,0.15);  color: #7c3aed; }
.badge-green  { background: rgba(16,185,129,0.12);  color: var(--success); }
.badge-orange { background: rgba(245,158,11,0.12);  color: var(--warning); }
.badge-blue   { background: rgba(59,130,246,0.12);  color: var(--info); }
.badge-red    { background: rgba(239,68,68,0.12);   color: var(--danger); }

/* ========================================
   Tags
   ======================================== */
.tag {
    font-family: var(--mono);
    font-size: 0.72rem;
    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(16,185,129,0.4); color: var(--success); }

/* ========================================
   Filter Bar
   ======================================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.filter-bar .search-input::placeholder { color: var(--text-muted); }
.filter-bar .search-input:focus { border-color: var(--accent); }
.filter-bar select {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}
.filter-bar select:focus { border-color: var(--accent); }

/* ========================================
   Data Table (explicit)
   ======================================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead 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);
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.data-table tbody tr:hover { background: rgba(76,201,240,0.03); }

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 1rem; }

/* ========================================
   Hero Section
   ======================================== */
.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;
}

/* ========================================
   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(16,185,129,0.4); }
.build-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.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: 0.72rem;
    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: 0.78rem;
    color: var(--text-muted);
}
.build-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.build-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }

/* ========================================
   Collapsed helper
   ======================================== */
.release-body.collapsed { display: none; }

/* ========================================
   Fade In
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ========================================
   Backlog Expandable Rows
   ======================================== */
.bl-expand-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
}
.bl-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.bl-expand-btn.expanded { color: var(--accent); border-color: var(--accent); background: rgba(76,201,240,0.08); }
.bl-expand-row td { padding: 0 !important; border-top: none !important; background: rgba(76,201,240,0.02); }
.bl-expand-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px 24px 20px;
    border-left: 3px solid var(--accent);
    margin: 0 12px 8px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.bl-expand-section { display: flex; flex-direction: column; gap: 8px; }
.bl-expand-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.bl-expand-section-title i { color: var(--accent); font-size: 0.7rem; }
.bl-expand-section-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
.bl-expand-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bl-expand-list li {
    padding: 4px 0 4px 14px;
    position: relative;
    font-size: 0.78rem;
    line-height: 1.55;
}
.bl-expand-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}
@media (max-width: 1100px) {
    .bl-expand-content { grid-template-columns: 1fr; }
}
