/* ===================================================
   GRUPO CHARLY — EXECUTIVE ADVISORY & LAKEHOUSE SUITE
   Design System · Tier 1 Executive Dark Theme (Sober & Restrained)
   =================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f1523;
  --card-bg: #111827;
  --card-hover: #162032;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --red: #f43f5e;
  --green: #10b981;
  --blue: #3b82f6;
  --amber: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 2rem;
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 100;
  gap: 1rem;
}

.brand-section { display: flex; align-items: center; gap: 1rem; }

.charly-badge {
  background: #991b1b;
  color: #fff; font-weight: 800; padding: 0.25rem 0.75rem;
  border-radius: 5px; font-size: 0.9rem; letter-spacing: 0.06em;
}
.trebola-badge {
  background: #1e3a8a;
  color: #fff; font-weight: 800; padding: 0.25rem 0.75rem;
  border-radius: 5px; font-size: 0.9rem; letter-spacing: 0.06em;
}

.brand-divider { width: 1px; height: 20px; background: var(--border-color); }

.partner-title h1 {
  font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em;
  color: #f8fafc;
}
.partner-title span { font-size: 0.68rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.view-tabs {
  display: flex; background: #0f1523;
  padding: 0.25rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color); gap: 0.25rem;
}
.tab-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-family: inherit; font-weight: 600; font-size: 0.8rem;
  padding: 0.4rem 0.95rem; border-radius: 4px;
  cursor: pointer; transition: var(--transition);
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.tab-btn.active {
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.report-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}
.report-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.uc-badge {
  display: flex; align-items: center; gap: 0.45rem;
  background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.75rem;
  color: #34d399; font-weight: 600;
}
.status-dot {
  width: 6px; height: 6px; background: #10b981; border-radius: 50%;
}

/* ===== LAYOUT ===== */
.dashboard-container {
  max-width: 1380px; margin: 0 auto;
  padding: 2rem 2rem 4rem; display: flex; flex-direction: column; gap: 2rem;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem;
  align-items: center; padding: 2.5rem 2.5rem;
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(14,165,233,0.03), transparent 60%);
}
.hero-eyebrow { font-size: 0.82rem; color: var(--cyan); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.hero-title { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 1rem; }
.highlight-red { color: var(--red); }
.hero-desc { font-size: 0.95rem; color: var(--text-muted); max-width: 540px; line-height: 1.7; }

.big-number-panel {
  background: rgba(225, 29, 72, 0.05); border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: var(--radius-lg); padding: 2rem 2.5rem; text-align: center; min-width: 280px;
}
.big-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: #f43f5e; font-weight: 700; margin-bottom: 0.5rem; }
.big-value { font-size: 3.2rem; font-weight: 900; color: #fff; letter-spacing: -0.04em; line-height: 1; }
.big-sublabel { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.5; }

/* ===== SECTION TITLES ===== */
.section-title { margin-bottom: -0.5rem; }
.section-title h3 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.section-title p { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== PAIN CARDS ===== */
.triple-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.pain-card {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: 0.75rem;
  transition: var(--transition);
}
.pain-card:hover { transform: translateY(-3px); }
.red-border { border-top: 3px solid var(--red); }
.amber-border { border-top: 3px solid var(--amber); }
.cyan-border { border-top: 3px solid var(--cyan); }

.pain-icon { font-size: 2rem; }
.pain-title { font-size: 1.1rem; font-weight: 700; color: #fff; }
.pain-stat { font-size: 1.5rem; font-weight: 800; color: #fff; }
.pain-card.red-border .pain-stat { color: #f43f5e; }
.pain-card.amber-border .pain-stat { color: #fbbf24; }
.pain-card.cyan-border .pain-stat { color: #38bdf8; }
.pain-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.pain-bottom { font-size: 0.83rem; color: var(--text-dim); padding-top: 0.75rem; border-top: 1px solid var(--border-color); }

/* ===== BEFORE / AFTER ===== */
.vs-grid { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 1.5rem; align-items: center; }
.vs-col { display: flex; flex-direction: column; gap: 0.6rem; }

.vs-header-badge {
  padding: 0.5rem 1rem; border-radius: 6px;
  font-size: 0.82rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem;
}
.before-badge { background: rgba(225,29,72,0.12); color: #f43f5e; border: 1px solid rgba(225,29,72,0.3); }
.after-badge { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

.vs-item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.87rem; color: var(--text-muted);
  background: rgba(255,255,255,0.02); padding: 0.6rem 0.8rem; border-radius: 6px;
}
.vs-item strong { color: var(--text-main); }
.vs-icon { flex-shrink: 0; }

.vs-divider {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.5rem; color: var(--cyan); font-size: 0.7rem;
  font-weight: 700; text-align: center;
}
.vs-arrow { font-size: 1.5rem; }
.vs-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===== KPI CARDS ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kpi-card {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); background: var(--card-hover); }
.kpi-header { display: flex; justify-content: space-between; align-items: center; }
.kpi-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.kpi-tag { font-size: 0.68rem; padding: 0.18rem 0.48rem; border-radius: 4px; font-weight: 700; }
.tag-red { background: rgba(225,29,72,0.12); color: #f43f5e; border: 1px solid rgba(225,29,72,0.25); }
.tag-green { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.tag-cyan { background: rgba(14,165,233,0.12); color: #38bdf8; border: 1px solid rgba(14,165,233,0.25); }
.tag-amber { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.kpi-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.kpi-subtext { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

/* ===== SECTION CARDS ===== */
.section-card {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.section-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); gap: 1rem;
}
.section-head h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.section-head p { font-size: 0.82rem; color: var(--text-muted); }

.dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ===== CHARTS ===== */
.chart-box { min-height: 260px; position: relative; width: 100%; }

/* ===== INSIGHT BOXES ===== */
.insight-box {
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.83rem; line-height: 1.6;
}
.insight-box.green { background: rgba(16,185,129,0.07); border-left: 3px solid var(--green); color: #a7f3d0; }
.insight-box.red { background: rgba(225,29,72,0.07); border-left: 3px solid var(--red); color: #fca5a5; }
.insight-box.cyan { background: rgba(14,165,233,0.07); border-left: 3px solid var(--cyan); color: #bae6fd; }
.insight-box.amber { background: rgba(245,158,11,0.07); border-left: 3px solid var(--amber); color: #fde68a; }
.insight-box strong { color: #fff; }

/* ===== SIMULATOR ===== */
.simulator-box {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.slider-container { display: flex; flex-direction: column; gap: 0.5rem; }
.slider-header { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; }
.slider-value { color: var(--green); font-size: 1.1rem; font-weight: 800; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-dim); }

input[type=range] {
  -webkit-appearance: none; width: 100%;
  background: rgba(255,255,255,0.08); height: 7px; border-radius: 4px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); cursor: pointer; border: 2px solid #fff;
  transition: var(--transition);
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.cash-liberated-box {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(5,150,105,0.1));
  border: 1px solid rgba(16,185,129,0.3); border-radius: var(--radius-md);
  padding: 1.25rem; text-align: center; display: flex; flex-direction: column; gap: 0.3rem;
}
.cash-liberated-box span { font-size: 0.75rem; color: #a7f3d0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.cash-liberated-box h4 { font-size: 1.9rem; font-weight: 900; color: #34d399; letter-spacing: -0.03em; }
.formula-tag { font-size: 0.75rem; color: var(--text-dim); background: rgba(0,0,0,0.3); padding: 0.25rem 0.6rem; border-radius: 4px; display: inline-block; }

/* ===== STYLED TABLE ===== */
.styled-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.styled-table th {
  background: rgba(255,255,255,0.03); color: var(--text-muted);
  font-weight: 600; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; text-align: left;
}
.styled-table td { padding: 0.8rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.styled-table tr:last-child td { border-bottom: none; }
.styled-table tr:hover td { background: rgba(255,255,255,0.02); }

.region-badge { font-weight: 700; font-size: 0.77rem; padding: 0.18rem 0.55rem; border-radius: 4px; display: inline-block; }
.lead-1 { background: rgba(16,185,129,0.15); color: #34d399; }
.lead-2 { background: rgba(14,165,233,0.15); color: #38bdf8; }
.lead-3 { background: rgba(245,158,11,0.15); color: #fbbf24; }
.lead-4 { background: rgba(249,115,22,0.15); color: #fb923c; }
.lead-5 { background: rgba(225,29,72,0.15); color: #f43f5e; font-weight: 800; border: 1px solid rgba(225,29,72,0.3); }

/* ===== HEATMAP ===== */
.heatmap-container { display: flex; flex-direction: column; gap: 4px; }
.heatmap-label-row, .heatmap-row { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 4px; }
.heatmap-size-label { font-size: 0.75rem; color: var(--text-muted); text-align: center; font-weight: 600; padding: 4px; }
.heatmap-region-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; display: flex; align-items: center; padding: 4px; }
.heatmap-cell {
  padding: 8px 4px; text-align: center; border-radius: 5px;
  background: rgba(14, 165, 233, var(--opacity, 0.1));
  color: #fff; font-size: 0.78rem; font-weight: 700;
  transition: filter 0.2s; cursor: default;
}
.heatmap-cell:hover { filter: brightness(1.4); }

/* ===== MODULE HEADER ===== */
.module-header {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem 1.75rem; background: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
}
.module-icon { font-size: 2.5rem; }
.module-name { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.module-desc { font-size: 0.85rem; color: var(--text-muted); }

/* ===== PROFILE GRID ===== */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.profile-item {
  background: rgba(255,255,255,0.02); padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.profile-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 600; margin-bottom: 0.3rem; }
.profile-value { font-size: 0.88rem; color: var(--text-main); font-weight: 500; }

/* ===== ROI VIEW ===== */
.roi-hero-card {
  display: grid; grid-template-columns: auto 1fr; gap: 2rem;
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(14,165,233,0.05));
  border: 1px solid rgba(16,185,129,0.25); border-radius: var(--radius-lg); padding: 2rem;
}
.roi-number { text-align: center; min-width: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
.roi-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #34d399; font-weight: 700; }
.roi-value { font-size: 5rem; font-weight: 900; color: #34d399; letter-spacing: -0.05em; line-height: 1; }
.roi-sublabel { font-size: 0.8rem; color: var(--text-muted); text-align: center; max-width: 180px; }

.roi-breakdown { display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; }
.roi-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.roi-row-label { font-size: 0.88rem; color: var(--text-muted); }
.roi-row-value { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.roi-row-value.green { color: #34d399; }
.roi-row-value.red { color: #f43f5e; }
.roi-divider { height: 1px; background: var(--border-color); }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 40px 1fr; gap: 1rem; position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child) .timeline-dot::after {
  content: ''; position: absolute; left: 19px; top: 35px;
  width: 2px; height: calc(100% - 20px); background: var(--border-color);
}
.timeline-dot {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; margin-top: 4px;
}
.timeline-dot.cyan { border-color: var(--cyan); background: rgba(14,165,233,0.15); }
.timeline-dot.green { border-color: var(--green); background: rgba(16,185,129,0.15); }
.timeline-dot.amber { border-color: var(--amber); background: rgba(245,158,11,0.15); }
.timeline-dot.red { border-color: var(--red); background: rgba(225,29,72,0.15); }
.timeline-content { display: flex; flex-direction: column; gap: 0.3rem; }
.timeline-period { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 600; }
.timeline-title { font-size: 0.98rem; font-weight: 700; color: #fff; }
.timeline-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; }
.timeline-result { font-size: 0.82rem; color: #34d399; font-weight: 600; padding-top: 0.25rem; }

/* ===== FOOTER ===== */
.footer-bar {
  text-align: center; padding: 2rem 0;
  color: var(--text-dim); font-size: 0.78rem;
  border-top: 1px solid var(--border-color);
}

/* =====================================================
   MÓDULO 1: DIAGNÓSTICO ESTRATÉGICO — DESIGN SYSTEM
   ===================================================== */

/* --- HERO BANNER --- */
.diag-hero-banner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  background: #0f1523;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.diag-hero-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.diag-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.diag-badge-trebola {
  background: #1e3a8a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
}
.diag-badge-audit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
}
.pulse-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.diag-headline {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: #fff;
}
.gradient-red {
  color: #f43f5e;
  display: inline-block;
  font-weight: 800;
}

.diag-summary {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 620px;
}
.diag-summary strong {
  color: #f1f5f9;
}

.diag-quick-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.diag-btn-primary, .diag-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.diag-btn-primary {
  background: #2563eb;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.diag-btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.diag-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.diag-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-arrow {
  transition: transform 0.2s ease;
}
.diag-btn-primary:hover .btn-arrow,
.diag-btn-secondary:hover .btn-arrow {
  transform: translateX(3px);
}

/* --- HERO STATS CARDS --- */
.diag-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}
.diag-stat-card {
  background: #111827;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
}
.diag-stat-card:hover {
  transform: translateY(-1px);
  background: #162032;
  border-color: rgba(255, 255, 255, 0.12);
}
.diag-stat-card.stat-red {
  border-top: 2px solid #e11d48;
}
.diag-stat-card.stat-amber {
  border-top: 2px solid #f59e0b;
}
.diag-stat-card.stat-cyan {
  border-top: 2px solid #38bdf8;
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.stat-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.red-dot { background: #e11d48; }
.amber-dot { background: #f59e0b; }
.cyan-dot { background: #38bdf8; }

.stat-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.stat-main-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}
.stat-red .stat-main-val { color: #f43f5e; }
.stat-amber .stat-main-val { color: #fbbf24; }
.stat-cyan .stat-main-val { color: #38bdf8; }

.stat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
}
.stat-foot {
  font-size: 0.74rem;
  color: #8b949e;
  line-height: 1.4;
}

/* --- CLIENT EXECUTIVE STRIP --- */
.client-executive-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.4rem;
  gap: 1rem;
  overflow-x: auto;
}
.strip-node {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}
.node-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.node-val {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
}
.strip-node.highlight-cyan .node-val {
  color: #38bdf8;
  font-weight: 700;
}
.strip-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* --- DIAG INSIGHTS SECTION --- */
.diag-insights-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.diag-analysis-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 1.5rem;
  align-items: start;
}

/* --- DIAG CARDS STACK --- */
.diag-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.diag-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition);
  position: relative;
}
.diag-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.15);
  background: #162032;
}
.card-border-red { border-top: 2px solid #e11d48; }
.card-border-amber { border-top: 2px solid #f59e0b; }
.card-border-cyan { border-top: 2px solid #38bdf8; }

/* --- EXECUTIVE MINI-KPI GRID (CERO MUROS DE TEXTO) --- */
.diag-mini-kpi-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.diag-kpi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  line-height: 1.3;
}
.diag-kpi-k {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.diag-kpi-v {
  color: #cbd5e1;
  text-align: right;
  font-weight: 500;
}
.diag-kpi-item.highlight-sol .diag-kpi-k {
  color: #38bdf8;
}
.diag-kpi-item.highlight-sol .diag-kpi-v {
  color: #34d399;
  font-weight: 600;
}

/* --- FORENSIC PIPELINE BAR (REEMPLAZA 4 TARJETAS VERBOSAS) --- */
.forensic-pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  gap: 0.75rem;
  overflow-x: auto;
}
.pipe-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.pipe-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pipe-content {
  display: flex;
  flex-direction: column;
}
.pipe-content strong {
  font-size: 0.78rem;
  color: #f1f5f9;
  font-weight: 700;
}
.pipe-content span {
  font-size: 0.68rem;
  color: #8b949e;
}
.pipe-sep {
  color: #334155;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.diag-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.diag-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.diag-step-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  flex-shrink: 0;
}

.diag-card-title-group h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.diag-badge-danger {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.08);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.2);
  margin-top: 0.2rem;
}
.diag-badge-warning {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-top: 0.2rem;
}
.diag-badge-info {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.2);
  margin-top: 0.2rem;
}

.diag-card-amount {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.red-text { color: #f43f5e; }
.amber-text { color: #f59e0b; }
.cyan-text { color: #38bdf8; }

.diag-card-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #94a3b8;
}
.diag-card-desc strong {
  color: #f1f5f9;
}

/* --- PROGRESS BLOCKS --- */
.diag-progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: #cbd5e1;
}
.progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.red-fill { background: #e11d48; }
.amber-fill { background: #d97706; }
.cyan-fill { background: #0284c7; }

.progress-sub {
  font-size: 0.7rem;
  color: #64748b;
}

/* --- SOLUTION BOX --- */
.diag-sol-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 2px solid #2563eb;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}
.sol-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #60a5fa;
}
.sol-text {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* --- VISUAL COLUMN & CHART --- */
.diag-visual-column {
  position: sticky;
  top: 5rem;
}
.diag-visual-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.25);
}
.diag-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 0.9rem;
}
.diag-chart-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.diag-chart-header span {
  font-size: 0.78rem;
  color: #8b949e;
}
.diag-chart-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.diag-chart-wrapper {
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diag-breakdown-legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  gap: 0.75rem;
}
.legend-dot-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
}
.legend-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-val-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.legend-val-group strong {
  color: #fff;
  font-size: 0.82rem;
}
.legend-pct {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 700;
}

.diag-callout-note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.note-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}
.note-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
}
.note-text strong {
  color: #34d399;
}

/* --- HUMAN IMPACT SECTION --- */
/* --- HUMAN IMPACT SECTION: ESTRUCTURA EJECUTIVA & PROPORCIONES ÁUREAS --- */
.human-impact-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.hi-header-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(13, 17, 23, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  gap: 1.5rem;
}

.hi-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.7rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 9999px;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.hi-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
}

.hi-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.hi-header-stats {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.hi-stat-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
}

.hi-stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hi-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

/* CARDS GRID */
.human-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.human-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.human-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
}

.hc-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hc-role-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-vendedor {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.icon-planeador {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.icon-finanzas {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.hc-role-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.hc-location-tag {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  margin-top: 0.15rem;
}

/* MATRIZ DE DIVISION ANTES / DESPUES */
.hc-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 1rem;
  flex-grow: 1;
}

.hc-pane {
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hc-pane-before {
  background: rgba(244, 63, 94, 0.035);
  border: 1px solid rgba(244, 63, 94, 0.15);
}

.hc-pane-after {
  background: rgba(16, 185, 129, 0.035);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.hc-pane-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.hc-status-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-red {
  color: #fb7185;
}

.tag-green {
  color: #34d399;
}

.hc-kpi-num {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.hc-kpi-desc {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.2;
}

.hc-spec-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.hc-spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.hc-k {
  font-size: 0.6rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.hc-v {
  color: #cbd5e1;
  font-size: 0.72rem;
}

.hc-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

.btn-verify-ticket {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-verify-ticket:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.btn-verify-content {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-hash {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
}

@media (max-width: 1024px) {
  .human-cards-grid {
    grid-template-columns: 1fr;
  }
  .hi-header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .hi-header-stats {
    width: 100%;
    justify-content: space-between;
  }
}

/* --- IMPLEMENTATION & BOTTOM ACTION CARD --- */
.diag-implementation-card {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(13, 17, 23, 0.95), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.impl-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.impl-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
}
.impl-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}
.impl-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
}
.impl-desc strong {
  color: #f1f5f9;
}

.impl-steps {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.impl-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
}
.step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-info {
  display: flex;
  flex-direction: column;
}
.step-info strong {
  font-size: 0.8rem;
  color: #fff;
}
.step-info span {
  font-size: 0.7rem;
  color: #8b949e;
}
.impl-arrow {
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: 900;
}

.impl-right {
  display: flex;
  align-items: center;
}
.impl-action-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.action-box-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.action-box-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 0.25rem;
}
.action-btn-primary, .action-btn-secondary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.action-btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.action-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.action-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.action-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ===== FORENSIC AUDIT SECTION (EVIDENCIA $563M) ===== */
/* ===== FORENSIC AUDIT SECTION (EVIDENCIA $563M) ===== */
.forensic-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.85rem;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}
.forensic-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.forensic-audit-section {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin: 3rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}
.forensic-audit-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: #2563eb;
}

.forensic-header {
  margin-bottom: 2rem;
}
.forensic-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.forensic-badge-step {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.forensic-badge-tobit {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.forensic-badge-audit {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.forensic-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.forensic-subtitle {
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 950px;
}
.forensic-subtitle em {
  color: #f1f5f9;
  font-style: italic;
}

/* 4 Pasos Metodológicos */
.forensic-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.f-step-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}
.f-step-card:hover {
  background: #162032;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}
.f-step-num {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #334155;
  font-family: 'JetBrains Mono', monospace;
}
.f-step-icon {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.f-step-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.45rem;
}
.f-step-card p {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 0.85rem;
  flex-grow: 1;
}
.f-step-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
}

/* Reconstructor Lab Layout */
.forensic-lab-container {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.lab-main-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.lab-card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}
.lab-store-info {
  margin-bottom: 1rem;
}
.lab-store-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0.35rem 0;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.lab-sku-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}
.lab-sku-meta strong {
  color: #e2e8f0;
}

.lab-mode-switch {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lab-switch-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
}
.lab-step-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.lab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}
.lab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.lab-btn.active {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}
.lab-btn.highlight-gemela.active {
  background: #1e293b;
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

/* Métricas del Momento */
.lab-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.lab-metric-tile {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
}
.lab-metric-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.2rem;
}
.lab-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.lab-metric-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* Detalle Evidencia Box */
.lab-evidence-detail {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.evidence-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}
.evidence-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.evidence-badge-green { background: rgba(16, 185, 129, 0.08); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.2); }
.evidence-badge-red { background: rgba(244, 63, 94, 0.08); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.2); }
.evidence-badge-cyan { background: rgba(59, 130, 246, 0.08); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.2); }

.evidence-summary-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ev-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
}
.ev-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  width: 75px;
}
.ev-txt {
  color: #cbd5e1;
}

/* Columna Derecha: Muestra Testigo */
.lab-audit-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audit-side-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}
.audit-side-header h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}
.audit-side-header span {
  font-size: 0.74rem;
  color: #64748b;
}

.store-selector-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin: 0.85rem 0;
}
.store-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.store-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.store-pill.active {
  background: #1e293b;
  border-color: #3b82f6;
  color: #fff;
}

.store-audit-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  margin-bottom: 0.85rem;
}
.audit-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.audit-kpi-col {
  display: flex;
  flex-direction: column;
}
.audit-kpi-col .lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.audit-kpi-col .val {
  font-size: 1.1rem;
  font-weight: 800;
}

/* SQL Proof Box */
.sql-proof-toggle {
  margin-top: 0.5rem;
}
.sql-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.sql-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.sql-proof-body {
  margin-top: 0.5rem;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #cbd5e1;
  overflow-x: auto;
  line-height: 1.45;
}

/* Calculadora de Prudencia */
.prudencia-calc-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid #10b981;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.p-calc-header {
  margin-bottom: 0.75rem;
}
.p-calc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.p-calc-header h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}
.p-slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.p-slider-val {
  font-weight: 700;
  color: #34d399;
}
.prudencia-calc-card input[type="range"] {
  width: 100%;
  accent-color: #10b981;
  cursor: pointer;
  margin-bottom: 1rem;
}
.p-calc-results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.p-res-item {
  display: flex;
  flex-direction: column;
}
.p-res-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.p-res-item strong {
  font-size: 1rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.p-res-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.07);
}
.p-calc-footer {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.75rem;
  line-height: 1.4;
}
.p-calc-footer strong {
  color: #94a3b8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .forensic-steps-grid { grid-template-columns: repeat(2, 1fr); }
  .forensic-lab-container { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .forensic-steps-grid { grid-template-columns: 1fr; }
  .lab-metrics-bar { grid-template-columns: repeat(2, 1fr); }
  .lab-step-buttons { grid-template-columns: 1fr; }
  .store-selector-pills { grid-template-columns: 1fr; }
  .p-calc-results { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .p-res-divider { display: none; }
}
@media (max-width: 1100px) {
  .diag-hero-banner { grid-template-columns: 1fr; }
  .diag-analysis-grid { grid-template-columns: 1fr; }
  .diag-visual-column { position: static; }
  .diag-implementation-card { grid-template-columns: 1fr; }
  .triple-grid, .dual-grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
  .roi-hero-card { grid-template-columns: 1fr; }
  .navbar { flex-direction: column; padding: 1rem; gap: 0.75rem; }
}
@media (max-width: 640px) {
  .triple-grid, .dual-grid, .kpi-grid { grid-template-columns: 1fr; }
  .hero-banner { grid-template-columns: 1fr; }
  .vs-grid { grid-template-columns: 1fr; }
  .vs-divider { display: none; }
  .diag-headline { font-size: 1.8rem; }
  .client-executive-strip { flex-direction: column; align-items: flex-start; }
  .strip-divider { display: none; }
}

/* ===== TICKET FORENSIC AUDIT MODAL (100% VERACIDAD) ===== */
.ticket-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  animation: modalFadeIn 0.25s forwards;
}

@keyframes modalFadeIn {
  to { opacity: 1; }
}

.ticket-modal-content {
  background: #0b0f17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(14, 165, 233, 0.15);
  transform: translateY(15px);
  animation: modalSlideUp 0.25s forwards;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideUp {
  to { transform: translateY(0); }
}

.tm-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.tm-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tm-seal-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-header-left h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.tm-header-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  display: block;
}

.tm-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tm-close:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

/* Tabs inside modal */
.tm-nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.tm-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.tm-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.tm-tab-btn.active {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.4);
}

.tm-tab-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1f5f9;
}

.tm-tab-doc {
  font-size: 0.65rem;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

.tm-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

/* Forensic Document Styles */
.forensic-slip {
  background: #06090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
}

.fs-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 0.85rem;
}

.fs-brand {
  font-weight: 800;
  font-size: 0.85rem;
  color: #f8fafc;
  letter-spacing: 0.04em;
}

.fs-doc-badge {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.fs-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.fs-meta-item strong {
  color: #e2e8f0;
}

.fs-breakdown-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.fs-discrepancy {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid #fb7185;
  border-radius: 0 4px 4px 0;
  font-size: 0.72rem;
  color: #fca5a5;
}

.fs-lineage {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 6px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #38bdf8;
}

.fs-lineage-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #7dd3fc;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.fs-lineage-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted rgba(14, 165, 233, 0.15);
  padding-bottom: 0.2rem;
}

.fs-lineage-k {
  color: #94a3b8;
}

.fs-lineage-v {
  color: #e2e8f0;
  word-break: break-all;
}

.fs-resolution {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.75rem;
  color: #a7f3d0;
  line-height: 1.45;
}

.fs-resolution strong {
  color: #34d399;
}

/* Modal Footer */
.tm-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tm-footer-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tm-verify-chip {
  font-size: 0.65rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.tm-source-chip {
  font-size: 0.65rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.btn-tm-done {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tm-done:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* =====================================================
   DATABRICKS LAKEHOUSE ARCHITECTURE & EVIDENCE VIEWER
   ===================================================== */

/* Navbar Button */
.arch-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.arch-nav-btn:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.35));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.arch-pulse-icon {
  display: inline-block;
  color: #f59e0b;
  animation: pulseRotate 2s infinite ease-in-out;
}

@keyframes pulseRotate {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
}

/* Quick Banner in viewDiagnostico */
.arch-quick-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(11, 15, 25, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.6rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.arch-banner-left {
  flex: 1;
}

.arch-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.arch-tech-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 1.5s infinite;
}

.arch-banner-left h4 {
  margin: 0 0 0.35rem 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #f8fafc;
}

.arch-banner-left p {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
}

.arch-banner-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.arch-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.arch-action-btn.primary {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.arch-action-btn.primary:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.arch-action-btn.secondary {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #a5b4fc;
}

.arch-action-btn.secondary:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  transform: translateY(-1px);
}

.arch-action-btn.code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.arch-action-btn.code:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

/* Modal Overlay & Container */
.arch-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s forwards;
}

.arch-modal-content {
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.25s forwards;
}

.arch-modal-header {
  padding: 1.15rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
}

.arch-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.arch-logo-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #38bdf8;
}

.arch-header-left h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.arch-header-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  display: block;
}

.arch-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.arch-env-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.arch-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.arch-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* Modal Subnav Tabs */
.arch-nav-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}

.arch-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arch-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.02);
}

.arch-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(14, 165, 233, 0.05);
}

.arch-tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.arch-tab-btn.active .arch-tab-num {
  opacity: 1;
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

/* Modal Body */
.arch-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.arch-pane-intro p {
  margin: 0 0 1.25rem 0;
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Medallion Pipeline Grid */
.medallion-pipeline-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0.65rem;
}

.med-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.15rem;
  font-weight: 800;
}

.medallion-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.medallion-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.medallion-card.bronze-layer {
  border-top: 3px solid #d97706;
}

.medallion-card.silver-layer {
  border-top: 3px solid #94a3b8;
}

.medallion-card.gold-layer {
  border-top: 3px solid #eab308;
}

.medallion-card.consume-layer {
  border-top: 3px solid #38bdf8;
}

.med-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.med-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
  font-family: 'JetBrains Mono', monospace;
}

.med-badge.bronze { background: rgba(217, 119, 6, 0.15); color: #f59e0b; }
.med-badge.silver { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.med-badge.gold { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.med-badge.cyan { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }

.med-tech {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.medallion-card h5 {
  margin: 0 0 0.45rem 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.med-desc {
  margin: 0 0 0.85rem 0;
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.4;
  flex: 1;
}

.med-specs {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.med-spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
}

.spec-k { color: #64748b; }
.spec-v { color: #e2e8f0; font-weight: 600; font-family: 'JetBrains Mono', monospace; }

.med-table-tag {
  font-size: 0.62rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.med-table-tag code {
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

/* Lineage & Governance View */
.lineage-flow-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.lineage-flow-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #f1f5f9;
  margin-bottom: 1.2rem;
}

.lineage-nodes-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.l-node {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
}

.l-node.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 165, 233, 0.08);
}

.l-node-badge {
  font-size: 0.58rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.25rem;
}

.l-node-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.2rem;
}

.l-node-meta {
  font-size: 0.64rem;
  color: #94a3b8;
  line-height: 1.3;
}

.l-connector {
  color: #64748b;
  font-weight: 800;
}

/* RBAC Interactive Section */
.rbac-interactive-section h5 {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.rbac-interactive-section p {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.rbac-role-selector {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.rbac-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rbac-btn:hover {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.rbac-btn.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.rbac-card-display {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.rbac-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.rbac-meta-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.65rem;
}

.rbac-meta-label {
  font-size: 0.62rem;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.rbac-meta-val {
  font-size: 0.78rem;
  color: #e2e8f0;
  font-weight: 600;
}

.rbac-security-rule {
  font-size: 0.74rem;
  color: #94a3b8;
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid #34d399;
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

/* Code Viewer Tab */
.code-notebook-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.nb-sel-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.nb-sel-btn span {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.nb-sel-btn small {
  font-size: 0.64rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.nb-sel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.nb-sel-btn.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: #38bdf8;
}

.nb-sel-btn.active span {
  color: #38bdf8;
}

.nb-sel-btn.active small {
  color: #7dd3fc;
}

.code-display-container {
  background: #05070d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-lang-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(14, 165, 233, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.cd-file-name {
  font-size: 0.72rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.code-pre-box {
  margin: 0;
  padding: 1.15rem;
  max-height: 380px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Modal Footer */
.arch-modal-footer {
  padding: 1rem 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
}

.arch-footer-meta {
  display: flex;
  gap: 0.85rem;
}

.af-chip {
  font-size: 0.65rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.btn-arch-done {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-arch-done:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .arch-quick-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .medallion-pipeline-grid {
    grid-template-columns: 1fr;
  }
  .med-arrow {
    transform: rotate(90deg);
    padding: 0.3rem 0;
  }
  .lineage-nodes-track {
    flex-direction: column;
  }
  .l-connector {
    transform: rotate(90deg);
  }
  .rbac-meta-grid {
    grid-template-columns: 1fr;
  }
}

