/* ===========================================================================
   Bitacora de Ascenso · hoja del tablero
   Calco del artefacto de referencia del cliente (bitacora-ascenso.html, H2 2026,
   Key Results Q3/Q4 por ranuras): mismas variables, mismas clases, mismas
   medidas. Depende de /css/tokens.css solo por las tipografias (@font-face) y
   por los tokens que usan los dialogos compartidos de ui.mjs. Las paginas de
   acceso y administracion siguen con app.css: esta hoja es solo para index.html.
   =========================================================================== */

:root {
  --bg: #f3f7fc;
  --surface: #ffffff;
  --surface-2: #e9f0f9;
  --ink: #08182f;
  --ink-soft: #3a5876;
  --ink-faint: #7c93ac;
  --border: #dbe5f1;
  --accent: #007aff;
  --accent-strong: #154177;
  --accent-wash: #e4efff;
  --summit: #154177;
  --summit-wash: #e6eef8;
  --verde: #1f8a5f;
  --verde-wash: #e5f4ee;
  --amarillo: #b9862a;
  --amarillo-wash: #fbf1de;
  --rojo: #c1473f;
  --rojo-wash: #fbeae9;
  --shadow: 0 1px 2px rgba(8, 24, 47, 0.06), 0 8px 24px -12px rgba(8, 24, 47, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #020c18;
    --surface: #08182f;
    --surface-2: #0d244080;
    --ink: #eaf1fa;
    --ink-soft: #b7c6d9;
    --ink-faint: #6f88a3;
    --border: #1c3352;
    --accent: #3c8cfb;
    --accent-strong: #78b0ff;
    --accent-wash: #0f2c4d;
    --summit: #78b0ff;
    --summit-wash: #0f2c4d;
    --verde: #5fc98b;
    --verde-wash: #122a1f;
    --amarillo: #e0b158;
    --amarillo-wash: #2c2313;
    --rojo: #e88680;
    --rojo-wash: #301917;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  --bg: #020c18;
  --surface: #08182f;
  --surface-2: #0d244080;
  --ink: #eaf1fa;
  --ink-soft: #b7c6d9;
  --ink-faint: #6f88a3;
  --border: #1c3352;
  --accent: #3c8cfb;
  --accent-strong: #78b0ff;
  --accent-wash: #0f2c4d;
  --summit: #78b0ff;
  --summit-wash: #0f2c4d;
  --verde: #5fc98b;
  --verde-wash: #122a1f;
  --amarillo: #e0b158;
  --amarillo-wash: #2c2313;
  --rojo: #e88680;
  --rojo-wash: #301917;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Public Sans",
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}
h1,
h2,
h3,
.display {
  font-family: "Fraunces", Georgia, serif;
  text-wrap: balance;
}
.mono,
input[type="text"].mono,
.cifra {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--accent-strong);
}
button {
  font-family: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* El atributo hidden manda siempre, incluso sobre display de flex. */
[hidden] {
  display: none !important;
}
img,
svg {
  max-width: 100%;
}
svg {
  display: block;
}

/* Iconos de trazo de ui.mjs (dialogos compartidos). */
.icono {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icono--sm {
  width: 16px;
  height: 16px;
}

/* Salto al contenido y texto solo para lectores de pantalla. */
.salto {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 60;
  transform: translateY(-200%);
  padding: 6px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.salto:focus {
  transform: translateY(0);
}
.solo-lectores {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.solo-impresion {
  display: none;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-right: auto;
}
.brand .mark {
  color: var(--accent);
  font-size: 1.05rem;
}
/* La marca de Jaime se pinta con mascara para tomar el color del acento. */
.brand .mark--jaime {
  display: block;
  align-self: center;
  height: 1.05rem;
  width: calc(1.05rem * 1.8164);
  background-color: currentColor;
  -webkit-mask: url("/brand/jaime-mark.svg") center / contain no-repeat;
  mask: url("/brand/jaime-mark.svg") center / contain no-repeat;
}
.brand h1 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.2px;
}
.brand .sub {
  color: var(--ink-faint);
  font-size: 0.78rem;
}

.iconbtn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  line-height: 1.5;
}
.iconbtn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.iconbtn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.iconbtn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.iconbtn.ghost {
  border-style: dashed;
  color: var(--accent-strong);
}
.iconbtn.small {
  padding: 4px 9px;
  font-size: 0.72rem;
}
.iconbtn.danger {
  color: var(--rojo);
}
.iconbtn.danger:hover {
  border-color: var(--rojo);
  color: var(--rojo);
}
.iconbtn:disabled,
.iconbtn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.iconbtn:disabled:hover {
  border-color: var(--border);
  color: var(--ink);
}

/* Mandos propios de la aplicacion: sesion, tema, administracion y salida. */
.topbar__acciones {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.topbar .chip {
  font-size: 0.78rem;
  color: var(--ink-faint);
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.save-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}
.save-state[data-estado="guardando"]::before {
  background: var(--amarillo);
}
.save-state[data-estado="guardado"]::before {
  background: var(--verde);
}
.save-state[data-estado="error"]::before,
.save-state[data-estado="offline"]::before {
  background: var(--rojo);
}
.save-state[data-estado="error"],
.save-state[data-estado="offline"] {
  color: var(--rojo);
}

.banner-offline {
  position: sticky;
  top: 57px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--amarillo-wash);
  color: var(--amarillo);
  border-bottom: 1px solid var(--amarillo);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
}

.rail {
  position: sticky;
  top: 57px;
  align-self: start;
  height: calc(100vh - 57px);
  overflow-y: auto;
  padding: 22px 10px 40px 20px;
}
.rail-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  margin: 0 0 12px 6px;
}
.waypoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.waypoint::before {
  content: "";
  position: absolute;
  left: 15px;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}
.waypoint:first-child::before {
  top: 50%;
}
.waypoint:last-child::before {
  bottom: 50%;
}
.wp-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
  background: var(--surface);
  flex: none;
  z-index: 1;
  position: relative;
}
.wp-dot.full {
  background: var(--accent);
  border-color: var(--accent);
}
.wp-dot.partial {
  background: var(--amarillo);
  border-color: var(--amarillo);
}
.waypoint .wp-text {
  font-size: 0.82rem;
}
.waypoint .wp-num {
  color: var(--ink-faint);
  font-weight: 600;
  margin-right: 2px;
}
.waypoint:hover {
  background: var(--surface-2);
}
.waypoint[aria-current="true"] {
  background: var(--surface-2);
}
.wp-progress {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-left: auto;
}

