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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a12;
  color: #fff;
  overflow: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  height: 64px;
  padding: 0 24px;
  background: rgba(12, 12, 20, 0.98);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-center {
  display: flex;
  align-items: center;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

/* View Mode Toggle */
.view-mode-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

.view-mode-toggle button {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-mode-toggle button:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.view-mode-toggle button.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

.view-toggle button {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle button:hover {
  color: #fff;
}

.view-toggle button.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Search */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 12px;
}

.search-box svg {
  color: #6b7280;
}

.search-box input {
  width: 200px;
  padding: 10px 0;
  font-size: 13px;
  border: none;
  background: transparent;
  color: #fff;
  outline: none;
}

.search-box:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box input::placeholder {
  color: #4b5563;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.search-item {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.search-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #6b7280;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}

/* Breadcrumb */
.breadcrumb {
  height: 40px;
  padding: 0 24px;
  background: rgba(12, 12, 20, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb-home {
  color: #6366f1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.breadcrumb-home:hover {
  color: #818cf8;
}

.breadcrumb-sep {
  color: #374151;
  display: flex;
  align-items: center;
}

.breadcrumb-item {
  color: #6b7280;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: #fff;
}

.breadcrumb-item.active {
  color: #fff;
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

#graph-container {
  flex: 1;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 0;
  background: rgba(12, 12, 20, 0.98);
  border-left: 1px solid rgba(255,255,255,0.08);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.sidebar.open {
  width: 340px;
}

.sidebar-content {
  width: 340px;
  padding: 24px;
  height: 100%;
  overflow-y: auto;
}

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

.node-type-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
}

.btn-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  word-break: break-word;
  line-height: 1.3;
}

.node-details {
  margin-bottom: 28px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-label {
  font-size: 12px;
  color: #6b7280;
}

.detail-value {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.detail-value.highlight {
  color: #10b981;
}

.connections h3 {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.connection-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.conn-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conn-type {
  font-size: 9px;
  text-transform: uppercase;
  color: #6b7280;
  padding: 2px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}

.conn-relation {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* Node Dot */
.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tooltip */
.tooltip {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Legend */
.legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  padding: 14px 18px;
  background: rgba(12, 12, 20, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  z-index: 100;
  display: flex;
  gap: 20px;
  backdrop-filter: blur(12px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
}

/* Legend Shapes */
.legend-shape {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.legend-shape.octahedron {
  background: #fff;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.legend-shape.box {
  border-radius: 3px;
}

.legend-shape.dodecahedron {
  border-radius: 50%;
}

.legend-shape.icosahedron {
  border-radius: 50%;
  transform: scale(0.9);
}

.legend-shape.cylinder {
  border-radius: 3px;
}

.legend-shape.cone {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.legend-shape.torus {
  border-radius: 50%;
  border: 3px solid currentColor;
  background: transparent !important;
  box-sizing: border-box;
  border-color: inherit;
}

.legend-shape.tetrahedron {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.legend-shape.ring {
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent !important;
}

/* Instructions */
.instructions {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #4b5563;
  z-index: 100;
}

.instructions span {
  padding: 8px 12px;
  background: rgba(12, 12, 20, 0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
}

/* Insights View */
.insights-view {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: linear-gradient(180deg, #0a0a12 0%, #0f0f1a 100%);
}

.insights-container {
  max-width: 1400px;
  margin: 0 auto;
}

.insights-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 2px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.summary-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.3s;
}

.summary-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.card-content {
  display: flex;
  flex-direction: column;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.card-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 6px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.metric-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
}

.metric-card.large {
  grid-column: span 2;
}

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

.metric-title {
  font-size: 13px;
  color: #9ca3af;
}

.metric-period {
  font-size: 11px;
  color: #6b7280;
  background: rgba(255,255,255,0.05);
  padding: 4px 8px;
  border-radius: 4px;
}

.metric-value {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.metric-value.small {
  font-size: 32px;
}

.metric-currency,
.metric-unit {
  font-size: 14px;
  color: #6b7280;
  margin-top: 6px;
}

/* Flow Cards */
.flow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.flow-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
}

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

.flow-direction {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
}

.flow-direction.импорт {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.flow-direction.экспорт {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.flow-count {
  font-size: 13px;
  color: #6b7280;
}

.flow-volume {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.flow-bar {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.flow-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.flow-bar-fill.импорт {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.flow-bar-fill.экспорт {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Categories Table */
.categories-table {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  transition: background 0.2s;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background: rgba(255,255,255,0.03);
}

.cat-name {
  color: #fff;
  font-weight: 500;
}

.cat-count,
.cat-volume,
.cat-cycle {
  color: #9ca3af;
}

/* Jurisdiction Grid */
.jurisdiction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.jurisdiction-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.jurisdiction-card:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}

.jur-flag {
  font-size: 32px;
  margin-bottom: 10px;
}

.jur-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.jur-count {
  font-size: 12px;
  color: #6b7280;
}

/* Entities List */
.entities-list {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
}

.entity-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s;
}

.entity-row:last-child {
  border-bottom: none;
}

.entity-row:hover {
  background: rgba(255,255,255,0.03);
}

.entity-rank {
  font-size: 12px;
  color: #6b7280;
  width: 30px;
}

.entity-name {
  flex: 1;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.entity-stats {
  display: flex;
  gap: 8px;
}

.stat-badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.stat-badge.issuer {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.stat-badge.endorser1 {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.stat-badge.endorser2 {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

/* Chart Container */
.chart-container {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  gap: 8px;
}

.bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 60px;
}

.bar-wrapper {
  height: 160px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 70%;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.bar-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 8px;
}

.bar-value {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: #6b7280;
  font-size: 14px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* Responsive */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card.large {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }

  .header-center {
    order: 3;
    width: 100%;
  }

  .view-toggle {
    width: 100%;
    justify-content: center;
  }

  .sidebar.open {
    width: 100%;
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 200;
  }

  .insights-view {
    padding: 20px;
  }

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

  .table-header,
  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .table-header span:nth-child(3),
  .table-header span:nth-child(4),
  .table-row span:nth-child(3),
  .table-row span:nth-child(4) {
    display: none;
  }
}

/* ============================================================================
   BI DASHBOARD STYLES
   ============================================================================ */

.header-subtitle {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.last-updated {
  font-size: 12px;
  color: #6b7280;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* BI Dashboard */
.bi-dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(180deg, #0a0a12 0%, #0f0f1a 100%);
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.kpi-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.kpi-card.wide {
  grid-column: span 1;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.kpi-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.kpi-icon.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.kpi-icon.teal { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.kpi-content {
  min-width: 0;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.kpi-label {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.kpi-subtitle {
  font-size: 10px;
  color: #4b5563;
  margin-top: 2px;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.charts-row:first-of-type {
  grid-template-columns: 2fr 1fr;
}

.chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chart-card.large {
  grid-column: span 1;
}

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

.chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9ca3af;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-item .dot.green { background: #10b981; }
.legend-item .dot.purple { background: #8b5cf6; }

.chart-body {
  flex: 1;
  min-height: 200px;
  position: relative;
}

.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.stat-label {
  font-size: 12px;
  color: #9ca3af;
}

.stat-value {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}

.stat-percent {
  font-size: 11px;
  color: #6b7280;
  margin-left: 8px;
}

/* Tables Row */
.tables-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.table-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}

.table-card .table-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: block;
}

.table-card .table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-card .table-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.source-info {
  font-size: 10px;
  color: #6b7280;
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.table-body {
  max-height: 320px;
  overflow-y: auto;
}

.table-body table {
  width: 100%;
  border-collapse: collapse;
}

.table-body thead th {
  padding: 12px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: rgba(255,255,255,0.02);
  position: sticky;
  top: 0;
}

.table-body tbody tr {
  transition: background 0.2s;
}

.table-body tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.table-body tbody td {
  padding: 12px 16px;
  font-size: 12px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.table-body .client-name,
.table-body .category-name,
.table-body .client-name-ru,
.table-body .category-name-ru {
  color: #fff;
  font-weight: 500;
  font-size: 11px;
}

.table-body .client-name-en,
.table-body .category-name-en {
  color: #10b981;
  font-weight: 500;
  font-size: 11px;
}

.table-body .inn {
  font-family: monospace;
  font-size: 11px;
}

.table-body .volume {
  color: #10b981;
  font-weight: 500;
}

.table-body .months {
  color: #6b7280;
}

.dir-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.dir-badge.import {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.dir-badge.export {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* Money Flows View */
.flows-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(180deg, #0a0a12 0%, #0f0f1a 100%);
}

.flows-header {
  margin-bottom: 32px;
}

.flows-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.flows-header p {
  font-size: 14px;
  color: #6b7280;
}

.flows-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 32px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}

.flows-summary .summary-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.flows-summary .summary-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-icon.issuer { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.summary-icon.intermediary { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.summary-icon.receiver { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.summary-content .summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 4px;
}

.summary-content .summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.summary-content .summary-meta {
  font-size: 12px;
  color: #4b5563;
  margin-top: 4px;
}

.flow-arrow {
  font-size: 32px;
  color: #374151;
}

/* Flows Table */
.flows-table {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 32px;
}

.flows-table .table-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: block;
}

.flows-table .table-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.flow-chains-table {
  width: 100%;
  border-collapse: collapse;
}

.flow-chains-table thead th {
  padding: 12px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: rgba(255,255,255,0.02);
}

.flow-chains-table tbody tr {
  transition: background 0.2s;
}

.flow-chains-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.flow-chains-table tbody td {
  padding: 12px 10px;
  font-size: 12px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.flow-chains-table .rank {
  color: #6b7280;
  width: 30px;
}

.flow-chains-table .arrow {
  color: #374151;
  text-align: center;
  padding: 0 4px;
}

.flow-chains-table .entity {
  max-width: 150px;
}

.flow-chains-table .entity .entity-name {
  display: block;
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-chains-table .entity .jurisdiction {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-radius: 3px;
  margin-top: 4px;
}

.flow-chains-table .entity.issuer .entity-name { color: #ef4444; }
.flow-chains-table .entity.intermediary .entity-name { color: #f59e0b; }
.flow-chains-table .entity.receiver .entity-name { color: #10b981; }

.flow-chains-table .category {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-chains-table .volume {
  color: #10b981;
  font-weight: 500;
}

.flow-chains-table .cycle {
  color: #6b7280;
}

/* Entity Breakdown */
.entity-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.entity-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.entity-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.entity-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

.entity-card .entity-info {
  flex: 1;
  min-width: 0;
}

.entity-card .entity-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card .entity-jurisdiction {
  font-size: 10px;
  color: #6b7280;
}

.entity-card .entity-stats {
  display: flex;
  gap: 8px;
}

.entity-card .entity-stats .stat {
  font-size: 11px;
  color: #9ca3af;
  padding: 4px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

.entity-card .entity-category {
  font-size: 10px;
  color: #6b7280;
  padding: 4px 8px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}

/* Graph View */
.graph-view {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.graph-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  gap: 12px;
  align-items: center;
}

.graph-type-toggle {
  display: flex;
  gap: 4px;
  background: rgba(12, 12, 20, 0.95);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}

.graph-type-toggle button {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.graph-type-toggle button:hover {
  color: #fff;
}

.graph-type-toggle button.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.btn-reset {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 12, 20, 0.95);
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
}

.btn-reset:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
}

.loading-overlay p {
  color: #6b7280;
  font-size: 14px;
}

/* Graph Tooltip */
.graph-tooltip {
  position: fixed;
  display: none;
  padding: 12px 16px;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #fff;
  z-index: 1000;
  pointer-events: none;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  line-height: 1.5;
}

.graph-tooltip strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.graph-tooltip .type {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Graph Container Improvements */
#graph-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#graph-container canvas {
  display: block;
}

/* Graph Instructions */
.graph-instructions {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #4b5563;
  z-index: 50;
  background: rgba(12, 12, 20, 0.9);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

.graph-instructions span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.graph-instructions kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: monospace;
  color: #9ca3af;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Responsive adjustments for BI Dashboard */
@media (max-width: 1400px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 1024px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .charts-row:first-of-type {
    grid-template-columns: 1fr;
  }

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

  .flows-summary {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .entity-breakdown {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .kpi-card.wide {
    grid-column: span 1;
  }

  .bi-dashboard,
  .flows-view {
    padding: 16px;
  }
}

/* ============================================================================
   LIFECYCLE VIEW STYLES
   ============================================================================ */

.lifecycle-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(180deg, #0a0a12 0%, #0f0f1a 100%);
}

.lifecycle-header {
  margin-bottom: 28px;
}

.lifecycle-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.lifecycle-header p {
  font-size: 14px;
  color: #6b7280;
}

/* Lifecycle KPI Row */
.lifecycle-kpi-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 28px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  flex-wrap: wrap;
}

.lifecycle-kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 28px;
  text-align: center;
  min-width: 160px;
  transition: all 0.2s;
}

.lifecycle-kpi:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}

.lifecycle-kpi .kpi-stage {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 8px;
}

.lifecycle-kpi .kpi-big {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.lifecycle-kpi .kpi-sub {
  font-size: 12px;
  color: #4b5563;
  margin-top: 4px;
}

/* Stage colors */
.lifecycle-kpi.issuer { border-color: rgba(239, 68, 68, 0.3); }
.lifecycle-kpi.issuer .kpi-stage { color: #ef4444; }
.lifecycle-kpi.issuer .kpi-big { color: #ef4444; }

.lifecycle-kpi.endorser1 { border-color: rgba(245, 158, 11, 0.3); }
.lifecycle-kpi.endorser1 .kpi-stage { color: #f59e0b; }
.lifecycle-kpi.endorser1 .kpi-big { color: #f59e0b; }

.lifecycle-kpi.endorser2 { border-color: rgba(16, 185, 129, 0.3); }
.lifecycle-kpi.endorser2 .kpi-stage { color: #10b981; }
.lifecycle-kpi.endorser2 .kpi-big { color: #10b981; }

.lifecycle-kpi.redeemer { border-color: rgba(99, 102, 241, 0.3); }
.lifecycle-kpi.redeemer .kpi-stage { color: #6366f1; }
.lifecycle-kpi.redeemer .kpi-big { color: #6366f1; }

.lifecycle-arrow {
  font-size: 28px;
  color: #374151;
}

/* Lifecycle Stats Row */
.lifecycle-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
}

.stat-box .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-box .stat-value {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}

/* Lifecycle Charts Row */
.lifecycle-charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.lifecycle-chart {
  min-height: 280px;
}

/* Lifecycle Participant Tables */
.lifecycle-tables {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.participant-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}

.participant-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.participant-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.participant-count {
  font-size: 10px;
  color: #6b7280;
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* Header stage colors */
.participant-header.issuer { border-left: 3px solid #ef4444; }
.participant-header.endorser1 { border-left: 3px solid #f59e0b; }
.participant-header.endorser2 { border-left: 3px solid #10b981; }
.participant-header.redeemer { border-left: 3px solid #6366f1; }

.participant-table {
  width: 100%;
  border-collapse: collapse;
}

.participant-table thead th {
  padding: 10px 12px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: rgba(255,255,255,0.02);
}

.participant-table tbody tr {
  transition: background 0.2s;
}

.participant-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.participant-table tbody td {
  padding: 10px 12px;
  font-size: 11px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.participant-table .entity-name {
  color: #fff;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jur-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-radius: 3px;
}

.category-cell {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
}

/* Co-occurrence Section */
.cooccurrence-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cooccurrence-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.cooccurrence-tables {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.cooccurrence-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}

.cooccurrence-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cooccurrence-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.flow-desc {
  font-size: 10px;
  color: #6b7280;
}

.cooccurrence-table {
  width: 100%;
  border-collapse: collapse;
}

.cooccurrence-table thead th {
  padding: 10px 10px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: rgba(255,255,255,0.02);
}

.cooccurrence-table tbody tr {
  transition: background 0.2s;
}

.cooccurrence-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.cooccurrence-table tbody td {
  padding: 10px 10px;
  font-size: 11px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.cooccurrence-table .source {
  color: #fff;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cooccurrence-table .target {
  color: #10b981;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cooccurrence-table .arrow {
  color: #374151;
  text-align: center;
  padding: 0 4px;
}

.cooccurrence-table .freq {
  color: #6366f1;
  font-weight: 500;
}

.cooccurrence-table .vol {
  color: #6b7280;
}

/* Full Chains Section */
.full-chains-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}

.full-chains-section h3 {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.full-chains-table {
  width: 100%;
  border-collapse: collapse;
}

.full-chains-table thead th {
  padding: 12px 10px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: rgba(255,255,255,0.02);
}

.full-chains-table tbody tr {
  transition: background 0.2s;
}

.full-chains-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.full-chains-table tbody td {
  padding: 12px 10px;
  font-size: 11px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.full-chains-table .rank {
  color: #6b7280;
  font-size: 10px;
}

.full-chains-table .arrow {
  color: #374151;
  text-align: center;
}

.full-chains-table .issuer-cell {
  color: #ef4444;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-chains-table .endorser1-cell {
  color: #f59e0b;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-chains-table .endorser2-cell {
  color: #10b981;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-chains-table .category-cell {
  color: #6b7280;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-chains-table .freq {
  color: #6366f1;
  font-weight: 500;
}

.full-chains-table .vol {
  color: #10b981;
  font-weight: 500;
}

.full-chains-table .cycle {
  color: #6b7280;
}

/* Responsive adjustments for Lifecycle View */
@media (max-width: 1400px) {
  .lifecycle-tables {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 1024px) {
  .lifecycle-kpi-row {
    flex-direction: column;
  }

  .lifecycle-arrow {
    transform: rotate(90deg);
  }

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

  .lifecycle-tables {
    grid-template-columns: 1fr;
  }

  .cooccurrence-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .lifecycle-view {
    padding: 16px;
  }

  .lifecycle-stats-row {
    flex-direction: column;
  }
}

/* ============================================================================
   SANKEY DIAGRAM STYLES
   ============================================================================ */

.sankey-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.sankey-header {
  margin-bottom: 16px;
}

.sankey-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.sankey-header p {
  font-size: 13px;
  color: #6b7280;
}

.sankey-legend {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
}

.sankey-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.issuer { background: #ef4444; }
.legend-dot.endorser1 { background: #f59e0b; }
.legend-dot.endorser2 { background: #10b981; }
.legend-dot.redeemer { background: #6366f1; }

#sankey-container {
  width: 100%;
  min-height: 500px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  overflow: hidden;
}

#sankey-container svg {
  display: block;
}

.sankey-link path {
  cursor: pointer;
  transition: opacity 0.2s, stroke-width 0.2s;
}

.sankey-node rect {
  cursor: pointer;
  transition: opacity 0.2s;
}

.sankey-node text {
  pointer-events: none;
}

/* Sankey Tooltip */
.sankey-tooltip {
  position: fixed;
  display: none;
  padding: 14px 18px;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  font-size: 13px;
  color: #fff;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  line-height: 1.6;
}

.sankey-tooltip strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.sankey-tooltip .stage-label {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin: 4px 0;
}

.sankey-tooltip .flow-label {
  color: #10b981;
  font-weight: 500;
}

/* ============================================================================
   LIGHT THEME (Paper Mode)
   ============================================================================ */

/* Theme Toggle Button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #6b7280;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.user-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

.user-menu .btn-logout {
  width: 32px;
  height: 32px;
  border: 1px solid #333;
  background: transparent;
  color: #888;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu .btn-logout:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="light"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="light"] .header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .header h1 {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .header-subtitle {
  color: var(--text-muted);
}

[data-theme="light"] .last-updated {
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-color: var(--border-color);
}

[data-theme="light"] .theme-toggle {
  border-color: var(--border-color);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

[data-theme="light"] .theme-toggle:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

/* View Mode Toggle - Light */
[data-theme="light"] .view-mode-toggle {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

[data-theme="light"] .view-mode-toggle button {
  color: var(--text-muted);
}

[data-theme="light"] .view-mode-toggle button:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

[data-theme="light"] .view-mode-toggle button.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* Dashboard - Light */
[data-theme="light"] .bi-dashboard,
[data-theme="light"] .flows-view,
[data-theme="light"] .lifecycle-view {
  background: var(--bg-primary);
}

/* KPI Cards - Light */
[data-theme="light"] .kpi-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .kpi-card:hover {
  background: var(--bg-card);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .kpi-value {
  color: var(--text-primary);
}

[data-theme="light"] .kpi-label {
  color: var(--text-secondary);
}

[data-theme="light"] .kpi-subtitle {
  color: var(--text-muted);
}

[data-theme="light"] .kpi-icon.blue { background: rgba(59, 130, 246, 0.1); }
[data-theme="light"] .kpi-icon.green { background: rgba(16, 185, 129, 0.1); }
[data-theme="light"] .kpi-icon.purple { background: rgba(139, 92, 246, 0.1); }
[data-theme="light"] .kpi-icon.orange { background: rgba(245, 158, 11, 0.1); }
[data-theme="light"] .kpi-icon.teal { background: rgba(6, 182, 212, 0.1); }

/* Chart Cards - Light */
[data-theme="light"] .chart-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .chart-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .chart-legend .legend-item {
  color: var(--text-secondary);
}

[data-theme="light"] .chart-stats {
  border-top-color: var(--border-light);
}

[data-theme="light"] .stat-label {
  color: var(--text-secondary);
}

[data-theme="light"] .stat-value {
  color: var(--text-primary);
}

/* Table Cards - Light */
[data-theme="light"] .table-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .table-card .table-header {
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .table-card .table-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .source-info {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}

[data-theme="light"] .table-body thead th {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .table-body tbody tr:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .table-body tbody td {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .table-body .client-name,
[data-theme="light"] .table-body .category-name,
[data-theme="light"] .table-body .client-name-ru,
[data-theme="light"] .table-body .category-name-ru {
  color: var(--text-primary);
}

[data-theme="light"] .table-body .client-name-en,
[data-theme="light"] .table-body .category-name-en {
  color: #059669;
}

[data-theme="light"] .table-body .volume {
  color: #059669;
}

[data-theme="light"] .dir-badge.import {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

[data-theme="light"] .dir-badge.export {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Flows View - Light */
[data-theme="light"] .flows-header h2 {
  color: var(--text-primary);
}

[data-theme="light"] .flows-header p {
  color: var(--text-secondary);
}

[data-theme="light"] .flows-summary {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .flows-summary .summary-card {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

[data-theme="light"] .summary-content .summary-title {
  color: var(--text-muted);
}

[data-theme="light"] .summary-content .summary-value {
  color: var(--text-primary);
}

[data-theme="light"] .summary-content .summary-meta {
  color: var(--text-muted);
}

[data-theme="light"] .flow-arrow {
  color: var(--border-color);
}

[data-theme="light"] .flows-table {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .flows-table .table-header {
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .flows-table .table-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .flow-chains-table thead th {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .flow-chains-table tbody tr:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .flow-chains-table tbody td {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .flow-chains-table .entity .entity-name {
  color: var(--text-primary);
}

[data-theme="light"] .flow-chains-table .entity.issuer .entity-name { color: #dc2626; }
[data-theme="light"] .flow-chains-table .entity.intermediary .entity-name { color: #d97706; }
[data-theme="light"] .flow-chains-table .entity.receiver .entity-name { color: #059669; }

[data-theme="light"] .flow-chains-table .entity .jurisdiction {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

[data-theme="light"] .flow-chains-table .volume {
  color: #059669;
}

/* Entity Breakdown - Light */
[data-theme="light"] .entity-section h3 {
  color: var(--text-primary);
}

[data-theme="light"] .entity-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .entity-card:hover {
  background: var(--bg-hover);
  border-color: #c7d2fe;
}

[data-theme="light"] .entity-card .entity-name {
  color: var(--text-primary);
}

[data-theme="light"] .entity-card .entity-jurisdiction {
  color: var(--text-muted);
}

[data-theme="light"] .entity-card .entity-stats .stat {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

[data-theme="light"] .entity-card .entity-category {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}

/* Lifecycle View - Light */
[data-theme="light"] .lifecycle-header h2 {
  color: var(--text-primary);
}

[data-theme="light"] .lifecycle-header p {
  color: var(--text-secondary);
}

[data-theme="light"] .lifecycle-kpi-row {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .lifecycle-kpi {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

[data-theme="light"] .lifecycle-kpi:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

[data-theme="light"] .lifecycle-kpi .kpi-stage {
  color: var(--text-muted);
}

[data-theme="light"] .lifecycle-kpi .kpi-big {
  color: var(--text-primary);
}

[data-theme="light"] .lifecycle-kpi .kpi-sub {
  color: var(--text-muted);
}

[data-theme="light"] .lifecycle-kpi.issuer { border-color: rgba(220, 38, 38, 0.3); }
[data-theme="light"] .lifecycle-kpi.issuer .kpi-stage,
[data-theme="light"] .lifecycle-kpi.issuer .kpi-big { color: #dc2626; }

[data-theme="light"] .lifecycle-kpi.endorser1 { border-color: rgba(217, 119, 6, 0.3); }
[data-theme="light"] .lifecycle-kpi.endorser1 .kpi-stage,
[data-theme="light"] .lifecycle-kpi.endorser1 .kpi-big { color: #d97706; }

[data-theme="light"] .lifecycle-kpi.endorser2 { border-color: rgba(5, 150, 105, 0.3); }
[data-theme="light"] .lifecycle-kpi.endorser2 .kpi-stage,
[data-theme="light"] .lifecycle-kpi.endorser2 .kpi-big { color: #059669; }

[data-theme="light"] .lifecycle-kpi.redeemer { border-color: rgba(79, 70, 229, 0.3); }
[data-theme="light"] .lifecycle-kpi.redeemer .kpi-stage,
[data-theme="light"] .lifecycle-kpi.redeemer .kpi-big { color: #4f46e5; }

[data-theme="light"] .lifecycle-arrow {
  color: var(--border-color);
}

[data-theme="light"] .stat-box {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .stat-box .stat-label {
  color: var(--text-muted);
}

[data-theme="light"] .stat-box .stat-value {
  color: var(--text-primary);
}

/* Sankey Section - Light */
[data-theme="light"] .sankey-section {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .sankey-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .sankey-header p {
  color: var(--text-secondary);
}

[data-theme="light"] .sankey-legend {
  background: var(--bg-hover);
}

[data-theme="light"] .sankey-legend-item {
  color: var(--text-secondary);
}

[data-theme="light"] #sankey-container {
  background: var(--bg-hover);
}

[data-theme="light"] .sankey-node text {
  fill: var(--text-secondary) !important;
}

/* Participant Cards - Light */
[data-theme="light"] .participant-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .participant-header {
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .participant-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .participant-count {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .participant-table thead th {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .participant-table tbody tr:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .participant-table tbody td {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .participant-table .entity-name {
  color: var(--text-primary);
}

[data-theme="light"] .jur-badge {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

/* Co-occurrence Section - Light */
[data-theme="light"] .cooccurrence-section {
  border-top-color: var(--border-color);
}

[data-theme="light"] .cooccurrence-section h2 {
  color: var(--text-primary);
}

[data-theme="light"] .section-subtitle {
  color: var(--text-secondary);
}

[data-theme="light"] .cooccurrence-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .cooccurrence-header {
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .cooccurrence-header h3 {
  color: var(--text-primary);
}

[data-theme="light"] .flow-desc {
  color: var(--text-muted);
}

[data-theme="light"] .cooccurrence-table thead th {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .cooccurrence-table tbody tr:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .cooccurrence-table tbody td {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .cooccurrence-table .source {
  color: var(--text-primary);
}

[data-theme="light"] .cooccurrence-table .target {
  color: #059669;
}

[data-theme="light"] .cooccurrence-table .arrow {
  color: var(--border-color);
}

[data-theme="light"] .cooccurrence-table .freq {
  color: #4f46e5;
}

/* Full Chains - Light */
[data-theme="light"] .full-chains-section {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .full-chains-section h3 {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .full-chains-table thead th {
  color: var(--text-muted);
  background: var(--bg-hover);
}

[data-theme="light"] .full-chains-table tbody tr:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .full-chains-table tbody td {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .full-chains-table .issuer-cell { color: #dc2626; }
[data-theme="light"] .full-chains-table .endorser1-cell { color: #d97706; }
[data-theme="light"] .full-chains-table .endorser2-cell { color: #059669; }
[data-theme="light"] .full-chains-table .freq { color: #4f46e5; }
[data-theme="light"] .full-chains-table .vol { color: #059669; }

/* Graph View - Light */
[data-theme="light"] .graph-controls .graph-type-toggle {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .graph-controls .graph-type-toggle button {
  color: var(--text-muted);
}

[data-theme="light"] .graph-controls .graph-type-toggle button:hover {
  color: var(--text-primary);
}

[data-theme="light"] .graph-controls .graph-type-toggle button.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

[data-theme="light"] .btn-reset {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}

[data-theme="light"] .btn-reset:hover {
  color: var(--text-primary);
  border-color: #c7d2fe;
}

[data-theme="light"] .legend {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

[data-theme="light"] .legend-item {
  color: var(--text-secondary);
}

[data-theme="light"] .graph-instructions {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

[data-theme="light"] .graph-instructions kbd {
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-color: var(--border-color);
}

/* Sidebar - Light */
[data-theme="light"] .sidebar {
  background: var(--bg-card);
  border-left-color: var(--border-color);
  box-shadow: -4px 0 12px rgba(0,0,0,0.05);
}

[data-theme="light"] .sidebar h2 {
  color: var(--text-primary);
}

[data-theme="light"] .btn-close {
  background: var(--bg-hover);
  color: var(--text-muted);
}

[data-theme="light"] .btn-close:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

[data-theme="light"] .detail-row {
  border-bottom-color: var(--border-light);
}

[data-theme="light"] .detail-label {
  color: var(--text-muted);
}

[data-theme="light"] .detail-value {
  color: var(--text-primary);
}

[data-theme="light"] .connections h3 {
  color: var(--text-muted);
}

[data-theme="light"] .connection-item {
  background: var(--bg-hover);
  border-color: transparent;
}

[data-theme="light"] .connection-item:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .conn-name {
  color: var(--text-primary);
}

[data-theme="light"] .conn-type {
  color: var(--text-muted);
  background: var(--bg-hover);
}

/* Tooltips - Light */
[data-theme="light"] .graph-tooltip,
[data-theme="light"] .sankey-tooltip {
  background: var(--bg-card);
  border-color: #c7d2fe;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .graph-tooltip strong,
[data-theme="light"] .sankey-tooltip strong {
  color: var(--text-primary);
}

[data-theme="light"] .graph-tooltip .type,
[data-theme="light"] .sankey-tooltip .stage-label {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
}

/* Loading - Light */
[data-theme="light"] .loading-overlay {
  background: rgba(248, 249, 252, 0.95);
}

[data-theme="light"] .loading-overlay p {
  color: var(--text-secondary);
}

[data-theme="light"] .spinner {
  border-color: var(--border-color);
  border-top-color: #4f46e5;
}

/* Scrollbar - Light */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* ============================================================================
   INVESTIGATION VIEW STYLES
   ============================================================================ */

.investigation-view {
  padding: 24px;
  overflow-y: auto;
  height: calc(100vh - 64px);
}

.investigation-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(234, 88, 12, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  margin-bottom: 24px;
}

.banner-icon {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-icon svg { stroke: #ef4444; }

.banner-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
}

.banner-content p {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0;
}

.investigation-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(234, 88, 12, 0.15)) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.investigation-btn:hover, .investigation-btn.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(234, 88, 12, 0.25)) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

.investigation-btn svg { stroke: #ef4444; }

.investigation-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid;
}

.metric-card.red { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.metric-card.orange { background: rgba(249, 115, 22, 0.1); border-color: rgba(249, 115, 22, 0.3); }
.metric-card.yellow { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); }
.metric-card.purple { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.3); }

.metric-value { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.metric-card.red .metric-value { color: #ef4444; }
.metric-card.orange .metric-value { color: #f97316; }
.metric-card.yellow .metric-value { color: #eab308; }
.metric-card.purple .metric-value { color: #8b5cf6; }

.metric-label { font-size: 0.9rem; color: #9ca3af; margin: 8px 0; }

.metric-alert {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.metric-card.red .metric-alert { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.metric-card.orange .metric-alert { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.metric-card.yellow .metric-alert { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.metric-card.purple .metric-alert { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }

.investigation-section {
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

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

.section-header h3 { font-size: 1.1rem; font-weight: 600; color: #fff; margin: 0; }

.section-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.section-badge.danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.network-container {
  width: 100%;
  height: 500px;
  background: rgba(15, 15, 30, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

.network-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #9ca3af; }
.legend-item .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.issuer { background: #ef4444; }
.dot.intermediary { background: #f59e0b; }
.dot.receiver { background: #10b981; }
.dot.offshore { background: #8b5cf6; }

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.pattern-card {
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.pattern-card.danger { border-color: rgba(239, 68, 68, 0.3); }
.pattern-card.warning { border-color: rgba(249, 115, 22, 0.3); }
.pattern-card.info { border-color: rgba(59, 130, 246, 0.3); }
.pattern-card.alert { border-color: rgba(234, 179, 8, 0.3); }

.pattern-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pattern-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.pattern-card.danger .pattern-icon { background: rgba(239, 68, 68, 0.2); }
.pattern-card.danger .pattern-icon svg { stroke: #ef4444; }
.pattern-card.warning .pattern-icon { background: rgba(249, 115, 22, 0.2); }
.pattern-card.warning .pattern-icon svg { stroke: #f97316; }
.pattern-card.info .pattern-icon { background: rgba(59, 130, 246, 0.2); }
.pattern-card.info .pattern-icon svg { stroke: #3b82f6; }
.pattern-card.alert .pattern-icon { background: rgba(234, 179, 8, 0.2); }
.pattern-card.alert .pattern-icon svg { stroke: #eab308; }

.pattern-title h4 { font-size: 1rem; font-weight: 600; color: #fff; margin: 0 0 4px 0; }

.pattern-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
}

.pattern-badge.danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.pattern-badge.warning { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.pattern-badge.info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.pattern-badge.alert { background: rgba(234, 179, 8, 0.2); color: #eab308; }

.pattern-content { padding: 12px; max-height: 320px; overflow-y: auto; }

.pattern-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.pattern-table th {
  text-align: left;
  padding: 8px;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pattern-table td {
  padding: 8px;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pattern-table tr.highlight { background: rgba(239, 68, 68, 0.1); }
.pattern-table tr.funnel { background: rgba(239, 68, 68, 0.1); }
.pattern-table tr.batch { background: rgba(234, 179, 8, 0.1); }
.pattern-table .entity { color: #fff; font-weight: 500; }
.pattern-table .pct { color: #ef4444; font-weight: 600; }

.type-funnel { color: #ef4444; font-weight: 600; }
.type-narrow { color: #f97316; }
.type-distributed { color: #10b981; }
.type-batch { color: #eab308; font-weight: 600; }
.type-normal { color: #6b7280; }

.jurisdiction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.jurisdiction-card {
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
}

.jurisdiction-card.outflow { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }
.jurisdiction-card.inflow { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }

.jurisdiction-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.jurisdiction-name { font-weight: 600; color: #fff; font-size: 0.95rem; }

.jurisdiction-direction {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.jurisdiction-direction.inflow { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.jurisdiction-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.jurisdiction-stats .stat { text-align: center; }
.jurisdiction-stats .stat-label { display: block; font-size: 0.65rem; color: #6b7280; margin-bottom: 4px; }
.jurisdiction-stats .stat-value { font-size: 0.85rem; font-weight: 600; color: #fff; }
.jurisdiction-stats .stat-value.negative { color: #ef4444; }

.jurisdiction-entities {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dual-identity-table-container { overflow-x: auto; }
.dual-identity-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }

.dual-identity-table th {
  text-align: left;
  padding: 12px;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.dual-identity-table td {
  padding: 10px 12px;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dual-identity-table tr:hover { background: rgba(255, 255, 255, 0.03); }
.dual-identity-table .client, .dual-identity-table .entity { color: #fff; font-weight: 500; }
.dual-identity-table .inn { font-family: monospace; color: #9ca3af; font-size: 0.75rem; }
.dual-identity-table .jurisdiction { font-weight: 600; font-size: 0.75rem; }
.dual-identity-table .jurisdiction.ru { color: #ef4444; }
.dual-identity-table .jurisdiction.offshore { color: #8b5cf6; }
.dual-identity-table .jurisdiction.kg, .dual-identity-table .jurisdiction.kz { color: #06b6d4; }
.dual-identity-table .volume { color: #10b981; font-weight: 500; }
.dual-identity-table .notes { color: #f59e0b; font-weight: 600; }

.receivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.receiver-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.receiver-card.offshore { border-color: rgba(139, 92, 246, 0.3); }
.receiver-card.kg, .receiver-card.kz { border-color: rgba(6, 182, 212, 0.3); }

.receiver-rank {
  width: 28px;
  height: 28px;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #818cf8;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.receiver-info { flex: 1; min-width: 0; }
.receiver-name { font-weight: 500; color: #fff; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receiver-jurisdiction { font-size: 0.7rem; color: #6b7280; }
.receiver-stats { text-align: right; flex-shrink: 0; }
.receiver-notes { font-size: 0.7rem; color: #9ca3af; }
.receiver-volume { font-size: 0.9rem; font-weight: 600; color: #10b981; }
.receiver-categories { font-size: 0.65rem; color: #6b7280; flex-shrink: 0; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.network-tooltip {
  position: absolute;
  background: rgba(15, 15, 30, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.8rem;
  color: #d1d5db;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 250px;
}

.network-tooltip strong { color: #fff; font-size: 0.9rem; }

.network-tooltip .type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin: 6px 0;
}

.network-tooltip .type-badge.issuer { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.network-tooltip .type-badge.intermediary { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.network-tooltip .type-badge.receiver { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.network-tooltip .flow-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-top: 4px;
}

/* Light Theme - Investigation */
[data-theme="light"] .investigation-banner { background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(234, 88, 12, 0.05)); border-color: rgba(239, 68, 68, 0.2); }
[data-theme="light"] .banner-icon { background: rgba(239, 68, 68, 0.1); }
[data-theme="light"] .banner-content h2 { color: var(--text-primary); }
[data-theme="light"] .banner-content p { color: var(--text-secondary); }
[data-theme="light"] .metric-card { background: var(--bg-card); box-shadow: var(--shadow); }
[data-theme="light"] .metric-label { color: var(--text-secondary); }
[data-theme="light"] .investigation-section { background: var(--bg-card); border-color: var(--border-color); box-shadow: var(--shadow); }
[data-theme="light"] .section-header h3 { color: var(--text-primary); }
[data-theme="light"] .network-container { background: #f1f5f9; }
[data-theme="light"] .legend-item { color: var(--text-secondary); }
[data-theme="light"] .pattern-card { background: var(--bg-card); box-shadow: var(--shadow); }
[data-theme="light"] .pattern-header { border-color: var(--border-color); }
[data-theme="light"] .pattern-title h4 { color: var(--text-primary); }
[data-theme="light"] .pattern-table th { color: var(--text-secondary); border-color: var(--border-color); }
[data-theme="light"] .pattern-table td { color: var(--text-primary); border-color: var(--border-color); }
[data-theme="light"] .pattern-table .entity { color: var(--text-primary); }
[data-theme="light"] .jurisdiction-card { background: var(--bg-card); box-shadow: var(--shadow); }
[data-theme="light"] .jurisdiction-name { color: var(--text-primary); }
[data-theme="light"] .jurisdiction-stats .stat-value { color: var(--text-primary); }
[data-theme="light"] .dual-identity-table th { background: #f8fafc; color: var(--text-secondary); border-color: var(--border-color); }
[data-theme="light"] .dual-identity-table td { color: var(--text-primary); border-color: var(--border-color); }
[data-theme="light"] .dual-identity-table .client, [data-theme="light"] .dual-identity-table .entity { color: var(--text-primary); }
[data-theme="light"] .receiver-card { background: var(--bg-card); box-shadow: var(--shadow); }
[data-theme="light"] .receiver-name { color: var(--text-primary); }
[data-theme="light"] .network-tooltip { background: var(--bg-card); border-color: rgba(99, 102, 241, 0.2); box-shadow: var(--shadow); color: var(--text-secondary); }
[data-theme="light"] .network-tooltip strong { color: var(--text-primary); }

@media (max-width: 1200px) {
  .investigation-metrics { grid-template-columns: repeat(2, 1fr); }
  .pattern-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .investigation-metrics { grid-template-columns: 1fr; }
  .investigation-banner { flex-direction: column; text-align: center; }
}

/* NEW: Secondary Metrics Row Colors */
.investigation-metrics.secondary { margin-top: -0.5rem; }

.metric-card.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(8, 145, 178, 0.08)); border-color: rgba(6, 182, 212, 0.3); }
.metric-card.cyan .metric-value { color: #06b6d4; }
.metric-card.cyan .metric-alert { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }

.metric-card.pink { background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(219, 39, 119, 0.08)); border-color: rgba(236, 72, 153, 0.3); }
.metric-card.pink .metric-value { color: #ec4899; }
.metric-card.pink .metric-alert { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

.metric-card.teal { background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(13, 148, 136, 0.08)); border-color: rgba(20, 184, 166, 0.3); }
.metric-card.teal .metric-value { color: #14b8a6; }
.metric-card.teal .metric-alert { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }

.metric-card.gold { background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(202, 138, 4, 0.08)); border-color: rgba(234, 179, 8, 0.3); }
.metric-card.gold .metric-value { color: #eab308; }
.metric-card.gold .metric-alert { background: rgba(234, 179, 8, 0.2); color: #facc15; }

/* Pattern Explanation */
.pattern-explanation {
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid rgba(99, 102, 241, 0.3);
  color: #9ca3af;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  border-radius: 0 6px 6px 0;
}

/* Extraction Grid (Self-Redemption) */
.extraction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.extraction-card {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  position: relative;
}

.extraction-card.kg { background: rgba(234, 179, 8, 0.08); border-color: rgba(234, 179, 8, 0.2); }
.extraction-card.unknown { background: rgba(156, 163, 175, 0.08); border-color: rgba(156, 163, 175, 0.2); }

.extraction-rank {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.extraction-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #f3f4f6;
  margin-bottom: 0.25rem;
  padding-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.extraction-jurisdiction {
  font-size: 0.65rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.extraction-volume {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ef4444;
}

.extraction-notes {
  font-size: 0.7rem;
  color: #6b7280;
}

/* Weekend Grid */
.weekend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.weekend-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.weekend-day {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 0.5rem;
}

.weekend-notes {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f97316;
}

.weekend-volume {
  font-size: 0.9rem;
  color: #fbbf24;
  margin-bottom: 0.25rem;
}

.weekend-categories {
  font-size: 0.65rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Table highlight row */
.dual-identity-table tr.highlight {
  background: rgba(239, 68, 68, 0.1) !important;
}

.dual-identity-table tr.highlight td {
  color: #fff;
}

.dual-identity-table td.sources {
  font-weight: 600;
  color: #f97316;
}

.dual-identity-table td.date {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.75rem;
  color: #9ca3af;
}

.dual-identity-table td.avg-value {
  font-weight: 600;
  color: #10b981;
}

.dual-identity-table td.category {
  font-weight: 500;
}

/* Light Theme - New Components */
[data-theme="light"] .pattern-explanation { background: rgba(99, 102, 241, 0.05); color: var(--text-secondary); }
[data-theme="light"] .extraction-card { background: rgba(239, 68, 68, 0.03); }
[data-theme="light"] .extraction-name { color: var(--text-primary); }
[data-theme="light"] .weekend-card { background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(249, 115, 22, 0.02)); }
[data-theme="light"] .metric-card.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(8, 145, 178, 0.03)); }
[data-theme="light"] .metric-card.pink { background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(219, 39, 119, 0.03)); }
[data-theme="light"] .metric-card.teal { background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(13, 148, 136, 0.03)); }
[data-theme="light"] .metric-card.gold { background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(202, 138, 4, 0.03)); }

/* ============================================================================
   INVESTIGATION SECURITY MODAL
   ============================================================================ */

.investigation-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

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

.investigation-modal {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(239, 68, 68, 0.1);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
  border-radius: 50%;
  margin-bottom: 1rem;
  color: #ef4444;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.modal-header p {
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.5;
}

.modal-body {
  padding: 1.5rem 2rem;
}

.access-code-input {
  margin-bottom: 1rem;
}

.access-code-input label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.access-code-input input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: 'Monaco', 'Consolas', monospace;
  letter-spacing: 2px;
  transition: all 0.2s;
}

.access-code-input input:focus {
  outline: none;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.access-code-input input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.access-code-input input::placeholder {
  color: #6b7280;
  letter-spacing: normal;
}

.visibility-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.visibility-toggle:hover {
  color: #9ca3af;
}

.auth-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-error .attempts {
  color: #f87171;
  font-size: 0.75rem;
}

.lockout-warning {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 8px;
  color: #eab308;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-authenticate {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-authenticate:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-authenticate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-footer {
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.security-notice svg {
  color: #4ade80;
}

/* Session Bar */
.investigation-session-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border-top: 1px solid rgba(16, 185, 129, 0.3);
  z-index: 1000;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #10b981;
}

.session-timer {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.75rem;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Light Theme Modal */
[data-theme="light"] .investigation-modal {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .modal-header h2 { color: var(--text-primary); }
[data-theme="light"] .modal-header p { color: var(--text-secondary); }
[data-theme="light"] .access-code-input input {
  background: #f1f5f9;
  border-color: var(--border-color);
  color: var(--text-primary);
}
[data-theme="light"] .investigation-session-bar {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.05));
}
