/* =============================================================================
   O³ Enterprise Graph Maintenance Console - Design System
   High-performance cybernetic dark theme, responsive grid, glassmorphism
   ============================================================================= */

:root {
  --bg-darkest: #040811;
  --bg-primary: #070d18;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #162238;
  --bg-hover: #1e293b;
  --bg-input: #090e17;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: #334155;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --sidebar-width: 290px;
  --drawer-width: 440px;
  --header-height: 52px;
  --ribbon-height: 42px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-darkest);
  color: var(--text-main);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span.version {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.status-pill.live {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.status-pill.simulation {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-pill.live .status-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}
.status-pill.simulation .status-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

.stat-pill {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mode Switcher in Header */
.nav-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px 4px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}
.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab.active {
  color: #f8fafc;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(147, 51, 234, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.2);
}

/* =============================================================================
   Context & Scoping Ribbon (Digital Twin Selector)
   ============================================================================= */
.context-ribbon {
  height: var(--ribbon-height);
  background: #080d1a;
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 12px;
  z-index: 90;
  font-size: 0.75rem;
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.ribbon-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ribbon-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ribbon-select-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ribbon-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 220px;
}
.ribbon-select:hover {
  border-color: var(--accent-cyan);
}
.ribbon-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.ribbon-select.scope-select {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.95);
  color: #7dd3fc;
  font-weight: 700;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-micro:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.ribbon-divider {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 0.9rem;
  user-select: none;
  opacity: 0.5;
}

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

.ribbon-node-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  user-select: none;
}
.ribbon-node-pill.org-pill {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}
.ribbon-node-pill.org-pill:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
}
.ribbon-node-pill.inst-pill {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.ribbon-node-pill.inst-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
}

.ribbon-node-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.ribbon-node-pill .pill-dot.purple {
  background: #c084fc;
  box-shadow: 0 0 6px #c084fc;
}
.ribbon-node-pill .pill-dot.cyan {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.ribbon-node-pill .pill-prefix {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.3px;
}

.ribbon-node-pill .pill-id {
  font-family: var(--font-mono);
  font-weight: 600;
}

.ribbon-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tool Buttons in Header */
.btn-tool {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-weight: 600;
}
.btn-tool:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.btn-tool-purple {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-weight: 600;
}
.btn-tool-purple:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.btn-icon-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  padding: 6px 10px;
}
.btn-icon-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-sm {
  font-size: 0.68rem;
  padding: 4px 10px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

/* Streamlined Sidebar & Search */
.sidebar-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge-subtle {
  font-size: 0.62rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-scope {
  font-size: 0.62rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sidebar-search-wrap,
.table-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 9px;
  font-size: 0.72rem;
  color: var(--text-dim);
  pointer-events: none;
}

.sidebar-search-wrap .search-input {
  padding-left: 28px;
}
.table-search-wrap .search-input {
  padding-left: 28px;
  width: 320px;
}

/* Hierarchy Bar */
.hierarchy-bar {
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.breadcrumb-item {
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s ease;
}
.breadcrumb-item:hover {
  opacity: 0.85;
  text-decoration: underline;
}
.breadcrumb-item.org-item {
  color: #c084fc;
}
.breadcrumb-item.inst-item {
  color: #38bdf8;
}

.breadcrumb-sep {
  color: var(--text-dim);
  user-select: none;
}

.breadcrumb-focus-pill {
  color: #34d399;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-clear {
  background: none;
  border: none;
  color: #34d399;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0 2px;
}

.stats-badge {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.entity-count-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Common Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 1px 6px rgba(2, 132, 199, 0.35);
}
.btn-primary:hover {
  background: #0369a1;
  border-color: #7dd3fc;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-cyan);
}

.btn-success {
  background: #065f46;
  color: #a7f3d0;
  border-color: #059669;
}
.btn-success:hover {
  background: #047857;
  color: #ecfdf5;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.btn-icon {
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

/* App Main Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - var(--ribbon-height));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}
.search-input:focus {
  border-color: var(--accent-cyan);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

/* Domain Chips */
.domain-group {
  margin-bottom: 12px;
}

.domain-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 6px;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.domain-group-title:hover {
  background: rgba(255, 255, 255, 0.06);
}
.domain-group-title.active {
  background: rgba(255, 255, 255, 0.09);
  outline: 1px solid rgba(255, 255, 255, 0.15);
}

.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.class-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.class-item.active {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  font-weight: 600;
  border-left: 3px solid var(--accent-cyan);
}
.class-item.oos-active {
  background: rgba(245, 158, 11, 0.16) !important;
  color: var(--accent-amber) !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--accent-amber) !important;
}

.count-badge {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-dim);
}
.class-item.active .count-badge {
  background: rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
}

/* Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-darkest);
}

.content-toolbar {
  padding: 10px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.view-tabs {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Table */
.table-container {
  flex: 1;
  overflow: auto;
  position: relative;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
}

table.data-table th {
  background: #090e17;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 10;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}
table.data-table th.no-sort {
  cursor: default;
}
table.data-table th.no-sort:hover {
  color: var(--text-muted);
  background: #090e17;
}
table.data-table th:hover:not(.no-sort) {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}
table.data-table th.sorted {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.09);
  border-bottom: 2px solid var(--accent-cyan);
}
table.data-table th .sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.68rem;
  opacity: 0.35;
  transition: opacity 0.15s ease, color 0.15s ease;
  vertical-align: baseline;
  pointer-events: none;
}
table.data-table th:hover:not(.no-sort) .sort-icon {
  opacity: 0.85;
}
table.data-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--accent-cyan);
  font-weight: 800;
}

