/* =====================================================================
   GesPro Onboarding · Sistema de Diseño Ejecutivo (Claro / Oscuro / PDF)
   Coherente con GesPro Pulse (sitio-implementacion) · Cero dependencias
   ===================================================================== */

:root {
  --navy: #091628;
  --navy-2: #112a4b;
  --brand: #1a5da8;
  --brand-hover: #144a88;
  --sky: #3892e8;
  --sky-soft: #e8f3fe;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef3fa;
  --line: #dde6f2;
  --line-strong: #c5d4e8;

  --ink: #111d2e;
  --ink-2: #3d5068;
  --muted: #64768f;

  --ok: #0f766e;
  --ok-bright: #10b981;
  --ok-bg: #e6f7f3;
  --ok-line: #a7e3d5;

  --warn: #b45309;
  --warn-bright: #f59e0b;
  --warn-bg: #fef4e2;
  --warn-line: #f5d293;

  --danger: #be123c;
  --danger-bright: #f43f5e;
  --danger-bg: #ffe7ed;
  --danger-line: #fbb8c7;

  --info: #1d4ed8;
  --info-bg: #e9f1ff;
  --info-line: #bcd4ff;

  --neutral-bg: #eef2f7;
  --neutral-ink: #475569;

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(9, 22, 40, .05), 0 2px 8px rgba(9, 22, 40, .04);
  --shadow-md: 0 8px 24px rgba(9, 22, 40, .08);
  --shadow-lg: 0 20px 54px rgba(9, 22, 40, .24);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0b121e;
  --surface: #121c2c;
  --surface-2: #172336;
  --surface-3: #1d2c43;
  --line: #23344d;
  --line-strong: #324969;

  --ink: #eef4fc;
  --ink-2: #c0d0e4;
  --muted: #8499b5;

  --brand: #58a6ff;
  --brand-hover: #79b8ff;
  --sky-soft: rgba(56, 146, 232, .16);

  --ok: #34d399;
  --ok-bright: #34d399;
  --ok-bg: rgba(16, 185, 129, .14);
  --ok-line: rgba(52, 211, 153, .32);

  --warn: #fbbf24;
  --warn-bright: #fbbf24;
  --warn-bg: rgba(245, 158, 11, .14);
  --warn-line: rgba(251, 191, 36, .32);

  --danger: #fb7185;
  --danger-bright: #fb7185;
  --danger-bg: rgba(244, 63, 94, .14);
  --danger-line: rgba(251, 113, 133, .34);

  --info: #79b8ff;
  --info-bg: rgba(56, 146, 232, .14);
  --info-line: rgba(88, 166, 255, .34);

  --neutral-bg: #1e2d44;
  --neutral-ink: #b2c3d8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .38);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ================= TOPBAR ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(135deg, #071222 0%, #0e2747 55%, #164478 100%);
  color: #fff;
  border-bottom: 1px solid rgba(137, 201, 255, .18);
  box-shadow: 0 4px 22px rgba(5, 14, 28, .25);
}
.topbar-in {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1b69c4, #3892e8);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.6px;
  position: relative;
  box-shadow: 0 4px 14px rgba(56, 146, 232, .38);
}
.pulse-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0b1f3a;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .65);
  animation: pulseDot 2.4s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .65); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.brand-txt strong { display: block; font-size: 16px; line-height: 1.15; letter-spacing: -.01em; }
.brand-txt strong em { font-style: normal; color: #7cc4ff; font-weight: 700; }
.brand-txt span { display: block; font-size: 11.5px; color: #a8c8ea; }

.company-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(137, 201, 255, .28);
  border-radius: 10px;
  padding: 5px 10px 5px 11px;
}
.company-picker select {
  background: transparent;
  border: none;
  color: #fff;
  font: 600 13px/1.2 var(--font);
  outline: none;
  cursor: pointer;
  max-width: 240px;
}
.company-picker select option { background: #0d203a; color: #fff; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font: 600 12.5px/1 var(--font);
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}
.mode-btn.active { background: #fff; color: #0b2240; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }

.icon-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: 600 12.5px/1 var(--font);
  padding: 8px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .19); border-color: rgba(255, 255, 255, .4); }
.icon-btn.accent { background: rgba(16, 185, 129, .2); border-color: rgba(52, 211, 153, .55); }
.icon-btn.accent.warn { background: rgba(245, 158, 11, .22); border-color: rgba(251, 191, 36, .55); }
.icon-btn.only-ico { padding: 8px 9px; }

