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

body {
  background: #0a0a1a;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #3a3a5e;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a5a8e;
}

.header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #2a2a4a;
  flex-shrink: 0;
  z-index: 10;
}

.header-content {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

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

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ff4444, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

.title-letter {
  cursor: default;
  transition: opacity 0.15s;
}

.title-letter:hover {
  opacity: 0.85;
}

.title-letter.seq-flash {
  animation: seqFlash 0.3s ease;
}

@keyframes seqFlash {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.subtitle {
  font-size: 13px;
  color: #8888aa;
  font-weight: 300;
}

.main-container {
  display: grid;
  grid-template-columns: 280px 1fr 350px;
  height: calc(100vh - 64px - 42px - 32px);
  flex: 1;
  overflow: hidden;
}

.sidebar-left {
  background: #0f0f24;
  border-right: 1px solid #2a2a4a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  padding: 12px;
  border-bottom: 1px solid #1a1a3a;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8888aa;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  background: #2a2a5a;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: #aaa;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #4a90d9;
}

.search-input::placeholder {
  color: #555;
}

.filter-section {
  padding: 8px 12px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-btn {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #1a1a2e;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-btn.active {
  background: #2a2a5a;
  color: #e0e0e0;
  border-color: #4a4a7a;
}

.filter-btn:hover {
  background: #2a2a5a;
}

.entity-list-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.entity-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.entity-card {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #1a1a3a;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.entity-card:hover {
  background: #1a1a3a;
  padding-left: 16px;
  border-left: 2px solid #4a90d9;
}

.entity-card.selected {
  background: #1a2a4a;
  border-left: 3px solid #4a90d9;
}

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

.entity-card-score {
  font-size: 10px;
  color: #666;
}

.badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-lg {
  width: auto;
  height: auto;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-key_figure, .badge-key_figure.badge-lg { background: #ff4444; }
.badge-associate, .badge-associate.badge-lg { background: #ff8c00; }
.badge-witness, .badge-witness.badge-lg { background: #ffd700; color: #000; }
.badge-mentioned, .badge-mentioned.badge-lg { background: #4a90d9; }
.badge-victim, .badge-victim.badge-lg { background: #9b59b6; }

.graph-area {
  position: relative;
  background: radial-gradient(ellipse at center, #0d0d2a 0%, #050510 70%, #000 100%);
  overflow: hidden;
}

.graph-container {
  width: 100%;
  height: 100%;
}

.graph-empty-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 4;
  pointer-events: none;
  padding: 40px;
}

.graph-empty-state.hidden {
  display: none !important;
}

.graph-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.graph-empty-title {
  font-size: 22px;
  font-weight: 600;
  color: #6a6a8a;
  margin-bottom: 12px;
}

.graph-empty-text {
  font-size: 14px;
  color: #555;
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.graph-empty-text strong {
  color: #7a7aaa;
}

.graph-empty-hint {
  font-size: 12px;
  color: #3a3a5a;
  margin-top: 8px;
}

.graph-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}

.control-btn {
  width: 32px;
  height: 32px;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.control-btn:hover {
  background: #2a2a5a;
  color: #fff;
}

.graph-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 15, 36, 0.9);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 6;
  color: #aaa;
}

.sidebar-right {
  background: #0f0f24;
  border-left: 1px solid #2a2a4a;
  overflow-y: auto;
}

.entity-details {
  padding: 16px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
  color: #555;
  padding: 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  color: #6a6a8a;
  margin-bottom: 4px;
}

.hint {
  font-size: 12px;
  margin-top: 8px;
  color: #444;
  line-height: 1.5;
}

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

.detail-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-score {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6a6a8a;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a1a3a;
}

.detail-info {
  font-size: 13px;
  line-height: 1.6;
  color: #bbb;
}

.evidence-item {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  transition: border-color 0.2s;
}

.evidence-item:hover {
  border-color: #4a4a7a;
}

.evidence-text {
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 6px;
  font-style: italic;
}

.evidence-source {
  font-size: 11px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

.citation-item {
  padding: 8px 0;
  border-bottom: 1px solid #1a1a3a;
}

.citation-item:last-child {
  border-bottom: none;
}

.citation-link {
  color: #4a90d9;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}

.citation-link:hover {
  text-decoration: underline;
  color: #6ab0f9;
}

.citation-snippet {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  line-height: 1.4;
}

.btn-enrich {
  width: 100%;
  margin-top: 8px;
}

.status-bar {
  background: linear-gradient(90deg, #0d0d20, #101030, #0d0d20);
  border-top: 1px solid #2a2a4a;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  flex-shrink: 0;
  height: 32px;
}

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

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.4);
}

.status-indicator.processing {
  background: #ff8c00;
  box-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

.status-indicator.error {
  background: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

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

.status-sep {
  color: #333;
}

.status-right {
  color: #888;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #3a80c9;
}

.btn-secondary {
  background: #2a2a4a;
  color: #ccc;
}

.btn-secondary:hover:not(:disabled) {
  background: #3a3a5a;
}

.btn-success {
  background: #2ecc71;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #27ae60;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #c0392b;
}

.btn-icon {
  font-size: 14px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #12122a;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  width: 640px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a4a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #2a2a4a;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-group {
  margin-bottom: 14px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  border-color: #4a90d9;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #4a90d9;
}

.form-select {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 12px;
}

.processing-progress {
  margin-top: 12px;
}

.progress-bar {
  height: 4px;
  background: #1a1a2e;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90d9, #2ecc71);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #2a2a4a;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

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

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  color: #e0e0e0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-success {
  border-left: 3px solid #2ecc71;
}

.toast-error {
  border-left: 3px solid #e74c3c;
}

.toast-info {
  border-left: 3px solid #4a90d9;
}

.toast-warning {
  border-left: 3px solid #ff8c00;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    display: none;
  }

  .sidebar-right {
    display: none;
  }

  .sidebar-right.visible {
    display: block;
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 32px;
    width: 350px;
    z-index: 20;
  }

  .header-content {
    gap: 8px;
  }

  .title {
    font-size: 20px;
  }

  .subtitle {
    display: none;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 8px 12px;
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .title {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .graph-legend {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-actions .btn-pipeline,
  .header-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.btn-pipeline {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulse-glow 2s infinite;
  position: relative;
}

.btn-pipeline:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-pipeline.running {
  background: linear-gradient(135deg, #e67e22, #d35400);
  animation: pulse-glow-running 1s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.3); }
  50% { box-shadow: 0 0 25px rgba(231, 76, 60, 0.6), 0 0 50px rgba(231, 76, 60, 0.2); }
}

@keyframes pulse-glow-running {
  0%, 100% { box-shadow: 0 0 5px rgba(230, 126, 34, 0.4); }
  50% { box-shadow: 0 0 20px rgba(230, 126, 34, 0.7), 0 0 40px rgba(230, 126, 34, 0.3); }
}

.pipeline-panel {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-bottom: 2px solid #e74c3c;
  padding: 14px 24px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pipeline-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.pipeline-phase-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pipeline-phase {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-label {
  color: #8899aa;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
}

.phase-value {
  color: #e74c3c;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

.pipeline-step {
  flex: 1;
}

.step-value {
  color: #aabbcc;
  font-size: 13px;
  font-style: italic;
}

.pipeline-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-name {
  color: #ddd;
  font-size: 12px;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 600px;
}

.pipeline-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: #2a2a4a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #e67e22);
  border-radius: 4px;
  transition: width 0.5s ease;
}

#pipelineProgressText {
  font-size: 13px;
  color: #aabbcc;
  white-space: nowrap;
}

.pipeline-stats {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #8899aa;
}

.pipeline-stats strong {
  color: #e0e0e0;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: #0d0d20;
  border-bottom: 1px solid #2a2a4a;
  padding: 0 24px;
  gap: 0;
  flex-shrink: 0;
}

.tab-btn {
  padding: 10px 24px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  color: #aaa;
  background: rgba(255,255,255,0.03);
}

.tab-btn.active {
  color: #e0e0e0;
  border-bottom-color: #ff4444;
}

/* Admin Section */
.admin-section {
  padding: 8px 12px;
}

.admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-toggle-label {
  font-size: 11px;
  color: #9b59b6;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2a2a4a;
  border-radius: 20px;
  transition: all 0.3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #888;
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #9b59b6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
  background: #fff;
}

/* Map View */
.map-view {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: 1fr;
  height: calc(100vh - 64px - 42px - 32px);
  flex: 1;
  overflow: hidden;
  position: relative;
}

.map-container {
  width: 100%;
  height: 100%;
  background: #0a0a1a;
  grid-column: 1;
  grid-row: 1;
}

.map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  gap: 0;
  background: rgba(15, 15, 36, 0.9);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.map-layer-btn {
  padding: 8px 16px;
  background: transparent;
  color: #aaa;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

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

.map-layer-btn.active {
  background: rgba(74,144,217,0.3);
  color: #4a90d9;
}

.map-legend {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 1000;
  background: rgba(15, 15, 36, 0.9);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ccc;
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: inline-block;
}

.legend-dot.verified {
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46,204,113,0.6);
}

.legend-dot.suspected {
  background: #e67e22;
  box-shadow: 0 0 6px rgba(230,126,34,0.6);
}

.legend-dot.mixed {
  background: linear-gradient(135deg, #2ecc71 50%, #e67e22 50%);
  box-shadow: 0 0 6px rgba(200,180,0,0.6);
}

.map-sidebar {
  background: #0f0f24;
  border-left: 1px solid #2a2a4a;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.map-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #2a2a4a;
}

.map-sidebar-header h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8888aa;
}

.location-details {
  padding: 16px;
  flex: 1;
}

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

.location-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.location-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #2a2a5a;
  color: #aaa;
}

.location-address {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.activity-section {
  margin-bottom: 16px;
}

.activity-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a1a3a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.activity-section-title.verified {
  color: #2ecc71;
}

.activity-section-title.suspected {
  color: #e67e22;
}

.activity-item {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.activity-item.verified {
  border-left: 3px solid #2ecc71;
}

.activity-item.suspected {
  border-left: 3px solid #e67e22;
}

.activity-date {
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
}

.activity-description {
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 6px;
}

.activity-individuals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.individual-tag {
  padding: 2px 6px;
  background: #2a2a5a;
  border-radius: 3px;
  font-size: 10px;
  color: #aaa;
}

/* Location list in map sidebar when no location selected */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a3a;
  cursor: pointer;
  transition: all 0.2s;
}

.location-list-item:hover {
  background: #1a1a3a;
  padding-left: 16px;
}

.location-list-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}

.location-list-info {
  font-size: 11px;
  color: #666;
}

/* Victim protected styling */
.entity-card.victim-hidden .entity-card-name {
  color: #9b59b6;
  font-style: italic;
}

.node-protected {
  opacity: 0.7;
}

.verified-badge {
  color: #2ecc71;
  font-size: 10px;
  font-weight: 600;
}

.suspected-badge {
  color: #e67e22;
  font-size: 10px;
  font-weight: 600;
}

/* Map marker popup styling */
.leaflet-popup-content-wrapper {
  background: #1a1a2e !important;
  color: #e0e0e0 !important;
  border: 1px solid #2a2a4a !important;
  border-radius: 8px !important;
}

.leaflet-popup-tip {
  background: #1a1a2e !important;
  border: 1px solid #2a2a4a !important;
}

.leaflet-popup-content {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(15, 15, 36, 0.95) !important;
  color: #e0e0e0 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 15, 36, 0.95) !important;
}

.map-popup-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #fff;
}

.map-popup-type {
  font-size: 11px;
  color: #8888aa;
  text-transform: uppercase;
}

.map-popup-count {
  font-size: 12px;
  margin-top: 4px;
  color: #ccc;
}

.documents-view {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #0a0a1a;
  height: calc(100vh - 64px - 42px - 32px);
}

.documents-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #0f0f24;
  padding: 16px 24px;
  border-bottom: 1px solid #2a2a4a;
  display: flex;
  align-items: center;
  gap: 16px;
}

.doc-search-input {
  max-width: 400px;
}

.documents-list {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-card {
  background: #12122a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.doc-card:hover {
  border-color: #4a4a7a;
}

.doc-card.expanded {
  border-color: #4a90d9;
  box-shadow: 0 0 12px rgba(74, 144, 217, 0.15);
}

.doc-card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.doc-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.doc-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  word-break: break-word;
}

.doc-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #888;
}

.doc-dataset {
  background: #2a2a5a;
  padding: 2px 8px;
  border-radius: 4px;
  color: #aaa;
}

.doc-pages,
.doc-entities-count,
.doc-date {
  white-space: nowrap;
}

.doc-card-body {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid #1a1a3a;
}

.doc-card.expanded .doc-card-body {
  display: block;
}

.doc-section {
  margin-top: 12px;
}

.doc-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6a6a8a;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a1a3a;
}

.doc-summary {
  font-size: 13px;
  line-height: 1.6;
  color: #bbb;
}

.doc-findings-list,
.doc-crossrefs-list {
  list-style: none;
  padding: 0;
}

.doc-findings-list li,
.doc-crossrefs-list li {
  font-size: 12px;
  color: #bbb;
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.5;
}

.doc-findings-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #4a90d9;
  font-weight: bold;
}

.doc-crossrefs-list li::before {
  content: "\2194";
  position: absolute;
  left: 0;
  color: #ff8c00;
}

.doc-entities-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-entity-tag {
  background: #1a1a3a;
  border: 1px solid #2a2a5a;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #aaa;
}

.financials-view {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  height: calc(100vh - 160px);
  overflow-y: auto;
}
.financials-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.fin-search-input {
  flex: 1;
}
.financials-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.fin-stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 16px 24px;
  text-align: center;
  flex: 1;
}
.fin-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #4caf50;
}
.fin-stat-label {
  font-size: 12px;
  color: #8888aa;
  margin-top: 4px;
  text-transform: uppercase;
}
.financials-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fin-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.fin-card:hover {
  border-color: rgba(76,175,80,0.4);
}
.fin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.fin-amount {
  font-size: 18px;
  font-weight: 700;
  color: #4caf50;
}
.fin-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(76,175,80,0.15);
  color: #4caf50;
  text-transform: uppercase;
}
.fin-parties {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}
.fin-from {
  color: #ff8c00;
}
.fin-arrow {
  color: #666;
}
.fin-to {
  color: #4a90d9;
}
.fin-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #8888aa;
  margin-bottom: 8px;
}
.fin-detail-item {
  display: flex;
  gap: 4px;
}
.fin-detail-label {
  color: #666;
}
.fin-purpose {
  font-size: 13px;
  color: #aaa;
  margin-top: 4px;
}
.fin-excerpt {
  display: none;
  font-size: 12px;
  color: #777;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-style: italic;
}
.fin-card.expanded .fin-excerpt {
  display: block;
}
.fin-analysis {
  display: none;
  font-size: 12px;
  color: #9b9bbb;
  margin-top: 6px;
}
.fin-card.expanded .fin-analysis {
  display: block;
}
.fin-source {
  font-size: 11px;
  color: #555;
  margin-top: 6px;
}

.lang-selector {
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.lang-selector:focus {
  border-color: #4a90d9;
}
.lang-selector option {
  background: #1a1a2e;
  color: #e0e0e0;
}

[dir="rtl"] .main-container {
  direction: rtl;
}
[dir="rtl"] .entity-card:hover {
  padding-left: 12px;
  padding-right: 16px;
  border-left: none;
  border-right: 2px solid #4a90d9;
}
[dir="rtl"] .entity-card.selected {
  border-left: none;
  border-right: 3px solid #4a90d9;
}
[dir="rtl"] .sidebar-left {
  border-right: none;
  border-left: 1px solid #2a2a4a;
}
[dir="rtl"] .sidebar-right {
  border-left: none;
  border-right: 1px solid #2a2a4a;
}
[dir="rtl"] .map-sidebar {
  border-left: none;
  border-right: 1px solid #2a2a4a;
}
[dir="rtl"] .toast-container {
  right: auto;
  left: 20px;
}
[dir="rtl"] .toast-success {
  border-left: none;
  border-right: 3px solid #2ecc71;
}
[dir="rtl"] .toast-error {
  border-left: none;
  border-right: 3px solid #e74c3c;
}
[dir="rtl"] .toast-info {
  border-left: none;
  border-right: 3px solid #4a90d9;
}
[dir="rtl"] .toast-warning {
  border-left: none;
  border-right: 3px solid #ff8c00;
}
[dir="rtl"] .activity-item.verified {
  border-left: none;
  border-right: 3px solid #2ecc71;
}
[dir="rtl"] .activity-item.suspected {
  border-left: none;
  border-right: 3px solid #e67e22;
}

.site-footer {
  background: #0a0a0a;
  border-top: 1px solid rgba(0, 255, 65, 0.15);
  padding: 12px 20px;
  text-align: center;
  flex-shrink: 0;
  z-index: 10;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}
.trademark-notice {
  color: rgba(0, 255, 65, 0.6);
  font-size: 0.75rem;
  margin: 0 0 4px 0;
  font-family: 'Courier New', monospace;
}
.footer-links {
  margin: 0;
}
.footer-company {
  color: rgba(0, 255, 65, 0.4);
  font-size: 0.7rem;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-donate {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}
.btn-donate::before {
  content: "\2764";
}
.btn-donate:hover {
  background: linear-gradient(135deg, #ff6b6b, #e74c3c);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.5);
  transform: translateY(-1px);
}

.donate-modal {
  max-width: 480px;
  width: 90%;
}
.donate-description {
  color: rgba(0, 255, 65, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
}
.donate-amount-section {
  margin-top: 10px;
}
.donate-amount-section label {
  display: block;
  color: rgba(0, 255, 65, 0.8);
  font-size: 0.85rem;
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
}
.donate-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.donate-preset-btn {
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid rgba(0, 255, 65, 0.3);
  color: #00ff41;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 60px;
}
.donate-preset-btn:hover {
  background: rgba(0, 255, 65, 0.2);
  border-color: #00ff41;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}
.donate-preset-btn.active {
  background: rgba(0, 255, 65, 0.25);
  border-color: #00ff41;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}
.donate-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 6px;
  padding: 4px 12px;
}
.donate-currency {
  color: #00ff41;
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}
.donate-input {
  background: transparent;
  border: none;
  color: #00ff41;
  font-size: 1.1rem;
  font-family: 'Courier New', monospace;
  width: 100%;
  padding: 8px 0;
  outline: none;
}
.donate-input::placeholder {
  color: rgba(0, 255, 65, 0.3);
}
.donate-input::-webkit-inner-spin-button,
.donate-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.donate-input[type=number] {
  -moz-appearance: textfield;
}
.btn-donate-submit {
  background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
  color: #fff !important;
  border: none !important;
  padding: 10px 24px !important;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-donate-submit:hover {
  background: linear-gradient(135deg, #ff6b6b, #e74c3c) !important;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.5);
  transform: translateY(-1px);
}

[dir="rtl"] .donate-custom {
  flex-direction: row-reverse;
}
[dir="rtl"] .site-footer {
  direction: rtl;
}
