/* ════════════════════════════════════════════════════════════════
   Notaría 67 · Gestión — sistema visual

   La mesa de trabajo de la notaría. Es la misma familia que el sitio
   público (notaria67/css/app.css): Geist, íconos Tabler, azul notarial,
   verde y crema, menú lateral y barra inferior en el celular. Cambia la
   densidad: aquí se trabaja todo el día, así que hay más dato por
   pantalla y menos aire.

   Lo propio de esta plataforma es la RUTA (.hilo): las 7 etapas que ve
   el ciudadano, en el mismo orden y con las mismas palabras, para que la
   notaría y el cliente hablen el mismo idioma.

   El crema (papel notarial) se reserva para lo que va a la escritura:
   borradores, minutas y la ficha del radicado. No es un adorno.
   ════════════════════════════════════════════════════════════════ */

:root {
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 236px;
  --top-h: 60px;
  --tab-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Radios por jerarquía: más grande cuanto más contiene. */
  --r-xs: 7px;     /* etiquetas, casillas */
  --r-sm: 10px;    /* botones, campos, ítems del menú */
  --r-md: 14px;    /* tarjetas */
  --r-lg: 20px;    /* bloques de portada */
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f2ee;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --line: #e3e5df;
  --line-2: #eef0eb;
  --text: #13222e;
  --text-2: #5b6871;
  --text-3: #8a949a;
  --primary: #2a475e;
  --primary-hover: #1f3a4f;
  --on-primary: #ffffff;
  --primary-soft: #e6edf2;
  --accent: #2f7a3e;
  --accent-soft: #e5f1de;
  --verde: #7abc59;
  --danger: #b4321f;
  --danger-soft: #fbe9e5;
  --warn: #8a5a00;
  --warn-soft: #fff3dc;
  --papel: #f3ede2;          /* crema: lo que va a la escritura */
  --papel-line: #e2d6c1;
  --papel-text: #6b5530;
  --nav-bg: #13222e;
  --nav-text: #8ba0ae;
  --nav-on: #ffffff;
  --nav-on-bg: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 2px rgba(19, 34, 46, 0.04), 0 8px 24px -14px rgba(19, 34, 46, 0.14);
  --shadow-lg: 0 24px 60px -24px rgba(19, 34, 46, 0.35);
  --focus: 0 0 0 3px rgba(42, 71, 94, 0.25);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1a23;
  --surface: #152532;
  --surface-2: #1a2d3b;
  --line: #213847;
  --line-2: #1b3040;
  --text: #e9eef1;
  --text-2: #9fb2bd;
  --text-3: #6d8392;
  --primary: #7abc59;
  --primary-hover: #8fcc6f;
  --on-primary: #0e1a23;
  --primary-soft: #1d3428;
  --accent: #7abc59;
  --accent-soft: rgba(122, 188, 89, 0.14);
  --verde: #7abc59;
  --danger: #ff8a75;
  --danger-soft: rgba(255, 138, 117, 0.12);
  --warn: #f2c46b;
  --warn-soft: rgba(242, 196, 107, 0.12);
  --papel: #2a2a22;
  --papel-line: #47402f;
  --papel-text: #e3d3b3;
  --nav-bg: #0b151d;
  --nav-text: #6d8392;
  --nav-on: #7abc59;
  --nav-on-bg: rgba(122, 188, 89, 0.12);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --focus: 0 0 0 3px rgba(122, 188, 89, 0.32);
}

/* Nombres viejos que todavía usan estilos en línea de algunas pantallas. */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --tinta: var(--text);
  --tinta-2: var(--text-2);
  --tinta-3: var(--text-3);
  --superficie: var(--surface);
  --borde: var(--line);
  --acento: var(--primary);
  --acento-claro: var(--primary-soft);
  --acento-fuerte: var(--primary-hover);
  --ok: var(--accent);
  --ok-fondo: var(--accent-soft);
  --alerta: var(--warn);
  --alerta-fondo: var(--warn-soft);
  --error: var(--danger);
  --error-fondo: var(--danger-soft);
  --radio: var(--r-md);
  --sombra: var(--shadow);
}