/* ================= SUBNAV (TABS POR MÓDULO) ================= */
.subnav {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(9, 22, 40, .04);
}
.subnav-in {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font: 600 12.5px/1.2 var(--font);
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s;
}
.tab:hover { background: var(--surface-3); color: var(--ink); }
.tab.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 93, 168, .28);
}
.tab .cnt {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.tab.active .cnt { background: rgba(255, 255, 255, .24); color: #fff; }
.tab .cnt.ok { background: var(--ok-bg); color: var(--ok); }
.tab.active .cnt.ok { background: rgba(16, 185, 129, .35); color: #fff; }
.tab .cnt.alert { background: var(--danger-bg); color: var(--danger); }
.tab.active .cnt.alert { background: #f43f5e; color: #fff; }

/* ================= MAIN SHELL ================= */
.main-shell {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 20px 44px;
  flex: 1;
}

/* ================= RIBBONS & BANNERS ================= */
.ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.ribbon.consultor { background: var(--info-bg); border: 1px solid var(--info-line); color: var(--ink); }
.ribbon.drive-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--ink); }
.ribbon.drive-ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ink); }

/* ================= HERO CARD ================= */
.exec-hero {
  background: linear-gradient(135deg, #09182e 0%, #113058 55%, #1a5496 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #a9ccf2;
  margin-bottom: 6px;
}
.code-tag {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
}
.exec-hero h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; }
.exec-hero p { margin: 0; font-size: 13.5px; color: #d6e7fa; max-width: 760px; }
.hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12.5px;
  color: #cde1f8;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  padding: 14px 20px;
  min-width: 175px;
}
.gauge-ring { position: relative; width: 106px; height: 106px; }
.gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-val { font-size: 24px; font-weight: 800; line-height: 1; color: #fff; }
.gauge-sub { font-size: 10.5px; color: #b9d7f7; margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }
.gauge-caption { font-size: 12px; color: #e2efff; font-weight: 600; margin-top: 8px; text-align: center; }

/* ================= KPI GRID ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-val { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 5px 0 4px; color: var(--ink); }
.kpi-sub { font-size: 12.5px; color: var(--ink-2); }
.kpi-card.ok .kpi-val { color: var(--ok); }
.kpi-card.warn .kpi-val { color: var(--warn); }
.kpi-card.danger .kpi-val { color: var(--danger); }
.kpi-card.info .kpi-val { color: var(--brand); }

/* ================= CARDS & SECTIONS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-head h2, .card-head h3 { margin: 0 0 3px; font-size: 16.5px; line-height: 1.25; }
.card-head p { margin: 0; font-size: 13px; color: var(--muted); }

/* ================= PROGRESS BAR ================= */
.prog-bar {
  height: 9px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.prog-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--sky));
  border-radius: 99px;
  transition: width .35s ease;
}
.prog-bar.ok > div { background: linear-gradient(90deg, var(--ok), var(--ok-bright)); }
.prog-bar.danger > div { background: linear-gradient(90deg, var(--danger), var(--danger-bright)); }

/* ================= MODULE PROGRESS GRID ================= */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 13px;
}
.mod-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mod-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-sm); }
.mod-card.done { border-color: var(--ok-line); }
.mod-card.obs { border-color: var(--danger-line); }
.mod-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-card-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.mod-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ================= PILLS & BUTTONS ================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.pill.info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-line); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.pill.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.pill.neutral, .pill.muted { background: var(--neutral-bg); color: var(--neutral-ink); border: 1px solid var(--line); }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1.2 var(--font);
  padding: 8px 13px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost-white { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .32); color: #fff; }
.btn.ghost-white:hover { background: rgba(255, 255, 255, .24); }
.btn.sm { padding: 6px 10px; font-size: 12.2px; border-radius: 8px; }
.btn.xs { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: 600 12px/1 var(--font);
  padding: 6px 11px;
  border-radius: 99px;
  cursor: pointer;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ================= IMPACT CALLOUT ================= */
.impact-box {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.impact-box h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 6px;
}
.impact-box ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 4px 18px;
  font-size: 12.8px;
  color: var(--ink);
}

