:root {
  --bg-bunker: #0b0d10;
  --bg-panel: #11151c;
  --bg-panel-alt: #161b24;
  --manila: #e8dcc4;
  --manila-light: #fbf8ef;
  --amber: #d97706;
  --amber-bright: #f59e0b;
  --red-stamp: #b91c1c;
  --red-bright: #ef4444;
  --green-ok: #15803d;
  --green-bright: #22c55e;
  --blue-intel: #3b82f6;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border-dark: #262f3d;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-mono: "Courier New", Courier, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-bunker);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP CLASSIFICATION & NAVIGATION BAR */
.top-header {
  background: linear-gradient(180deg, #06080a 0%, #10141b 100%);
  border-bottom: 2px solid var(--amber);
  padding: 10px 24px 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75);
}

.top-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stamp-badge {
  border: 2px solid var(--red-bright);
  color: #fca5a5;
  background: rgba(185, 28, 28, 0.22);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  text-transform: uppercase;
  box-shadow: inset 0 0 8px rgba(185, 28, 28, 0.35);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.6px;
  margin: 0;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber-bright);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.kpi-strip {
  display: flex;
  gap: 12px;
  align-items: center;
}

.kpi-pill {
  background: #161c26;
  border: 1px solid #2e3846;
  border-left: 3px solid var(--amber);
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
}

.kpi-pill strong {
  color: #ffffff;
  font-size: 13px;
}

/* MODE TABS */
.mode-nav {
  display: flex;
  gap: 6px;
  border-top: 1px solid #1e2631;
  padding-top: 8px;
}

.mode-btn {
  background: #141922;
  color: #94a3b8;
  border: 1px solid #262f3d;
  border-bottom: none;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 4px 4px 0 0;
}

.mode-btn:hover {
  background: #1c2430;
  color: #f8fafc;
}

.mode-btn.active {
  background: var(--amber);
  color: #090b0e;
  border-color: var(--amber-bright);
  box-shadow: 0 -2px 12px rgba(217, 119, 6, 0.35);
}

/* MAIN WORKSPACE */
.workspace {
  flex: 1;
  padding: 18px 24px;
  max-width: 2560px;
  width: 100%;
  margin: 0 auto;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* VIEW 1: CITEȘTE DOSARUL (CARTEA A4 + SIDEBAR) */
.reader-layout {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  gap: 20px;
  align-items: start;
}

.fascicle-sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--amber);
  padding: 14px;
  position: sticky;
  top: 115px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.sidebar-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-bright);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-dark);
}

.fasc-filter-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #161c26;
  border: 1px solid #283242;
  border-left: 3px solid transparent;
  color: #cbd5e1;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.fasc-filter-btn:hover,
.fasc-filter-btn.active {
  background: #1f2937;
  border-left-color: var(--amber-bright);
  color: #ffffff;
  font-weight: 700;
}

.page-jump-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.page-jump-btn {
  background: #141922;
  border: 1px solid #2d3748;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 0;
  text-align: center;
  cursor: pointer;
}

.page-jump-btn.active,
.page-jump-btn:hover {
  background: var(--amber);
  color: #0b0d10;
  font-weight: 700;
}

.book-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.book-toolbar {
  width: 100%;
  max-width: 900px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.book-toolbar button {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid var(--amber);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Scoped A4 Dossier Page styling inside Mode I */
.book-page-wrapper {
  width: 100%;
  max-width: 900px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
}

.book-page-wrapper .page {
  width: 100%;
  min-height: 1180px;
  padding: 24px 30px 44px 30px;
  background: #fbf8ef;
  color: #16181d;
  border: 2px solid #b8ab90;
  position: relative;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.44;
}

.book-page-wrapper .page.page-dark {
  background: #0d1117;
  color: #e2e8f0;
  border: 2px solid var(--amber);
}

.book-page-wrapper .run-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 1.5px solid #1e293b;
  padding-bottom: 6px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: bold;
  color: #334155;
}

.book-page-wrapper .page-dark .run-head {
  border-bottom-color: var(--amber);
  color: var(--amber-bright);
}

.book-page-wrapper .run-foot {
  position: absolute;
  bottom: 12px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #94a3b8;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #475569;
}

.book-page-wrapper .fascicle-banner {
  background: #111827;
  color: #f8fafc;
  border-left: 5px solid var(--amber);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.book-page-wrapper .fascicle-banner .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fbbf24;
  font-weight: bold;
}

.book-page-wrapper .fascicle-banner h1 {
  margin: 4px 0 8px 0;
  font-size: 19px;
  color: #ffffff;
}

.book-page-wrapper .fascicle-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
  border-top: 1px dashed #475569;
  padding-top: 8px;
}