/* ═══ Base ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
.ti { font-size: 1.15em; line-height: 1; vertical-align: -0.12em; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ═══ Armazón ════════════════════════════════════════════════════
   ≥ 1024 px: menú lateral fijo + barra superior.
   < 1024 px: barra superior compacta + barra inferior de 5 accesos,
   y el menú completo se abre como cajón.                              */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 12px 14px;
  background: var(--nav-bg); color: var(--nav-text);
  scrollbar-width: thin;
}
.rail .marca {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 18px; color: #fff; text-decoration: none;
}
.marca-n {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--verde); color: #13222e;
  font-weight: 700; font-size: 15px; letter-spacing: -0.4px;
}
.marca-t { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: 14.5px; }
.marca-t small { font-weight: 400; font-size: 12px; color: var(--nav-text); }

.rail-grupo { margin: 14px 10px 6px; font-size: 12px; font-weight: 500; color: var(--nav-text); opacity: 0.75; }
.rail-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--nav-text); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.rail-item .ti { font-size: 19px; flex: none; }
.rail-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.rail-item.on { color: var(--nav-on); background: var(--nav-on-bg); }
.rail-item .contador {
  margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--verde); color: #13222e; font-size: 11.5px; font-weight: 700;
}
.rail-pie { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; gap: 2px; }
.rail-yo { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; color: #fff; font-size: 13.5px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 12px; font-weight: 600;
}
.rail-yo small { display: block; color: var(--nav-text); font-size: 12px; }
button.rail-item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.topbar .hoy { color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.topbar .hoy::first-letter { text-transform: uppercase; }
.topbar .marca-mini { display: none; }
.ir {
  margin-left: auto; position: relative; width: min(360px, 100%);
}
.ir .ti { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 17px; pointer-events: none; }
.ir input[type=search] {
  width: 100%; height: 38px; padding: 0 12px 0 38px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
}
.ir input::placeholder { color: var(--text-3); }
.icono-btn {
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 18px; text-decoration: none;
}
.icono-btn:hover { color: var(--text); text-decoration: none; }
.campana { position: relative; }
.campana.on { color: var(--text); border-color: var(--text-3); }
.campana .contador {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center;
  background: var(--verde); color: #13222e; font-size: 10.5px; font-weight: 700;
}

.lienzo { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 32px) 64px; }

.tabbar, .velo { display: none; }

@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%;
    transform: translateX(-102%); transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.cajon .rail { transform: none; }
  .velo { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(9, 18, 25, 0.45);
          opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  body.cajon .velo { opacity: 1; pointer-events: auto; }
  .topbar { height: 56px; gap: 10px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar .hoy { display: none; }
  .topbar .marca-mini { display: flex; flex: none; align-items: center; gap: 9px; color: var(--text); font-weight: 600; text-decoration: none; }
  .topbar .marca-mini .marca-n { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
  .ir { width: auto; flex: 1; max-width: 260px; }
  .lienzo { padding-bottom: calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); padding-top: 18px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--nav-bg);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--nav-text); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none;
    background: none; border: 0; cursor: pointer;
  }
  .tabbar .ti { font-size: 22px; }
  .tabbar .on { color: var(--nav-on); }
  .tabbar .principal .ti {
    width: 44px; height: 44px; margin-top: -18px; border-radius: 14px;
    display: grid; place-items: center; background: var(--verde); color: #13222e; font-size: 24px;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45);
  }
  .tabbar .contador {
    position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 99px; background: var(--verde); color: #13222e; font-size: 10px; font-weight: 700;
    display: grid; place-items: center;
  }
}
@media (max-width: 520px) {
  .topbar .marca-mini span { display: none; }
}

/* ═══ Encabezado de página ═══════════════════════════════════════ */
.titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 4px; }
.titulo h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.4px; }
.subtitulo { color: var(--text-2); font-size: 14px; margin: 0 0 22px; max-width: 75ch; }