/* ================= TEMPLATE CARDS ================= */
.tpl-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.tpl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tpl-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.tpl-desc { font-size: 12.8px; color: var(--ink-2); margin: 0 0 6px; }
.tpl-meta { font-size: 11.8px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-actions { display: flex; gap: 7px; flex-wrap: wrap; flex-shrink: 0; }

.dict-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dict-table th {
  text-align: left;
  background: var(--navy-2);
  color: #fff;
  padding: 8px 10px;
  font-weight: 600;
  white-space: nowrap;
}
.dict-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.dict-table tr:nth-child(even) td { background: var(--surface-2); }

/* ================= FORMS ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  font: 500 13.2px/1.4 var(--font);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--sky-soft);
}
.field textarea { min-height: 70px; resize: vertical; }
.field .hint { font-size: 11.5px; color: var(--muted); }

/* ================= DELIVERABLES & UPLOAD ZONE ================= */
.deliv-list { display: flex; flex-direction: column; gap: 12px; }
.deliv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 15px 17px;
  transition: border-color .15s;
}
.deliv-card.status-aprobado { border-left-color: var(--ok-bright); }
.deliv-card.status-entregado { border-left-color: var(--sky); }
.deliv-card.status-en_revision { border-left-color: var(--warn-bright); }
.deliv-card.status-observado { border-left-color: var(--danger-bright); background: color-mix(in srgb, var(--danger-bg) 35%, var(--surface)); }

.deliv-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.deliv-title {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.deliv-desc { font-size: 12.6px; color: var(--ink-2); margin: 0; }

.dropzone {
  margin-top: 11px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--brand); background: var(--sky-soft); }
.dropzone-txt { font-size: 12.6px; color: var(--ink-2); }
.dropzone-txt strong { color: var(--ink); }

.file-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.val-box {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.4px;
}
.val-box.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ink); }
.val-box.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--ink); }
.val-box.error { background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--ink); }
.val-box ul { margin: 5px 0 0; padding-left: 18px; }

.obs-box {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 12.6px;
}