.book-page-wrapper .nodes-bar {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dotted #475569;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #93c5fd;
}

.book-page-wrapper h2 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #7c2d12;
  border-bottom: 1.5px solid #b45309;
  padding-bottom: 4px;
  margin: 14px 0 8px 0;
}

.book-page-wrapper .two-col {
  column-count: 2;
  column-gap: 22px;
  column-rule: 1px solid #cbd5e1;
}

.book-page-wrapper .telex-box {
  background: #efe8d5;
  border: 1px solid #78716c;
  border-left: 4px solid #b91c1c;
  padding: 10px 14px;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #1c1917;
}

.book-page-wrapper .telex-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #78716c;
  padding-bottom: 4px;
  margin-bottom: 6px;
  font-weight: bold;
  color: #991b1b;
}

.book-page-wrapper .telex-trans {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dotted #a8a29e;
  font-family: var(--font-serif);
  font-style: italic;
}

.book-page-wrapper table.arch-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11.5px;
}

.book-page-wrapper table.arch-table th {
  background: #1e293b;
  color: #f8fafc;
  font-family: var(--font-mono);
  padding: 6px 8px;
  border: 1px solid #334155;
  text-align: left;
}

.book-page-wrapper table.arch-table td {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #16181d;
  vertical-align: top;
}

.book-page-wrapper .verdict-cell {
  background: #fef3c7 !important;
  border-left: 3px solid #d97706 !important;
}

.book-page-wrapper .dossier-note {
  background: #fefce8;
  border: 1px solid #eab308;
  border-left: 4px solid #ca8a04;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 12px;
  color: #1c1917;
}

.book-page-wrapper .map-frame {
  border: 2px solid var(--amber);
  background: #0d1117;
  padding: 6px;
  margin: 8px 0;
}

.book-page-wrapper .map-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* VIEW 2: GRAFUL DE CONEXIUNI (REȚEAUA) */
.network-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 20px;
  align-items: start;
}

.graph-panel {
  background: radial-gradient(circle at center, #131924 0%, #090c10 100%);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--amber);
  padding: 14px;
  position: relative;
}

.graph-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: #161d29;
  border: 1px solid #2d3848;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 11px;
  cursor: pointer;
  border-radius: 3px;
}

.chip-btn.active,
.chip-btn:hover {
  background: var(--amber);
  color: #0b0d10;
  font-weight: 700;
  border-color: var(--amber-bright);
}

.graph-svg-wrap {
  width: 100%;
  height: 760px;
  border: 1px solid #1f2937;
  background:
    linear-gradient(rgba(30, 41, 59, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.25) 1px, transparent 1px);
  background-size: 32px 32px;
  position: relative;
}

#networkSvg {
  width: 100%;
  height: 100%;
  display: block;
}

.target-card {
  background: var(--manila);
  color: #18181b;
  border: 2px solid var(--amber);
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  position: sticky;
  top: 115px;
}

.target-card-header {
  border-bottom: 2px solid #78350f;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.target-card-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--red-stamp);
  letter-spacing: 0.8px;
}

.target-card h2 {
  margin: 4px 0;
  font-family: var(--font-serif);
  font-size: 20px;
  color: #0f172a;
}

.target-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.target-meta-box {
  background: #f5efe0;
  border: 1px solid #c7b99e;
  border-left: 4px solid #78350f;
  padding: 8px 10px;
}

