/**
 * THE 88TH FLOOR: SMART TOWER LOCKDOWN
 * Judicial Conviction Report & Resolution Certificate
 * Premium Editorial Stylesheet for Screen & High-Fidelity Print (@media print)
 */

:root {
  --color-obsidian-950: #06090e;
  --color-obsidian-900: #0c121d;
  --color-obsidian-850: #121a28;
  --color-obsidian-800: #1a2538;
  --color-obsidian-700: #2b3952;
  --color-gold-300: #fbf3d5;
  --color-gold-400: #f4dc8a;
  --color-gold-500: #d4af37;
  --color-gold-600: #b89125;
  --color-gold-700: #8c6c14;
  --color-cyan-400: #38bdf8;
  --color-cyan-500: #00e5ff;
  --color-crimson-500: #ef4444;
  --color-crimson-600: #dc2626;
  --font-serif-court: 'Cinzel', 'Times New Roman', serif;
  --font-sans-body: var(--font-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  --font-mono-tech: 'JetBrains Mono', 'Courier New', monospace;

  /* Holographic terminal printout theme (screen). @media print flips these
     back to a print-economical light paper so the certificate stays a clean,
     ink-friendly PDF/printout regardless of the on-screen presentation. */
  --judicial-page-bg: var(--color-obsidian-950);
  --judicial-panel-bg: var(--color-obsidian-900);
  --judicial-chip-bg: var(--color-obsidian-850);
  --judicial-border-subtle: rgba(255, 255, 255, 0.12);
  --judicial-text-main: #f1f5f9;
  --judicial-text-dim: #94a3b8;
}

/* ==========================================================================
   1. MODAL OVERLAY & SCREEN PRESENTATION
   ========================================================================== */

.judicial-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 7, 12, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}

.judicial-modal-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 210mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(12, 18, 29, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(8px);
}