table.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

table.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
table.data-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}
table.data-table tbody tr.selected {
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--accent-cyan);
}

.entity-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.class-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.state-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-block;
  white-space: nowrap;
}

.state-badge.state-badge-na {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim, #64748b);
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.15));
  font-weight: 500;
}

.state-badge.state-badge-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.state-badge.state-badge-blue {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.state-badge.state-badge-rose {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Right Detail Drawer */
.detail-drawer {
  width: var(--drawer-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.drawer-header {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
}

.section-card-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.prop-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.prop-row:last-child {
  border-bottom: none;
}
.prop-row:hover .prop-row-actions {
  opacity: 1;
}
.prop-row-actions {
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 8px;
}
.prop-name {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.prop-val {
  color: var(--text-main);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.edge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 0.72rem;
}
.edge-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}

.rel-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Modals */
.modal,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 17, 0.82);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal.open,
.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 14px 18px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 12px 18px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Form inputs in Modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
}

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

.cypher-preview-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-left: 3px solid var(--accent-cyan);
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow-y: auto;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease;
}
.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================================================= */
/* Stanley Delivery Advisor Panel Styles */
/* ========================================================================= */
.stanley-chip {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e0e7ff;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stanley-chip:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}
.stanley-chip.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.stanley-chip-node {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}
.stanley-chip-node:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
}
.stanley-diag-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 3px 8px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Courseware Studio Styles */
.courseware-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.courseware-tab-btn:hover {
  color: #e2e8f0;
}
.courseware-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}
.courseware-select-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.courseware-select-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e2e8f0;
}
.courseware-select-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.courseware-persona-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.courseware-persona-pill:hover {
  border-color: rgba(168, 85, 247, 0.5);
  color: #e2e8f0;
}
.courseware-persona-pill.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  color: #c084fc;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

/* =============================================================================
   MARKDOWN CONTENT & TABLE RENDERING (STANLEY ADVISOR & COURSEWARE STUDIO)
   ============================================================================= */
.markdown-content {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.markdown-content p {
  margin: 0 0 12px 0;
  line-height: 1.65;
}

.markdown-content h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
  margin: 24px 0 12px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 6px;
}

.markdown-content h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 20px 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.markdown-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c084fc;
  margin: 16px 0 8px 0;
}

.markdown-content h4 {
  font-size: 0.86rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 14px 0 6px 0;
}

.markdown-content ul {
  margin: 10px 0 16px 0;
  padding-left: 24px;
  list-style-type: disc;
}

.markdown-content ol {
  margin: 10px 0 16px 0;
  padding-left: 26px;
  list-style-type: decimal;
}

.markdown-content li {
  margin-bottom: 7px;
  line-height: 1.6;
  padding-left: 4px;
}

.markdown-content ol li::marker {
  color: #38bdf8;
  font-weight: 700;
  font-family: var(--font-mono);
}

.markdown-content ul li::marker {
  color: #c084fc;
}

.markdown-content strong {
  color: #f8fafc;
  font-weight: 700;
}

.markdown-content em {
  color: #cbd5e1;
  font-style: italic;
}

.markdown-content code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
}