.target-meta-box strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #78350f;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.conn-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  max-height: 240px;
  overflow-y: auto;
}

.conn-list li {
  background: #efe6d2;
  border: 1px solid #d1c4aa;
  padding: 6px 8px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.conn-list li:hover {
  border-color: var(--red-stamp);
  background: #fef3c7;
}

/* VIEW 3: HARTA OPERAȚIONALĂ BUCUREȘTI 1944–1946 (4K) */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 20px;
  align-items: start;
}

.map-stage-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--amber);
  padding: 14px;
}

.map-interactive-container {
  position: relative;
  width: 100%;
  border: 2px solid var(--amber);
  background: #080b10;
  overflow: hidden;
}

.map-interactive-container img {
  width: 100%;
  height: auto;
  display: block;
}

.map-pin-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
  transition: transform 0.15s ease;
}

.map-pin-marker:hover,
.map-pin-marker.active {
  transform: translate(-50%, -50%) scale(1.28);
  z-index: 20;
  box-shadow: 0 0 20px #fbbf24;
}

.map-pin-marker.layer-oss { background: #d97706; }
.map-pin-marker.layer-ro_net { background: #15803d; }
.map-pin-marker.layer-soviet { background: #b91c1c; }
.map-pin-marker.layer-crisis { background: #2563eb; }

/* VIEW 4: CAMERA DOVEDIRII (DOCUMENT X-RAY VIEWER & CONTRADICȚII) */
.xray-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.doc-selector-list {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--amber);
  padding: 14px;
}

.doc-card-btn {
  width: 100%;
  text-align: left;
  background: #151b24;
  border: 1px solid #283242;
  border-left: 4px solid var(--amber);
  color: #e2e8f0;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-card-btn.active,
.doc-card-btn:hover {
  background: #1f2937;
  border-color: var(--amber-bright);
  border-left-width: 6px;
}

.doc-card-btn .doc-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--amber-bright);
  font-weight: 700;
}

.doc-card-btn .doc-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  margin: 4px 0;
  color: #ffffff;
}

.xray-viewer-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--red-bright);
  padding: 18px;
}

.xray-layer-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.layer-tab-btn {
  flex: 1;
  background: #161d29;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.layer-tab-btn.active {
  background: var(--red-stamp);
  color: #ffffff;
  border-color: #f87171;
}

.xray-content-box {
  background: var(--manila-light);
  color: #18181b;
  border: 2px solid #78716c;
  border-left: 6px solid var(--red-stamp);
  padding: 18px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 20px;
}

.contra-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.contra-card {
  background: #141a23;
  border: 1px solid #2e3846;
  border-left: 4px solid var(--amber-bright);
  padding: 12px 16px;
}

.contra-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 12px;
  margin-top: 8px;
}

.contra-col {
  background: #0e131a;
  border: 1px solid #242e3d;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}

.contra-col.verdict {
  background: rgba(217, 119, 6, 0.12);
  border-color: var(--amber);
}

/* VIEW 5: CRONOLOGIA DUBLĂ (146 EVENIMENTE: 90 SEC. B + 26 SEC. C) */
.timeline-controls {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-top: 3px solid var(--amber);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.search-input {
  background: #0b0e14;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 320px;
}

.timeline-table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  overflow-x: auto;
}

table.chrono-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.chrono-table th {
  background: #18202c;
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 2px solid var(--amber);
  text-align: left;
}

table.chrono-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2937;
  vertical-align: top;
}

table.chrono-table tr:hover td {
  background: #17202e;
}

.badge-cert {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
}

.badge-cert.confirmed {
  background: rgba(21, 128, 61, 0.25);
  color: #4ade80;
  border: 1px solid #16a34a;
}

.badge-cert.contested {
  background: rgba(217, 119, 6, 0.25);
  color: #fbbf24;
  border: 1px solid #d97706;
}

.badge-cert.single {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  border: 1px solid #f87171;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-decoration: none;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.45);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pdf-download-btn:hover {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.65);
}