main {
  padding: 26px 26px 90px;
  min-width: 0;
}
main:focus {
  outline: none;
}

.hero {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent) 65%);
  color: #f4fbfa;
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.hero h2 {
  margin: 0 0 0.35em;
  font-size: 1.55rem;
  font-weight: 500;
}
.hero p {
  margin: 0;
  max-width: 62ch;
  opacity: 0.92;
  font-size: 0.92rem;
}
.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.hero-stat b {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
}
.hero-stat span {
  font-size: 0.72rem;
  opacity: 0.85;
}

.ruta {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 70px;
}
.ruta-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}
.ruta-head:focus-visible {
  outline-offset: -2px;
}
.ruta-head .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent-strong);
  background: var(--accent-wash);
  border-radius: 20px;
  padding: 3px 10px;
  flex: none;
  margin-top: 3px;
}
.ruta-head .txt {
  flex: 1;
}
.ruta-head h3 {
  margin: 0 0 3px;
  font-size: 1.12rem;
  font-weight: 500;
}
.ruta-head .tag {
  font-size: 0.74rem;
  color: var(--ink-faint);
}
.ruta-head .chev {
  flex: none;
  color: var(--ink-faint);
  transition: transform 0.15s ease;
  margin-top: 6px;
}
.ruta.open .chev {
  transform: rotate(90deg);
}
.ruta-progress {
  flex: none;
  text-align: right;
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 4px;
}
.ruta-progress b {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.ruta-body {
  display: none;
  border-top: 1px solid var(--border);
}
.ruta.open .ruta-body {
  display: block;
}
.meta2030 {
  padding: 14px 20px;
  background: var(--surface-2);
  font-style: italic;
  font-family: "Fraunces", serif;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
}

.campamento {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.campamento:last-child {
  border-bottom: none;
}
.camp-top {
  margin-bottom: 12px;
}
.camp-area {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-strong);
  font-weight: 600;
}
.camp-objetivo {
  margin: 2px 0 0;
  font-size: 0.94rem;
  max-width: 66ch;
}
.camp-alerta {
  font-size: 0.75rem;
  background: var(--rojo-wash);
  color: var(--rojo);
  border-radius: 7px;
  padding: 5px 9px;
  margin-top: 6px;
  display: inline-block;
}
.camp-nota {
  font-size: 0.75rem;
  background: var(--surface-2);
  color: var(--ink-soft);
  border-radius: 7px;
  padding: 5px 9px;
  margin-top: 6px;
  display: inline-block;
}
.aviso-vacio {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.entry-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg);
}
.entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.entry-head .entry-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
}
.entry-head .entry-remove {
  margin-left: auto;
}
.addentry-btn {
  margin-top: 12px;
  width: 100%;
}
.entry-firma {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin: 10px 0 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 760px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field.span2 {
  grid-column: span 2;
}
.field label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.field input,
.field select,
.field textarea {
  font-family: "Public Sans", sans-serif;
  font-size: 0.86rem;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.field textarea {
  min-height: 44px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.field.cifra input {
  font-family: "IBM Plex Mono", monospace;
}
.field input[readonly],
.field textarea[readonly] {
  background: var(--surface-2);
  cursor: default;
}

.semaforo-select {
  display: flex;
  gap: 6px;
}
.semaforo-select .sem-opt {
  flex: 1;
  text-transform: none;
  letter-spacing: normal;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--ink-faint);
  background: var(--surface);
  position: relative;
}
/* El radio real cubre la opcion entera, invisible, y recibe teclado y foco. */
.sem-opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.sem-opt.bloqueado input {
  cursor: default;
}
.sem-opt:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sem-opt.active[data-v="verde"],
.sem-opt[data-v="verde"]:has(input:checked) {
  background: var(--verde-wash);
  border-color: var(--verde);
  color: var(--verde);
}
.sem-opt.active[data-v="amarillo"],
.sem-opt[data-v="amarillo"]:has(input:checked) {
  background: var(--amarillo-wash);
  border-color: var(--amarillo);
  color: var(--amarillo);
}
.sem-opt.active[data-v="rojo"],
.sem-opt[data-v="rojo"]:has(input:checked) {
  background: var(--rojo-wash);
  border-color: var(--rojo);
  color: var(--rojo);
}
.sem-opt.bloqueado {
  cursor: default;
}

.kr-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--accent-wash);
  border: 1px solid var(--border);
}
.kr-box-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  font-weight: 700;
  margin-bottom: 10px;
}
.kr-row {
  margin-bottom: 10px;
}
.kr-row:last-child {
  margin-bottom: 0;
}
.ejemplo-note {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 4px;
  font-style: italic;
}