.markdown-content pre {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 14px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.markdown-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* World-Class Markdown Tables */
.markdown-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.markdown-content thead {
  background: linear-gradient(180deg, #1e293b, #0f172a);
}

.markdown-content th {
  color: #38bdf8;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.markdown-content td {
  padding: 9px 14px;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.markdown-content tr:last-child td {
  border-bottom: none;
}

.markdown-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.markdown-content tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.markdown-content td code {
  color: #f1f5f9;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
}

/* Callout Alerts */
.md-callout {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 0.78rem;
  line-height: 1.55;
  background: rgba(15, 23, 42, 0.7);
}

.md-callout-title {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.md-callout-body {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #e2e8f0;
}
.md-callout-body p {
  margin: 0;
  line-height: 1.6;
}
.md-callout-body strong {
  color: #f8fafc;
  font-weight: 700;
}

.md-callout-note {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.1);
  color: #bae6fd;
}
.md-callout-note .md-callout-title {
  color: #38bdf8;
}

.md-callout-tip {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  color: #a7f3d0;
}
.md-callout-tip .md-callout-title {
  color: #34d399;
}

.md-callout-warning {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
}
.md-callout-warning .md-callout-title {
  color: #fbbf24;
}

.md-callout-caution {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}
.md-callout-caution .md-callout-title {
  color: #f87171;
}

.md-callout-important {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.1);
  color: #e9d5ff;
}
.md-callout-important .md-callout-title {
  color: #c084fc;
}

.markdown-content blockquote {
  border-left: 3px solid #64748b;
  margin: 12px 0;
  padding: 6px 14px;
  color: #94a3b8;
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 4px 4px 0;
}

/* =============================================================================
   INTERACTIVE CYPHER SANDBOX (DIGITAL TWIN FLIGHT SIMULATOR)
   ============================================================================= */
.cypher-sandbox-card {
  margin: 18px 0;
  background: #030712;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cypher-sandbox-card:hover {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
}

.cypher-sandbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.2), rgba(15, 23, 42, 0.8));
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  flex-wrap: wrap;
  gap: 8px;
}

.cypher-sandbox-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cypher-status-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cypher-status-pill.running {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.cypher-status-pill.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.cypher-status-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.cypher-sandbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cypher-run-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}

.cypher-run-btn:hover {
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.7);
  transform: translateY(-1px);
}

.cypher-code-view pre {
  margin: 0 !important;
  padding: 12px 14px !important;
  background: #020617 !important;
  border: none !important;
  border-radius: 0 !important;
}

.cypher-code-view code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: #38bdf8 !important;
}

.cypher-code-edit {
  padding: 10px 12px;
  background: #020617;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cypher-edit-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: #38bdf8;
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
  resize: vertical;
}

.cypher-sandbox-results {
  background: #070c18;
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  padding: 12px;
  animation: fadeIn 0.2s ease;
}

.cypher-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #38bdf8;
  padding: 8px 0;
}

.cypher-empty {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #94a3b8;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cypher-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #fca5a5;
  line-height: 1.45;
}

.cypher-results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.cypher-meta-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 7px;
}

.cypher-table-scroll {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.cypher-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  font-family: var(--font-sans);
}

.cypher-result-table th {
  background: #0f172a;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.cypher-result-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  white-space: nowrap;
}

.cypher-result-table tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.sandbox-entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sandbox-entity-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

/* =============================================================================
   SIMPLIFIED COURSEWARE STUDIO (PROGRESSIVE DISCLOSURE & MISSIONS)
   ============================================================================= */
.courseware-target-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.12), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.ribbon-target-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.courseware-tier-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.courseware-mode-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.courseware-mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  margin: 2px 0;
}

.courseware-mission-card {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  position: relative;
}

.courseware-mission-card:hover {
  background: #0d1527;
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.15);
}

.courseware-mission-card.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(15, 23, 42, 0.9));
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25), inset 0 0 8px rgba(56, 189, 248, 0.1);
}

.courseware-mission-card.active::before {
  content: '✓ SELECTED';
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.mission-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mission-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.35;
}

.courseware-launch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.courseware-launch-btn {
  background: linear-gradient(135deg, #0284c7, #9333ea) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 8px 20px !important;
  border-radius: 6px !important;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.45) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.courseware-launch-btn:hover {
  box-shadow: 0 0 22px rgba(2, 132, 199, 0.75) !important;
  transform: translateY(-1px);
}

.courseware-advanced-toggle {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.courseware-advanced-toggle:hover {
  color: #38bdf8;
}

.courseware-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #070c18;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.courseware-nav-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.courseware-nav-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

#org-root-node-pill:hover {
  background: rgba(168, 85, 247, 0.22) !important;
  border-color: rgba(168, 85, 247, 0.55) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

#instance-node-pill:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* =============================================================================
   OUTCOME TREE & OKR CASCADE VIEW
   ============================================================================= */
.outcome-tree-container {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  background: radial-gradient(circle at 10% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 90% 85%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
              #070c18;
}

.outcome-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 14px;
}

.outcome-tree-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.outcome-tree-title h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.outcome-tree-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.outcome-tree-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.perspective-filter-btn {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.perspective-filter-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.perspective-filter-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.outcome-tree-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.outcome-tier-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  position: relative;
  transition: all 0.2s ease;
}

.outcome-tier-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.outcome-tier-card.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.outcome-tier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.outcome-tier-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 12px;
}

.outcome-tier-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
  margin-top: 6px;
}

