/* ==========================================================================
   EVIDENTIA LEGAL 2.0 — Diseño Corporativo Luminoso (Paleta Caribe / Festival de Barranquilla)
   Menú Lateral Izquierdo | Ley 527 de 1999 | Decreto 2364 de 2012 | CGP Arts. 243–247
   ========================================================================== */

:root {
  /* Paleta Corporativa Luminosa inspirada en Barranquilla (Azul Caribe, Verde Esmeralda, Dorado Sol, Rojo Cayena) */
  --bg-app: #f3f6fb;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-subtle: #f1f5f9;
  --border-subtle: #dbe3ef;
  --border-highlight: #0066b2;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Acentos Corporativos Festival de Barranquilla */
  --barranquilla-blue: #005596;
  --barranquilla-cyan: #0088cc;
  --barranquilla-green: #009b4d;
  --barranquilla-gold: #f59e0b;
  --barranquilla-yellow: #ffb703;
  --barranquilla-red: #e63946;

  --accent-emerald: #009b4d;
  --accent-whatsapp: #25d366;
  --accent-blue: #005596;
  --accent-gold: #e08e00;
  --accent-crimson: #e63946;

  /* WhatsApp Desktop macOS Light Palette */
  --wsp-rail-bg: #f0f2f5;
  --wsp-sidebar-bg: #ffffff;
  --wsp-chat-bg: #efeae2;
  --wsp-header-bg: #f0f2f5;
  --wsp-outgoing: #d9fdd3;
  --wsp-incoming: #ffffff;
  --wsp-border: #e2e8f0;
  --wsp-text: #111b21;
  --wsp-subtext: #667781;
  --wsp-teal: #008069;
  --wsp-check-blue: #53bdeb;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Cinta Superior Multicromática Corporativa (Rojo Cayena, Amarillo Sol, Verde Esmeralda, Azul Caribe) */
body::before {
  content: "";
  display: block;
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #e63946 0%, #ffb703 33%, #009b4d 66%, #005596 100%);
  position: sticky;
  top: 0;
  z-index: 200;
}

/* Accesibilidad WCAG 2.2 AA — Foco Visible */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.step-tab:focus-visible,
.wsp-bubble:focus-visible {
  outline: 2px solid var(--barranquilla-blue) !important;
  outline-offset: 2px !important;
}

/* ==========================================================================
   BARRA DE GOBERNANZA SAAS MULTI-ORGANIZACIÓN, EXPEDIENTE, RBAC E IA
   ========================================================================== */
.governance-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.76rem;
}

.gov-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gov-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 8px;
}

.gov-select-group label {
  color: var(--barranquilla-blue);
  font-weight: 800;
  font-size: 0.69rem;
  text-transform: uppercase;
}

.gov-select {
  background: transparent;
  color: #0f172a;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.gov-select option {
  background: #ffffff;
  color: #0f172a;
}

/* ==========================================================================
   ENCABEZADO CORPORATIVO SUPERIOR
   ========================================================================== */
.top-judicial-header {
  background: linear-gradient(135deg, #00427a 0%, #005596 55%, #0077b6 100%);
  border-bottom: 3px solid var(--barranquilla-yellow);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 85, 150, 0.16);
}

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

.brand-seal {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb703, #fb8500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(251, 133, 0, 0.35);
  border: 2px solid #ffffff;
}

.brand-titles h1 {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-aistudio {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ffb703;
  color: #0f172a;
  text-transform: uppercase;
}

.brand-titles p {
  font-size: 0.79rem;
  color: #e0f2fe;
}

.normative-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.norm-pill {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.norm-pill.verified {
  background: rgba(255, 255, 255, 0.95);
  border-color: #ffffff;
  color: #005596;
}

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

/* ==========================================================================
   LAYOUT PRINCIPAL CON MENÚ LATERAL IZQUIERDO
   ========================================================================== */
.app-shell-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 120px);
  align-items: start;
}

@media (max-width: 1024px) {
  .app-shell-layout {
    grid-template-columns: 1fr;
  }
}

.left-sidebar-nav {
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  padding: 18px 14px;
  position: sticky;
  top: 6px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}

@media (max-width: 1024px) {
  .left-sidebar-nav {
    position: relative;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

.sidebar-menu-header {
  padding: 4px 8px 12px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 8px;
}

.sidebar-menu-header .sm-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--barranquilla-red);
}

.sidebar-menu-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--barranquilla-blue);
  margin-top: 2px;
}