.judicial-toolbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.judicial-toolbar-badge {
  background: linear-gradient(135deg, #b89125, #f4dc8a, #8c6c14);
  color: #06090e;
  font-family: var(--font-mono-tech);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.judicial-toolbar-title {
  color: #f8fafc;
  font-family: var(--font-sans-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.judicial-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.judicial-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono-tech);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.judicial-btn-primary {
  background: linear-gradient(135deg, #d4af37 0%, #f4dc8a 50%, #b89125 100%);
  color: #06090e;
  border-color: #f4dc8a;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

.judicial-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
  filter: brightness(1.05);
}

.judicial-btn-secondary {
  background: rgba(26, 37, 56, 0.8);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.15);
}

.judicial-btn-secondary:hover {
  background: rgba(43, 57, 82, 1);
  color: #ffffff;
  border-color: rgba(212, 175, 55, 0.4);
}

.judicial-btn-close {
  background: transparent;
  color: #94a3b8;
  border-color: transparent;
  padding: 8px 12px;
}

.judicial-btn-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   2. DOSSIER CONTAINER & PAGES (A4 PHYSICAL SPECIFICATIONS)
   ========================================================================== */

.judicial-document-wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 210mm;
}

.judicial-page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  background: var(--judicial-page-bg);
  color: var(--judicial-text-main);
  padding: 16mm 18mm 15mm;
  font-family: var(--font-sans-body);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 229, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 2px;
}

/* Outer Security Guilloche Border */
.judicial-page::before {
  content: '';
  position: absolute;
  top: 7mm;
  left: 7mm;
  right: 7mm;
  bottom: 7mm;
  border: 2px solid #b89125;
  outline: 1px dashed rgba(184, 145, 37, 0.4);
  outline-offset: -5px;
  pointer-events: none;
  z-index: 1;
}

/* Corner Filigrees / Crosshairs */
.judicial-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
  border-color: #8c6c14;
}
.judicial-corner-tl { top: 8mm; left: 8mm; border-top: 3px solid #8c6c14; border-left: 3px solid #8c6c14; }
.judicial-corner-tr { top: 8mm; right: 8mm; border-top: 3px solid #8c6c14; border-right: 3px solid #8c6c14; }
.judicial-corner-bl { bottom: 8mm; left: 8mm; border-bottom: 3px solid #8c6c14; border-left: 3px solid #8c6c14; }
.judicial-corner-br { bottom: 8mm; right: 8mm; border-bottom: 3px solid #8c6c14; border-right: 3px solid #8c6c14; }

/* Subtle Background Security Watermark */
.judicial-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-family: var(--font-serif-court);
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 12px;
  color: rgba(212, 175, 55, 0.07);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  text-transform: uppercase;
}

/* ==========================================================================
   3. EDITORIAL HEADER & METADATA BARS
   ========================================================================== */

.judicial-header {
  position: relative;
  z-index: 3;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.judicial-classification-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono-tech);
  font-size: 9px;
  font-weight: 700;
  color: #b89125;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(184, 145, 37, 0.3);
  padding-bottom: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.judicial-brand-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.judicial-bureau-emblem {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.judicial-title-group {
  flex-grow: 1;
  text-align: center;
}

.judicial-bureau-name {
  font-family: var(--font-serif-court);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--judicial-text-main);
  line-height: 1.15;
  text-transform: uppercase;
  margin: 0;
}

.judicial-division-name {
  font-family: var(--font-mono-tech);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--judicial-text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.judicial-report-title {
  display: inline-block;
  background: var(--color-gold-700);
  color: var(--color-gold-300);
  font-family: var(--font-mono-tech);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  padding: 3px 14px;
  margin-top: 6px;
  text-transform: uppercase;
  border-radius: 2px;
}

.judicial-barcode-box {
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.judicial-barcode-svg {
  height: 32px;
  width: 95px;
}

.judicial-barcode-label {
  font-family: var(--font-mono-tech);
  font-size: 8px;
  color: var(--judicial-text-dim);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Dossier Meta Strip */
.judicial-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--judicial-panel-bg);
  border: 1px solid var(--judicial-border-subtle);
  border-left: 4px solid #b89125;
  padding: 8px 12px;
  margin-bottom: 14px;
  gap: 8px;
  font-size: 10px;
  position: relative;
  z-index: 3;
}

.judicial-meta-item {
  display: flex;
  flex-direction: column;
}

.judicial-meta-label {
  font-family: var(--font-mono-tech);
  font-size: 8px;
  font-weight: 600;
  color: var(--judicial-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.judicial-meta-value {
  font-family: var(--font-mono-tech);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--judicial-text-main);
}

.judicial-meta-status {
  color: #dc2626;
  font-weight: 800;
}

/* ==========================================================================
   4. CONVICTED PERPETRATOR PROFILE CARD
   ========================================================================== */

.judicial-perpetrator-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  background: var(--judicial-panel-bg);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.judicial-mugshot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.judicial-mugshot-frame {
  width: 120px;
  height: 140px;
  background: #0f172a;
  border: 2px solid #b89125;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.judicial-convict-svg {
  width: 100%;
  height: 100%;
}

.judicial-stamp-convicted {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  border: 3px solid #dc2626;
  color: #dc2626;
  font-family: var(--font-mono-tech);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.25);
  pointer-events: none;
  text-transform: uppercase;
}

.judicial-id-tag {
  margin-top: 6px;
  font-family: var(--font-mono-tech);
  font-size: 11px;
  font-weight: 800;
  color: var(--judicial-text-main);
  background: var(--judicial-chip-bg);
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--judicial-border-subtle);
}

.judicial-perpetrator-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.judicial-culprit-headline {
  border-bottom: 1px solid var(--judicial-border-subtle);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.judicial-culprit-name {
  font-family: var(--font-serif-court);
  font-size: 20px;
  font-weight: 800;
  color: var(--judicial-text-main);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.judicial-culprit-sub {
  font-family: var(--font-mono-tech);
  font-size: 10px;
  font-weight: 600;
  color: #b89125;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.judicial-culprit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 9.5px;
}

.judicial-culprit-spec {
  display: flex;
  flex-direction: column;
}

.judicial-spec-label {
  font-family: var(--font-mono-tech);
  font-size: 8px;
  color: var(--judicial-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.judicial-spec-val {
  font-family: var(--font-mono-tech);
  font-size: 10px;
  font-weight: 700;
  color: var(--judicial-text-main);
}

/* ==========================================================================
   5. CRIME SYNOPSIS & CORPUS DELICTI
   ========================================================================== */

.judicial-crime-section {
  position: relative;
  z-index: 3;
  margin-bottom: 14px;
}

.judicial-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif-court);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--judicial-text-main);
  text-transform: uppercase;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.35);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.judicial-section-title::before {
  content: '■';
  color: #b89125;
  font-size: 10px;
}

.judicial-synopsis-box {
  background: var(--judicial-panel-bg);
  border: 1px solid var(--judicial-border-subtle);
  border-left: 3px solid #b89125;
  padding: 10px 14px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--judicial-text-main);
  text-align: justify;
}

.judicial-synopsis-box p {
  margin: 0 0 6px 0;
}
.judicial-synopsis-box p:last-child {
  margin-bottom: 0;
}

.judicial-evidence-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.judicial-evidence-pill {
  background: var(--judicial-chip-bg);
  border: 1px solid var(--judicial-border-subtle);
  padding: 6px 10px;
  border-radius: 3px;
}

.judicial-pill-label {
  font-family: var(--font-mono-tech);
  font-size: 7.5px;
  font-weight: 700;
  color: var(--judicial-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.judicial-pill-val {
  font-family: var(--font-mono-tech);
  font-size: 9px;
  font-weight: 700;
  color: var(--judicial-text-main);
}

.judicial-pill-val.highlight-crimson {
  color: #f87171;
}

.judicial-pill-val.highlight-gold {
  color: #f4dc8a;
}

/* ==========================================================================
   6. PAGE 2: FUNNEL REDUCTION TELEMETRY & INVESTIGATION METRICS
   ========================================================================== */

.judicial-funnel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  margin-bottom: 14px;
  position: relative;
  z-index: 3;
}

.judicial-funnel-table th {
  background: var(--color-obsidian-700);
  color: #f8fafc;
  font-family: var(--font-mono-tech);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
  text-align: left;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.judicial-funnel-table td {
  padding: 7px 10px;
  border: 1px solid var(--judicial-border-subtle);
  font-family: var(--font-sans-body);
  color: var(--judicial-text-main);
  vertical-align: middle;
}

.judicial-funnel-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.judicial-funnel-step {
  font-family: var(--font-mono-tech);
  font-weight: 700;
  color: #b89125;
  width: 55px;
}

.judicial-funnel-evidence {
  font-weight: 600;
}

.judicial-funnel-evidence small {
  display: block;
  font-family: var(--font-mono-tech);
  font-size: 8px;
  color: var(--judicial-text-dim);
  font-weight: normal;
  margin-top: 1px;
}

.judicial-funnel-count {
  font-family: var(--font-mono-tech);
  font-weight: 800;
  text-align: right;
  width: 100px;
}

.judicial-funnel-count .count-current {
  color: var(--judicial-text-main);
}

.judicial-funnel-count .count-delta {
  font-size: 8px;
  color: #f87171;
  margin-left: 4px;
}

.judicial-funnel-table tr.culprit-row td {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
}

.judicial-funnel-table tr.culprit-row .judicial-funnel-step {
  color: #f87171;
}

.judicial-funnel-table tr.culprit-row .count-current {
  color: #f87171;
  font-size: 11px;
}

/* Investigator Metric Dashboard */
.judicial-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 3;
}

.judicial-metric-card {
  background: var(--judicial-panel-bg);
  border: 1px solid var(--judicial-border-subtle);
  border-top: 3px solid rgba(212, 175, 55, 0.4);
  border-radius: 3px;
  padding: 8px 10px;
  text-align: center;
}

.judicial-metric-card.elite-card {
  border-top-color: #d4af37;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14) 0%, var(--judicial-panel-bg) 100%);
}

.judicial-metric-label {
  font-family: var(--font-mono-tech);
  font-size: 7.5px;
  font-weight: 700;
  color: var(--judicial-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.judicial-metric-value {
  font-family: var(--font-mono-tech);
  font-size: 13px;
  font-weight: 800;
  color: var(--judicial-text-main);
}

.judicial-metric-rank {
  font-family: var(--font-serif-court);
  font-size: 10.5px;
  font-weight: 800;
  color: #f4dc8a;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* ==========================================================================
   7. HOLOGRAPHIC GOLD / OBSIDIAN SEAL & SIGNATURE BLOCK
   ========================================================================== */

.judicial-attestation-block {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--judicial-panel-bg);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.judicial-seal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.judicial-holo-seal {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 4px 10px rgba(184, 145, 37, 0.35));
}

.judicial-signatures-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.judicial-court-decree {
  font-family: var(--font-serif-court);
  font-size: 9px;
  line-height: 1.5;
  color: var(--judicial-text-dim);
  border-left: 2px solid #b89125;
  padding-left: 8px;
  font-style: italic;
}

.judicial-signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

.judicial-sig-cell {
  display: flex;
  flex-direction: column;
}

.judicial-sig-line {
  height: 38px;
  border-bottom: 1.5px solid var(--judicial-border-subtle);
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.judicial-sig-svg {
  height: 34px;
  width: 100%;
}

.judicial-sig-title {
  font-family: var(--font-mono-tech);
  font-size: 8px;
  font-weight: 700;
  color: var(--judicial-text-main);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.judicial-sig-subtitle {
  font-family: var(--font-mono-tech);
  font-size: 7.5px;
  color: var(--judicial-text-dim);
}

/* Footer Technical Strip */
.judicial-footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid var(--judicial-border-subtle);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono-tech);
  font-size: 7.5px;
  color: var(--judicial-text-dim);
  letter-spacing: 0.8px;
}

.judicial-hash-tag {
  font-family: var(--font-mono-tech);
  font-weight: 600;
  color: var(--judicial-text-dim);
}

/* ==========================================================================
   8. PRINT MEDIA STYLES (@media print) - ZERO AWKWARD CUTS
   ========================================================================== */

@media print {
  /* Flip the holographic-terminal screen theme back to economical light
     paper for print/PDF export, regardless of the on-screen dark theme. */
  :root {
    --judicial-page-bg: #ffffff;
    --judicial-panel-bg: #f8fafc;
    --judicial-chip-bg: #f1f5f9;
    --judicial-border-subtle: #cbd5e1;
    --judicial-text-main: #0f172a;
    --judicial-text-dim: #64748b;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 210mm;
    height: auto;
  }

  /* Hide screen elements */
  .no-print,
  .judicial-modal-toolbar,
  .judicial-modal-overlay > :not(.judicial-document-wrapper) {
    display: none !important;
  }

  .judicial-modal-overlay {
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .judicial-document-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    gap: 0 !important;
  }

  .judicial-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 14mm 16mm 12mm !important;
    page-break-before: auto !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .judicial-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  /* Prevent any internal element from breaking across pages */
  .judicial-header,
  .judicial-meta-strip,
  .judicial-perpetrator-card,
  .judicial-crime-section,
  .judicial-funnel-table,
  .judicial-metrics-grid,
  .judicial-attestation-block,
  .judicial-footer {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