/* Pestañas de una sección (Incluir / Actualizar / Anular…) */
.pestanas {
  display: inline-flex; gap: 2px; margin: 0 0 18px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.pestanas a {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 6px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--text-2);
}
.pestanas a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.pestanas a.on { background: var(--primary); color: var(--on-primary); }

/* ═══ Tarjeta ════════════════════════════════════════════════════ */
.tarjeta {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow);
  overflow: hidden;
}
.tarjeta + .tarjeta { margin-top: 16px; }
.tarjeta-cab {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px;
}
.tarjeta-cab h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.1px; }
.tarjeta-cab p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.tarjeta-cuerpo { padding: 18px; }
.tarjeta.papel { background: var(--papel); border-color: var(--papel-line); }
.tarjeta.papel .tarjeta-cab { border-bottom-color: var(--papel-line); }

.columnas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .columnas { grid-template-columns: minmax(0, 1fr); } }

/* ═══ Formularios ════════════════════════════════════════════════ */
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 6px; }
input[type=text], input[type=number], input[type=search], input[type=password], input[type=email],
input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-3); }
.campo { margin-bottom: 14px; }
.campos-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 560px) { .campos-2 { grid-template-columns: minmax(0, 1fr); } }
.ayuda { font-size: 12.5px; color: var(--text-3); margin: 4px 0 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ═══ Botones ════════════════════════════════════════════════════ */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 16px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  background: var(--primary); color: var(--on-primary);
  border: 1px solid var(--primary); border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.boton:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
.boton:active { transform: translateY(1px); }
.boton.suave { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 500; }
.boton.suave:hover { background: var(--surface-2); border-color: var(--text-3); }
.boton.peligro { background: var(--surface); color: var(--danger); border-color: var(--line); font-weight: 500; }
.boton.peligro:hover { background: var(--danger-soft); border-color: var(--danger); }
.boton.listo { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.boton.chico { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.boton.ancho { width: 100%; }
.boton:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ Tablas ═════════════════════════════════════════════════════ */
.tabla-scroll { overflow-x: auto; }
table.datos { width: 100%; border-collapse: collapse; font-size: 14px; }
table.datos th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3);
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
table.datos td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.datos tbody tr:last-child td { border-bottom: 0; }
table.datos tbody tr { transition: background 0.12s; }
table.datos tbody tr[onclick] { cursor: pointer; }
table.datos tbody tr[onclick]:hover { background: var(--surface-2); }
table.datos tbody tr.elegido { background: var(--primary-soft); }
table.datos tbody tr.elegido td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.num { text-align: right; white-space: nowrap; }

/* Una tabla ancha en el celular se lee como lista de fichas. */
@media (max-width: 720px) {
  table.datos.fichas thead { display: none; }
  table.datos.fichas, table.datos.fichas tbody, table.datos.fichas tr, table.datos.fichas td { display: block; width: 100%; }
  table.datos.fichas tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  table.datos.fichas td { padding: 2px 0; border: 0; text-align: left; }
}

/* ═══ Etiquetas ══════════════════════════════════════════════════ */
.etiq {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.etiq.con { background: var(--accent-soft); color: var(--accent); }
.etiq.sin { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.etiq.exento { background: var(--warn-soft); color: var(--warn); }
.etiq.pend { background: var(--danger-soft); color: var(--danger); }
.etiq.papel { background: var(--papel); color: var(--papel-text); box-shadow: inset 0 0 0 1px var(--papel-line); }

/* ═══ Avisos ═════════════════════════════════════════════════════ */
/* El ícono va aparte (absoluto) para que el texto del aviso, que mezcla
   negritas y enlaces, siga fluyendo como un párrafo. */
.aviso {
  position: relative;
  padding: 12px 14px 12px 42px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid;
}
.aviso::before { font-family: "tabler-icons"; font-size: 18px; line-height: 1; position: absolute; left: 14px; top: 13px; }
.aviso.ok   { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); }
.aviso.ok::before { content: "\ea67"; color: var(--accent); }
.aviso.info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--text); }
.aviso.info::before { content: "\eac5"; color: var(--primary); }
.aviso.mal  { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--text); }
.aviso.mal::before { content: "\ea05"; color: var(--danger); }
.aviso.cuidado { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--text); }
.aviso.cuidado::before { content: "\ea06"; color: var(--warn); }