.pipeline-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-tab {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: all 0.18s ease;
  text-align: left;
  color: var(--text-main);
  width: 100%;
}

.step-tab:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
  border-left-color: var(--barranquilla-cyan);
  transform: translateX(2px);
}

.step-tab.active {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
  border-color: #93c5fd;
  border-left: 5px solid var(--barranquilla-green);
  box-shadow: 0 4px 12px rgba(0, 85, 150, 0.1);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.84rem;
  color: #334155;
  flex-shrink: 0;
}

.step-tab.active .step-num {
  background: linear-gradient(135deg, var(--barranquilla-blue), var(--barranquilla-green));
  color: #ffffff;
}

.step-info {
  overflow: hidden;
}

.step-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.step-tab.active .step-title {
  color: var(--barranquilla-blue);
}

.step-law {
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-footer-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--barranquilla-gold);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.73rem;
  color: #78350f;
}

/* ==========================================================================
   CONTENEDOR DE CONTENIDO PRINCIPAL
   ========================================================================== */
.workspace-container {
  max-width: 1420px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 28px 60px;
}

.stage-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

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

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

/* Barra Resumen del Expediente */
.case-summary-bar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-top: 4px solid var(--barranquilla-blue);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.case-summary-metrics {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.metric-chip {
  display: flex;
  flex-direction: column;
}

.metric-chip .m-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.metric-chip .m-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.metric-chip .m-val.emerald {
  color: var(--barranquilla-green);
}

/* Botones Corporativos */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #008040, #009b4d);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 155, 77, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #006b35, #008040);
}

.btn-blue {
  background: linear-gradient(135deg, #005596, #0077b6);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 85, 150, 0.25);
}

.btn-blue:hover {
  background: linear-gradient(135deg, #00427a, #005596);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #ffb703);
  color: #0f172a;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.btn-outline {
  background: #ffffff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: var(--barranquilla-blue);
  color: var(--barranquilla-blue);
}

.top-judicial-header .btn-outline {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.top-judicial-header .btn-outline:hover {
  background: rgba(255, 255, 255, 0.28);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--barranquilla-blue);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.section-header h2 {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--barranquilla-blue);
}

.section-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 820px;
  margin-top: 3px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

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

@media (max-width: 1150px) {
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

.forensic-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  color: var(--text-main);
}

.forensic-card h3 {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-dropzone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
  display: block;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--barranquilla-green);
  background: #ecfdf5;
}

.upload-dropzone .dz-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.upload-dropzone .dz-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--barranquilla-blue);
}

.upload-dropzone .dz-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tablas Corporativas Claras */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.forensic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: #1e293b;
}

.forensic-table th {
  background: #eff6ff;
  color: var(--barranquilla-blue);
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
  border-bottom: 2px solid #bfdbfe;
}

.forensic-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.forensic-table tr:hover td {
  background: #f8fafc;
}

.hash-code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  background: #f0f9ff;
  padding: 3px 7px;
  border-radius: 5px;
  color: #0369a1;
  border: 1px solid #bae6fd;
  word-break: break-all;
  display: inline-block;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge.ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-badge.info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

.status-badge.warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ==========================================================================
   SIMULADOR MACOS WHATSAPP DESKTOP
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1280px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.macos-window {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 0 0 1px #cbd5e1;
  color: var(--wsp-text);
  display: flex;
  flex-direction: column;
  height: 740px;
}

.macos-titlebar {
  background: #20262e;
  color: #e2e8f0;
  font-size: 0.74rem;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #111;
}

.macos-menubar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.macos-menubar-left strong {
  color: #fff;
}

.macos-menubar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.wsp-app-grid {
  display: grid;
  grid-template-columns: 138px 250px 1fr;
  flex: 1;
  min-height: 0;
  background: #fff;
}

@media (max-width: 900px) {
  .wsp-app-grid {
    grid-template-columns: 1fr;
  }
  .wsp-left-rail, .wsp-chat-list-col {
    display: none;
  }
}