/* ---------- attachments ---------- */
.attach-block {
  margin-top: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
}
.attach-block .ab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.attach-block .ab-head span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.attach-list:empty {
  display: none;
}
.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-strong);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}
.file-input-label:hover,
.file-input-label.activa {
  border-color: var(--accent);
}
.attach-hint {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 6px;
}
.attach-warning {
  font-size: 0.72rem;
  color: var(--rojo);
  margin-top: 6px;
}
.attach-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.attach-chip .ac-icon {
  font-size: 1.1rem;
}
.attach-chip .ac-name {
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip .ac-size {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ---------- footer helper ---------- */
.helpstrip {
  max-width: 1180px;
  margin: 0 auto 40px;
  padding: 0 26px 0 26px;
}
.helpcard {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.83rem;
  color: var(--ink-soft);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.helpcard b {
  color: var(--ink);
}

/* Pie: lockup conjunto y una linea de creditos discreta. */
.pie {
  max-width: 1180px;
  margin: 0 auto 40px;
  padding: 0 26px;
}
.pie__interior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.lockup {
  --lockup-h: 1rem;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
}
.lockup__jaime {
  display: block;
  height: var(--lockup-h);
  width: calc(var(--lockup-h) * 1.8164);
  background-color: currentColor;
  -webkit-mask: url("/brand/jaime-mark.svg") center / contain no-repeat;
  mask: url("/brand/jaime-mark.svg") center / contain no-repeat;
}
.lockup__linea {
  display: block;
  flex: none;
  width: 1px;
  height: calc(var(--lockup-h) * 1.6);
  margin-inline: var(--lockup-h);
  background: var(--border);
}
.lockup__axenor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lockup__a {
  height: calc(var(--lockup-h) * 1.55);
  width: auto;
}
.lockup__texto {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.pie__legal {
  margin: 0;
}

/* ---------- dialogos compartidos de ui.mjs (confirmar, conflicto) ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.5;
  text-decoration: none;
}
.boton:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.boton--primario {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.boton--primario:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.boton--fantasma {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.boton--fantasma:hover {
  border-color: var(--border);
  color: var(--ink);
}
.boton--peligro {
  color: var(--rojo);
  border-color: var(--rojo);
}
.boton--peligro:hover {
  background: var(--rojo-wash);
  border-color: var(--rojo);
  color: var(--rojo);
}
.boton--icono {
  padding: 6px;
}
.boton:disabled,
.boton[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.dialogo {
  width: min(52rem, 92vw);
  max-height: min(86vh, 52rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.dialogo::backdrop {
  background: rgba(8, 16, 22, 0.72);
  backdrop-filter: blur(2px);
}
.dialogo__caja {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.dialogo__cabecera {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.dialogo__cabecera h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
}
.dialogo__cerrar {
  margin-left: auto;
  flex: none;
}
.dialogo__cuerpo {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dialogo__cuerpo p {
  margin: 0;
  font-size: 0.9rem;
}
.dialogo__pie {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.dialogo__form {
  display: grid;
  gap: 16px;
}
.campo--ancho {
  grid-column: 1 / -1;
}
.campo__ayuda {
  font-size: 0.8rem;
  color: var(--ink-faint);
}
@media (max-width: 900px) {
  .dialogo__cuerpo {
    grid-template-columns: minmax(0, 1fr);
  }
  .dialogo {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }
}

.aviso {
  display: block;
  padding: 8px 12px;
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.aviso--error {
  border-left-color: var(--rojo);
  background: var(--rojo-wash);
  color: var(--rojo);
  font-weight: 600;
}
.aviso--ok {
  border-left-color: var(--verde);
  background: var(--verde-wash);
  color: var(--verde);
}

/* Toast: aviso momentaneo abajo a la derecha, sin tapar el foco. */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  max-width: min(28rem, 90vw);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  animation: toast-entra 0.24s ease-out;
  margin: 0;
}
.toast--error {
  border-left-color: var(--rojo);
  color: var(--rojo);
}
.toast--ok {
  border-left-color: var(--verde);
  color: var(--verde);
}
@keyframes toast-entra {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- print ---------- */
@media print {
  @page {
    size: A4 portrait;
    margin: 16mm 14mm 18mm;
  }
  .topbar,
  .rail,
  .hero-stats,
  .ruta-head .chev,
  .helpstrip,
  .addentry-btn,
  .entry-remove,
  .file-input-label,
  .attach-hint,
  .attach-warning,
  .banner-offline,
  .toast,
  .dialogo,
  .salto {
    display: none !important;
  }
  .shell {
    display: block;
  }
  body {
    background: #fff;
  }
  .ruta {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 14px;
  }
  .ruta-body {
    display: block !important;
  }
  .hero {
    background: none;
    color: var(--ink);
    border: 1px solid var(--border);
  }
}