/* ═══ Listas de casillas ═════════════════════════════════════════ */
.lista-check { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; }
.lista-check label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 9px; border-radius: 8px;
  font-weight: 400; font-size: 14px; color: var(--text); cursor: pointer; }
.lista-check label:hover { background: var(--surface-2); }
.lista-check input { margin: 0; flex: none; }

/* ═══ Buscador ═══════════════════════════════════════════════════ */
.buscador { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.buscador input[type=search] { flex: 1; min-width: 200px; }
.buscador select { width: auto; min-width: 160px; }
.conteo { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* ═══ Vacío ══════════════════════════════════════════════════════ */
.vacio { padding: 44px 24px; text-align: center; color: var(--text-3); font-size: 14px; }
.vacio .ti { display: block; margin: 0 auto 10px; font-size: 30px; color: var(--line); }

/* ═══ La ruta (.hilo) ════════════════════════════════════════════
   Siete tramos, uno por etapa del ciudadano. Los hechos van llenos,
   el actual con su nombre, los que faltan vacíos.                   */
.hilo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; min-width: 120px; }
.hilo i { height: 6px; border-radius: 3px; background: var(--line); }
.hilo i.hecho { background: var(--verde); }
.hilo i.actual { background: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent); }
.hilo.anulado i { background: var(--danger-soft); }
.hilo-txt { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.hilo-txt strong { color: var(--text); font-weight: 500; }

/* Versión grande, con nombre de cada etapa (ficha del radicado) */
.ruta-caja { container-type: inline-size; }
.ruta { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ruta-nombre { display: none; margin: 10px 0 0; font-size: 13.5px; font-weight: 600; }
.ruta-nombre span { font-weight: 400; color: var(--text-3); }
.ruta-paso { position: relative; padding-top: 14px; font-size: 12.5px; color: var(--text-3); line-height: 1.3; }
.ruta-paso::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--line); }
.ruta-paso.hecho::before { background: var(--verde); }
.ruta-paso.actual::before { background: var(--primary); }
.ruta-paso.actual { color: var(--text); font-weight: 600; }
.ruta-paso .ti { display: block; font-size: 18px; margin-bottom: 4px; }
@container (max-width: 620px) {
  .ruta-paso span { display: none; }
  .ruta-nombre { display: block; }
}

/* ═══ Inicio ═════════════════════════════════════════════════════ */
.saludo { margin: 0 0 22px; }
.saludo p { margin: 0 0 2px; color: var(--text-2); font-size: 14px; }
.saludo h1 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -0.8px; line-height: 1.15; }

.atajos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
@media (max-width: 900px) { .atajos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.atajo {
  display: flex; flex-direction: column; gap: 14px; padding: 16px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s var(--ease);
}
.atajo:hover { text-decoration: none; border-color: var(--text-3); }
.atajo .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px;
  background: var(--primary-soft); color: var(--primary); }