.wsp-left-rail {
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px 12px;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.tl-dot.red { background: #ff5f56; border: 1px solid #e0443e; }
.tl-dot.yellow { background: #ffbd2e; border: 1px solid #dea123; }
.tl-dot.green { background: #27c93f; border: 1px solid #1aab29; }

.wsp-rail-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wsp-rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
}

.wsp-rail-item.active {
  background: #e2e5e9;
  font-weight: 700;
}

.wsp-rail-item:hover:not(.active) {
  background: #eaecef;
}

.wsp-rail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wsp-rail-count {
  font-size: 0.7rem;
  color: #6b7280;
}

.wsp-rail-section-title {
  font-size: 0.68rem;
  color: #6b7280;
  padding: 8px 9px 3px;
  display: flex;
  justify-content: space-between;
}

.wsp-rail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 2px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1f2937;
}

.wsp-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a88b73, #6d533f);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.wsp-chat-list-col {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wsp-chatlist-top {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wsp-chatlist-top h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111b21;
}

.wsp-icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0f2f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #3b4a54;
  cursor: pointer;
}

.wsp-icon-circle.green {
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.wsp-search-wrap {
  padding: 0 10px 8px;
}

.wsp-search-input {
  width: 100%;
  background: #f0f2f5;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.76rem;
  color: #111b21;
  outline: none;
}

.wsp-chats-scroll {
  flex: 1;
  overflow-y: auto;
}

.wsp-chat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f5f6f6;
  transition: background 0.12s;
}

.wsp-chat-row:hover {
  background: #f8f9fa;
}

.wsp-chat-row.active {
  background: #f0f2f5;
}

.wsp-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  position: relative;
}

.wsp-timer-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cbd5e1;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wsp-chat-meta {
  flex: 1;
  min-width: 0;
}

.wsp-chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.wsp-chat-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111b21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wsp-chat-day {
  font-size: 0.66rem;
  color: #667781;
  flex-shrink: 0;
}

.wsp-chat-preview {
  font-size: 0.71rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.wsp-conversation-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-color: var(--wsp-chat-bg);
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 18px 18px;
  position: relative;
}

.wsp-conv-header {
  background: #f0f2f5;
  border-bottom: 1px solid #d1d7db;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wsp-conv-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wsp-conv-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111b21;
}

.wsp-conv-subtitle {
  font-size: 0.71rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wsp-conv-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #54656f;
  font-size: 0.85rem;
}

.wsp-messages-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wsp-date-divider {
  align-self: center;
  background: rgba(255, 255, 255, 0.92);
  color: #54656f;
  font-size: 0.71rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  margin: 8px 0;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}

.wsp-system-event {
  align-self: center;
  background: rgba(255, 255, 255, 0.94);
  color: #3b4a54;
  font-size: 0.72rem;
  padding: 6px 16px;
  border-radius: 10px;
  margin: 8px 0;
  text-align: center;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
  cursor: pointer;
  border: 1px solid transparent;
}

.wsp-system-event strong.action-link {
  display: block;
  color: #111b21;
  font-weight: 700;
  margin-top: 2px;
}

.wsp-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 2px;
  position: relative;
}

.wsp-msg-row.outgoing {
  justify-content: flex-end;
}

.wsp-msg-row.incoming {
  justify-content: flex-start;
}

.wsp-sender-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.wsp-sender-avatar.placeholder {
  visibility: hidden;
}

.wsp-bubble {
  max-width: 74%;
  padding: 6px 9px 5px 9px;
  border-radius: 8px;
  box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.13);
  font-size: 0.81rem;
  line-height: 1.35;
  color: #111b21;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.wsp-bubble:hover {
  border-color: var(--barranquilla-cyan);
}

.wsp-bubble.selected-forensic {
  border-color: var(--barranquilla-blue);
  box-shadow: 0 0 0 3px rgba(0, 85, 150, 0.2);
}

.wsp-msg-row.incoming .wsp-bubble {
  background: var(--wsp-incoming);
  border-top-left-radius: 3px;
}

.wsp-msg-row.outgoing .wsp-bubble {
  background: var(--wsp-outgoing);
  border-top-right-radius: 3px;
}

.wsp-sender-name {
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 2px;
  display: block;
}

.wsp-quote-box {
  background: rgba(0, 0, 0, 0.05);
  border-left: 3.5px solid #1f9d55;
  border-radius: 5px;
  padding: 4px 8px;
  margin-bottom: 5px;
  font-size: 0.73rem;
}

.wsp-quote-author {
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 1px;
}

.wsp-quote-text {
  color: #54656f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wsp-mention {
  color: #008069;
  font-weight: 600;
}

.wsp-link-num {
  color: #008069;
  text-decoration: underline;
}

.wsp-msg-text {
  white-space: pre-line;
  word-wrap: break-word;
}