.outcome-tier-desc {
  font-size: 0.73rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-top: 6px;
}

.outcome-krs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.outcome-kr-item {
  background: rgba(7, 12, 24, 0.85);
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.outcome-kr-item:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(14, 23, 42, 0.9);
  transform: translateY(-1px);
}

.kr-persp-tag {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.tree-connector-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -6px 0;
  position: relative;
  z-index: 1;
}

.tree-connector-stem {
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(56, 189, 248, 0.7), rgba(168, 85, 247, 0.7));
}

.tree-connector-arrow {
  font-size: 0.65rem;
  color: #c084fc;
  margin-top: -4px;
}

.lineage-stream-bar {
  margin-top: 36px;
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* =============================================================================
   CADENCE MILESTONE PROGRESSION & PROGRESS BAR STYLING
   ============================================================================= */
.cadence-milestone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 22px;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.milestone-stepper-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.milestone-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.milestone-step-btn:hover {
  border-color: #38bdf8;
  color: #f8fafc;
  transform: translateY(-1px);
}

.milestone-step-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.milestone-step-btn.achieved.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(52, 211, 153, 0.25));
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

/* Key Result Progress Track & Fill */
.kr-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin: 5px 0 3px 0;
  position: relative;
}

.kr-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

.kr-achieved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

/* =============================================================================
   PIPELINE KANBAN (FLOW) VIEW - AI INNOVATION PIPELINE (SAFe 6.0)
   ============================================================================= */
.kanban-view-container {
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  background: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 85% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 45%),
              #060a14;
}

.kanban-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.kanban-board-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kanban-board-title h2 {
  font-size: 1.18rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.kanban-board-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-board-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kanban-metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.kanban-columns-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(290px, 1fr));
  gap: 16px;
  align-items: start;
  min-width: 1450px;
  margin-bottom: 24px;
}

.kanban-column {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.kanban-column:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.kanban-column.wip-exceeded {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.2);
}

.kanban-column.wip-at-limit {
  border-color: rgba(245, 158, 11, 0.45);
}

.kanban-col-header {
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-step-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kanban-col-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
}

.kanban-wip-pill {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}

.kanban-wip-pill.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.kanban-wip-pill.limit {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

.kanban-wip-pill.exceeded {
  background: rgba(244, 63, 94, 0.22);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.5);
  animation: pulse-border 1.8s infinite;
}

.kanban-col-purpose {
  padding: 8px 14px;
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.35;
  background: rgba(10, 16, 29, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kanban-policies-toggle {
  padding: 6px 14px;
  font-size: 0.62rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.kanban-policies-toggle:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.03);
}

.kanban-policy-drawer {
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.64rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kanban-policy-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kanban-policy-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7dd3fc;
}

/* Operators & Quality Gates badges */
.kanban-gates-wrap, .kanban-ops-wrap {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kanban-meta-header {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kanban-gate-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kanban-gate-chip:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: #f43f5e;
}

.kanban-op-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kanban-op-chip:hover {
  background: rgba(168, 85, 247, 0.24);
  border-color: #a855f7;
}

/* Kanban Cards List */
.kanban-cards-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.kanban-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kanban-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.kanban-card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 6px;
}

.kanban-type-badge {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 4px;
}

.kanban-type-badge.learning {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.kanban-type-badge.value {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.kanban-type-badge.triad {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.kanban-card-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #64748b;
}

.kanban-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  margin-bottom: 6px;
}

.kanban-card-desc {
  font-size: 0.66rem;
  color: #94a3b8;
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  gap: 6px;
}

.kanban-btn-step {
  padding: 3px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kanban-btn-step:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.kanban-btn-step.advance {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(56, 189, 248, 0.3));
  border-color: rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

.kanban-btn-step.advance:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.5), rgba(56, 189, 248, 0.5));
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.kanban-empty-col {
  padding: 28px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.68rem;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin: 6px 0;
}

/* Continuous Telemetry & Learning Feedback Loop */
.kanban-telemetry-loop {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(56, 189, 248, 0.12) 50%, rgba(168, 85, 247, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.1);
  min-width: 1450px;
}

.kanban-telemetry-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kanban-telemetry-icon {
  font-size: 1.5rem;
  animation: spin-slow 12s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.kanban-telemetry-text h4 {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.kanban-telemetry-text p {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.kanban-telemetry-badge {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  white-space: nowrap;
}

/* =============================================================================
   EXECUTIVE DECISION HUB & GOVERNANCE PIPELINE
   ============================================================================= */
.decision-board-container {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  background: radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 90% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
              #070c18;
}

.decision-card-wrap {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.decision-card-wrap:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