.review-bar {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.review-bar-lbl { font-size: 11.8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ================= CHECKLIST TABLE ================= */
.chk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chk-table th {
  text-align: left;
  padding: 9px 11px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
.chk-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.chk-table tr:hover td { background: var(--surface-2); }

/* ================= FOOTER ================= */
.app-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-in {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.link-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--brand);
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  padding: 2px 4px;
}
.link-btn:hover { text-decoration: underline; }
.sep { margin: 0 6px; opacity: .45; }

/* ================= MODAL & TOAST ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(7, 16, 31, .64);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-head h3 { margin: 0 0 2px; font-size: 17px; }
.modal-head p { margin: 0; font-size: 12.8px; color: var(--muted); }
.modal-close {
  appearance: none; border: none; background: var(--surface-3); color: var(--ink);
  width: 30px; height: 30px; border-radius: 8px; font-size: 19px; cursor: pointer;
}
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  background: #0c1f3a;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: all .22s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

.code-block {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  white-space: pre-wrap;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.8px;
  cursor: pointer;
}

/* ================= PORTADA FORMAL DE ACCESO CLIENTE ================= */
.access-gate {
  max-width: 520px;
  margin: 34px auto 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.access-gate-head {
  background: linear-gradient(135deg, #081529 0%, #102c52 58%, #1a5496 100%);
  color: #fff;
  padding: 26px 26px 22px;
}
.access-gate-head h1 {
  margin: 8px 0 6px;
  font-size: 21px;
  line-height: 1.25;
}
.access-gate-head p {
  margin: 0;
  font-size: 13.2px;
  color: #cfe3fa;
}
.access-gate-body {
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pin-input {
  font-family: var(--mono) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: 5px;
  text-align: center;
}
.access-gate-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.share-option-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-option-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.share-url-formal {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  word-break: break-all;
}

/* ================= RELOJ DE CUENTA REGRESIVA ================= */
.countdown-banner {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.countdown-banner.cd-normal { border-left: 5px solid var(--brand); }
.countdown-banner.cd-warn { border-left: 5px solid var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.countdown-banner.cd-late { border-left: 5px solid var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.countdown-banner.cd-ok { border-left: 5px solid var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.cd-title { font-size: 14.5px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-sub { font-size: 12.6px; color: var(--ink-2); margin-top: 4px; }
.cd-clause { font-size: 12px; color: var(--danger); font-weight: 600; margin-top: 5px; }
.cd-grid { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-box {
  min-width: 66px;
  text-align: center;
  padding: 9px 10px 7px;
  border-radius: 11px;
  background: #0b1f3a;
  color: #fff;
  box-shadow: 0 3px 10px rgba(11, 31, 58, .18);
}
.countdown-banner.cd-warn .cd-box { background: #92400e; }
.countdown-banner.cd-late .cd-box { background: #991b1b; }
.countdown-banner.cd-ok .cd-box { background: #0f766e; }
.cd-val { display: block; font-family: var(--mono); font-size: 22px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cd-lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .82; margin-top: 3px; }
.countdown-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 14px;
  font-size: 12.8px;
}
.countdown-mini.cd-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.countdown-mini.cd-late { background: var(--danger-bg); border-color: var(--danger-line); }
.countdown-mini.cd-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.cd-mini-clock { font-family: var(--mono); font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ================= ACUERDO DE COMPROMISO (VISTA LEGAL) ================= */
.modal-card.wide { max-width: 880px; }
.acuerdo-sheet {
  background: #ffffff;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 28px 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13.6px;
  line-height: 1.56;
  max-height: 60vh;
  overflow-y: auto;
}
.acuerdo-sheet .doc-header { text-align: center; border-bottom: 2px solid #0f294a; padding-bottom: 12px; margin-bottom: 14px; }
.acuerdo-sheet .doc-badge { font-family: var(--font); font-size: 11px; font-weight: 700; text-transform: uppercase; color: #1d4ed8; letter-spacing: .06em; }
.acuerdo-sheet h1 { font-size: 16px; margin: 6px 0; color: #0b1f3a; line-height: 1.3; }
.acuerdo-sheet .doc-ref { font-family: var(--font); font-size: 11.5px; color: #475569; }
.acuerdo-sheet h2 { font-size: 14px; color: #0b1f3a; margin: 16px 0 6px; }
.acuerdo-sheet p, .acuerdo-sheet li { text-align: justify; }
.acuerdo-sheet .alcance-box { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-family: var(--font); font-size: 12.2px; }
.acuerdo-sheet .alcance-title { font-weight: 800; color: #0b1f3a; text-transform: uppercase; font-size: 11px; margin-bottom: 6px; }
.acuerdo-sheet .meta-tbl { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.acuerdo-sheet .meta-tbl td { padding: 3px 6px 3px 0; width: 50%; vertical-align: top; }
.acuerdo-sheet .mods-list { columns: 2; margin: 4px 0 0 18px; padding: 0; }
.acuerdo-sheet .mods-list li { text-align: left; font-size: 12px; margin-bottom: 2px; }
.acuerdo-sheet .aceptacion-box { margin: 12px 0; padding: 10px 12px; border: 1px solid #16a34a; background: #f0fdf4; color: #14532d; font-family: var(--font); font-size: 12.2px; border-radius: 6px; }
.acuerdo-sheet .firmas-tbl { width: 100%; border-collapse: collapse; margin-top: 26px; }
.acuerdo-sheet .firmas-tbl td { width: 50%; vertical-align: top; padding-right: 20px; font-size: 12.5px; }
.acuerdo-sheet .firma-rol { font-weight: 700; color: #0b1f3a; }
.acuerdo-sheet .firma-sub { font-size: 11.5px; color: #475569; min-height: 16px; }
.acuerdo-sheet .firma-linea { border-bottom: 1px solid #0f172a; margin: 38px 20px 6px 0; }

/* ================= GP MENSAJES EN PORTAL ================= */
.gpm-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.qr-card img { width: 170px; height: 170px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.gpm-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.gpm-item.unread { border-left: 4px solid var(--brand); }
.gpm-item-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.gp-rep-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.gp-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.gp-kpi-l { font-size: 10.5px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.gp-kpi-v { font-size: 18px; font-weight: 800; color: var(--ink); }
.gp-kpi-s { font-size: 11.2px; color: var(--muted); }
.gp-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.gp-tbl th, .gp-tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.gp-cta { margin-top: 10px; }
.gp-cta a { display: inline-block; background: var(--brand); color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 12.2px; font-weight: 700; }

/* ================= RESPONSIVE ================= */
@media (max-width: 960px) {
  .exec-hero, .countdown-banner, .gpm-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .gp-rep-kpis { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .btn-lbl { display: none; }
}

/* ================= IMPRESIÓN ACTA PDF ================= */
@media print {
  .topbar-actions, .subnav, .ribbon, .dropzone, .review-bar, .app-footer, .hero-actions, .tpl-actions, .chips { display: none !important; }
  body { background: #fff; color: #000; }
  .topbar { position: static; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .exec-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .deliv-card { break-inside: avoid; box-shadow: none; }
}