.atajo strong { display: block; font-size: 15px; font-weight: 600; }
.atajo small { color: var(--text-2); font-size: 13px; }
.atajo .cifra { font-size: 26px; font-weight: 600; letter-spacing: -0.6px; line-height: 1; }
.atajo.principal { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.atajo.principal small { color: color-mix(in srgb, var(--on-primary) 72%, transparent); }
.atajo.principal .ti { background: rgba(255, 255, 255, 0.14); color: var(--on-primary); }
[data-theme="dark"] .atajo.principal .ti { background: rgba(14, 26, 35, 0.14); }
.atajo-fila { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { border-bottom: 1px solid var(--line-2); }
.lista > li:last-child { border-bottom: 0; }
.lista a.fila, .lista .fila {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px;
  padding: 13px 18px; color: var(--text); text-decoration: none;
}
.lista a.fila:hover { background: var(--surface-2); text-decoration: none; }
.fila-t { font-weight: 600; font-size: 14.5px; }
.fila-s { color: var(--text-2); font-size: 13px; }
.fila .hilo { grid-column: 1 / -1; }

/* ═══ Acceso ═════════════════════════════════════════════════════ */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); }
.acceso-lado {
  background: var(--nav-bg); color: #fff; padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.acceso-lado h2 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -1px; font-weight: 600; margin: 0 0 14px; max-width: 16ch; }
.acceso-lado p { color: var(--nav-text); margin: 0; max-width: 46ch; font-size: 15px; }
.acceso-lado .ruta { max-width: 520px; }
.acceso-lado .ruta-paso { color: var(--nav-text); }
.acceso-lado .ruta-paso::before { background: rgba(255, 255, 255, 0.1); }
.acceso-lado .ruta-paso.hecho::before { background: var(--verde); }
.acceso-lado .ruta-paso.actual { color: #fff; }
.acceso-lado .ruta-paso.actual::before { background: #fff; }
.acceso-lado .ruta-nombre { color: #fff; }
.acceso-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.acceso-form form { width: 100%; max-width: 360px; }
.acceso-form h1 { font-size: 24px; letter-spacing: -0.4px; margin: 0 0 4px; font-weight: 600; }
.acceso-form .sub { margin: 0 0 24px; color: var(--text-2); }
@media (max-width: 860px) {
  .acceso { grid-template-columns: minmax(0, 1fr); }
  .acceso-lado { padding-bottom: 28px; }
  .acceso-lado .ruta, .acceso-lado p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .rail, .topbar, .tabbar, .velo { display: none !important; }
  .app { display: block; }
  .tarjeta { box-shadow: none; }
}

/* Barra de proporción (cuánto trabajo hay en cada actividad) */
.barra-uso { display: block; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.barra-uso i { display: block; height: 100%; border-radius: 2px; background: var(--primary); }
.fila .etiq { margin-left: 4px; vertical-align: 1px; }
.columnas.angosta { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
@media (max-width: 1100px) { .columnas.angosta { grid-template-columns: minmax(0, 1fr); } }
.columnas.lateral { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); }
@media (max-width: 900px) { .columnas.lateral { grid-template-columns: minmax(0, 1fr); } }
.tarjeta-cab .pestanas { margin: 0; }

/* ═══ Pasos de un formulario largo (Incluir) ═════════════════════
   Es una secuencia de verdad, por eso lleva número.                 */
.pasos { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.paso {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; font-size: 14px;
}
.paso:hover { background: var(--surface-2); text-decoration: none; }
.paso.on { background: var(--primary-soft); }
.paso-n {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line);
}
.paso-n .ti { font-size: 15px; }
.paso.on .paso-n { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.paso.listo .paso-n { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.paso.falta .paso-n { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.paso.bloqueado { color: var(--text-3); cursor: not-allowed; }
.paso.bloqueado:hover { background: none; }
.paso-t { display: flex; flex-direction: column; line-height: 1.25; }
.paso-t small { font-size: 12px; color: var(--text-3); }
.paso.falta .paso-t small { color: var(--danger); }
.pasos-acciones { border-top: 1px solid var(--line-2); }
@media (max-width: 900px) {
  .pasos { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .paso { flex: none; padding: 8px 12px 8px 8px; }
}
.filtro-lista { margin-bottom: 6px; }
/* Montos dentro de tablas: que se lea la cifra completa. */
table.datos input[type=text] { min-width: 120px; }

/* ═══ Borrador de la escritura ═══════════════════════════════════
   Va sobre papel crema y en letra con serifa: es lo único de la
   plataforma que se parece al documento que se va a firmar.          */
.borrador {
  padding: clamp(18px, 4vw, 40px);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 15.5px; line-height: 1.75; color: var(--text);
  text-align: justify; hyphens: auto;
  max-height: 78vh; overflow-y: auto;
}
.borrador div { margin: 0 0 2px; }
.borrador table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.borrador td { padding: 2px 6px; vertical-align: top; }
.borrador .v-ok { background: color-mix(in srgb, var(--verde) 16%, transparent); border-radius: 3px; padding: 0 2px; }
.borrador .v-falta {
  background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 0 3px;
  font-family: var(--font); font-size: 13px; font-weight: 600; box-shadow: inset 0 -1px 0 var(--warn);
}
.borrador .alt-falta {
  display: block; margin: 6px 0; padding: 8px 12px; border: 1px dashed var(--papel-line); border-radius: 8px;
  font-family: var(--font); font-size: 13px; color: var(--papel-text);
}
.borrador .guion { display: inline-block; width: 4em; border-bottom: 1px dashed var(--papel-line); vertical-align: 0.25em; }
.falta-grupo { font-size: 14px; font-weight: 600; margin: 18px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.falta-grupo:first-of-type { margin-top: 0; }
.falta-lista { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.borrador .v-propuesta { background: var(--primary-soft); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--primary); }
.propuesta textarea { font-family: "Source Serif 4", Georgia, serif; font-size: 14.5px; }
button.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--danger); cursor: pointer; text-decoration: underline; }

/* ═══ Expediente del radicado ════════════════════════════════════ */
.exp .subtitulo { margin-bottom: 14px; }
.exp .pestanas { margin-bottom: 14px; }
.exp-ahora {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent, #7abc59);
  border-radius: var(--r-md);
}
.exp-ahora > i { font-size: 22px; color: var(--text-2); }
.exp-ahora > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.exp-ahora-t { font-weight: 600; }
.exp-ahora-s { color: var(--text-2); font-size: 13px; }
@media (max-width: 640px) {
  .exp-ahora { flex-wrap: wrap; }
  .exp-ahora .boton { width: 100%; justify-content: center; }
}

/* ═══ Avisos ═════════════════════════════════════════════════════ */
.lista a.aviso-fila { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; }
.aviso-fila > .ti { font-size: 20px; color: var(--text-2); margin-top: 1px; }
.aviso-fila.nuevo .fila-t::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 2px;
  border-radius: 50%; background: var(--verde);
}
.aviso-fila:not(.nuevo) .fila-t { font-weight: 500; color: var(--text-2); }
.aviso-fila time { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }

/* ═══ Liquidación ════════════════════════════════════════════════ */
.liq-actos { display: grid; }
.liq-acto { margin: 0; padding: 14px 18px 16px; border: 0; border-top: 1px solid var(--line-2); min-width: 0; }
.liq-acto:first-child { border-top: 0; }
.liq-acto legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: 14px; }
.liq-acto legend .etiq { margin-left: 4px; }
.liq-campos { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; }
.liq-campos .campo { margin: 0; }
.liq-ret { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding-bottom: 9px; }
.liq-ret input { width: auto; }
.liq-mas summary { cursor: pointer; padding: 12px 18px; color: var(--text-2); font-size: 13.5px; font-weight: 500; list-style: none; border-top: 1px solid var(--line-2); }
.liq-mas summary::-webkit-details-marker { display: none; }
.liq-mas summary .ti { margin-right: 6px; }
.liq-mas[open] summary { color: var(--text); }
.liq-lado { position: sticky; top: calc(var(--top-h) + 16px); align-self: start; }
.liq-total { font-size: 30px; font-weight: 650; letter-spacing: -0.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.liq-total small { display: block; font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--text-2); margin-top: 4px; }
.liq-partes { margin: 18px 0; display: grid; gap: 0; }
.liq-partes > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.liq-partes dt { font-weight: 600; font-size: 14px; }
.liq-partes dt span { display: block; font-weight: 400; font-size: 13px; }
.liq-partes dt small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.liq-partes dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.liq-botones { display: flex; gap: 8px; }
.liq-botones .boton { flex: 1; justify-content: center; }
@media (max-width: 1100px) { .liq-lado { position: static; order: -1; } }

/* ═══ Facturación ════════════════════════════════════════════════ */
.seccion-t { font-size: 17px; font-weight: 600; margin: 22px 0 12px; }
.fac-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 16px; }
.fac { margin: 0; min-width: 0; }
fieldset.fac { padding: 0; }
.fac.anulada { opacity: .65; }
.fac.anulada .fac-total { text-decoration: line-through; }
.fac-total { font-size: 26px; font-weight: 650; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.fac-grupos { margin: 0; }
.fac-grupos > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.fac-grupos dd { margin: 0; font-variant-numeric: tabular-nums; }
abbr[title="Columna de Signo"] { text-decoration: none; color: var(--text-3); font-size: 11.5px; margin-left: 3px; }
.fac-anular { margin-top: 12px; }
.fac-anular summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.fac-anular form { margin-top: 8px; }
.fac-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.fac-campos .campo { margin: 0; }
.fac-campos .campo.ancho { grid-column: 1 / -1; }
.fac-pie { position: sticky; bottom: 12px; z-index: 5; }
.fac-pie .tarjeta-cuerpo { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.fac-cuadre { display: grid; gap: 3px; }
.fac-cuadre span { font-weight: 600; }
.fac-cuadre span.ok { color: var(--accent); }
.fac-cuadre span.mal { color: var(--danger, #b42318); }
.fac-cuadre small { color: var(--text-2); font-size: 12.5px; }
.fac-emitir { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.fac-emitir .campo { margin: 0; }
@media (max-width: 1023px) { .fac-pie { bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); } }

/* ═══ Protocolo ══════════════════════════════════════════════════ */
.proto-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.proto-pasos li + li { border-left: 1px solid var(--line-2); }
.proto-pasos a { display: flex; gap: 12px; align-items: center; padding: 14px 18px; color: var(--text); text-decoration: none; height: 100%; }
.proto-pasos a:hover { background: var(--surface-2); }
.proto-pasos li.on a { box-shadow: inset 0 -3px 0 var(--primary); }
.proto-pasos strong { display: block; font-size: 14px; font-weight: 600; }
.proto-pasos small { display: block; color: var(--text-2); font-size: 12.5px; }
.proto-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 600; }
.proto-pasos li.hecho .proto-n { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .proto-pasos { grid-template-columns: minmax(0, 1fr); }
  .proto-pasos li + li { border-left: 0; border-top: 1px solid var(--line-2); }
}

/* ═══ Tablero ════════════════════════════════════════════════════ */
.tb-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 16px; align-items: stretch; }
.tb-cifra { padding: 16px 18px; display: grid; align-content: start; gap: 4px; color: var(--text); text-decoration: none; }
a.tb-cifra:hover { text-decoration: none; border-color: var(--text-3); }
.tb-cifra strong { font-size: 28px; font-weight: 650; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tb-cifra span { color: var(--text-2); font-size: 13px; }
.tb-cifra.alerta strong { color: var(--danger); }
.tb-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tb-fila { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 7px 0; }
.tb-rot { font-size: 13.5px; }
.tb-rot small { display: block; color: var(--text-3); font-size: 12px; }
.tb-pista { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.tb-barra { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.tb-val { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-columnas { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; padding: 8px 18px 16px; overflow-x: auto; }
.tb-col { display: grid; grid-template-rows: auto 140px auto auto; justify-items: center; gap: 4px; min-width: 34px; }
.tb-num { font-size: 12.5px; font-weight: 600; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.tb-col-pista { width: 100%; max-width: 30px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.tb-col-barra { display: block; width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; }
.tb-col:hover .tb-col-barra { opacity: .8; }
.tb-sem { font-size: 11.5px; color: var(--text-2); }
.tb-leg { min-height: 1.3em; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 1100px) { .tb-dos { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .tb-fila { grid-template-columns: minmax(0, 1fr) auto; } .tb-pista { grid-column: 1 / -1; grid-row: 2; } }