.wsp-msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  float: right;
  margin-left: 10px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: #667781;
}

.wsp-checks {
  color: var(--wsp-check-blue);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: -2px;
}

.wsp-embedded-table-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  margin: 4px 0 4px;
}

.wsp-embedded-table-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.73rem;
  padding: 5px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  color: #1e293b;
}

.wsp-mini-radicados-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.65rem;
  color: #0f172a;
}

.wsp-mini-radicados-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 5px;
  font-weight: 700;
  text-align: center;
}

.wsp-mini-radicados-table td {
  border: 1px solid #cbd5e1;
  padding: 2.5px 5px;
  text-align: center;
  font-family: "SF Mono", Menlo, monospace;
}

.wsp-mini-radicados-table tr.highlight-obs12 td {
  background: #fef9c3;
  font-weight: 700;
}

.forensic-tag-pill {
  display: none;
  font-size: 0.62rem;
  font-family: "SF Mono", Menlo, monospace;
  background: #005596;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.show-forensic-tags .forensic-tag-pill {
  display: inline-block;
}

.wsp-composer-bar {
  background: #f0f2f5;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #d1d7db;
}

.wsp-composer-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.78rem;
  color: #111b21;
  outline: none;
}

/* Galería de Capturas */
.screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .screenshots-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.screenshot-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.18s ease;
}

.screenshot-card:hover, .screenshot-card.active {
  border-color: var(--barranquilla-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 85, 150, 0.12);
}

.screenshot-card img {
  width: 100%;
  height: 135px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-subtle);
}

.screenshot-card-body {
  padding: 9px 10px;
}

.screenshot-card-body h4 {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--barranquilla-blue);
  margin-bottom: 3px;
}

.screenshot-card-body p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   CONSOLA DE EXHIBICIÓN Y COTEJO EN AUDIENCIA
   ========================================================================== */
.internal-browser-frame {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.browser-toolbar {
  background: #f1f5f9;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #cbd5e1;
  flex-wrap: wrap;
}

.browser-url-bar {
  flex: 1;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: #0f172a;
}

.tls-lock-badge {
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
}

.browser-viewport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

@media (max-width: 900px) {
  .browser-viewport-grid {
    grid-template-columns: 1fr;
  }
}

.live-stream-pane {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.live-video-box {
  background: #ffffff;
  border: 2px dashed #93c5fd;
  border-radius: 10px;
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.live-video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.live-video-box.streaming video {
  display: block;
}

.live-video-box.streaming .stream-placeholder {
  display: none;
}

/* ==========================================================================
   HOJA DE INFORME DOCUMENTAL Y GLOSARIO
   ========================================================================== */
.judicial-document-paper {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-top: 5px solid var(--barranquilla-blue);
  border-radius: 10px;
  padding: 40px 48px;
  max-width: 1060px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.58;
}

.judicial-document-paper h1,
.judicial-document-paper h2,
.judicial-document-paper h3,
.judicial-document-paper h4,
.judicial-document-paper th {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.doc-header-seal {
  border-bottom: 3px double var(--barranquilla-blue);
  padding-bottom: 16px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.doc-section-title {
  font-size: 0.98rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #eff6ff;
  border-left: 5px solid var(--barranquilla-blue);
  padding: 7px 12px;
  margin: 24px 0 12px;
  color: var(--barranquilla-blue);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 0.78rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.doc-table th, .doc-table td {
  border: 1px solid #cbd5e1;
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: #f1f5f9;
  font-weight: 800;
  color: #0f172a;
}

.doc-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 14px 0;
}

.doc-evidence-item {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
  page-break-inside: avoid;
}

.doc-evidence-item img {
  width: 100%;
  height: auto;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* Modal Lightbox */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border: 2px solid var(--barranquilla-blue);
  border-radius: 12px;
  max-width: 1120px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  color: #0f172a;
}

/* Formularios Corporativos Claros */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 8px 11px;
  color: #0f172a;
  font-size: 0.82rem;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--barranquilla-blue);
  background: #ffffff;
}

/* Reglas de Impresión Judicial Oficial */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  body::before,
  .governance-bar,
  .top-judicial-header,
  .left-sidebar-nav,
  .case-summary-bar,
  .no-print {
    display: none !important;
  }
  .app-shell-layout {
    display: block !important;
  }
  .workspace-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .stage-panel {
    display: none !important;
  }
  #stage-6 {
    display: block !important;
  }
  .judicial-document-paper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}
