@font-face { font-family: 'Bricolage'; src: url('fuentes/BricolageGrotesque-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('fuentes/BricolageGrotesque-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fuentes/Figtree-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fuentes/Figtree-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fuentes/Figtree-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fuentes/Figtree-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetMono'; src: url('fuentes/JetBrainsMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

:root {
  --verde: #1b5753;
  --verde-profundo: #123f3c;
  --verde-claro: #e6f0ee;
  --verde-texto: #cfe2df;
  --cobre: #b9782f;
  --cobre-claro: #e3b57c;
  --cobre-fondo: #fbf3e8;
  --cobre-texto: #7a4e1c;
  --tinta: #0f2e2c;
  --apagado: #5e716e;
  --borde: #e1e8e6;
  --crema: #f5f2ec;
  --lienzo: #ebe7de;
  --blanco: #fff;
  --error: #b3261e;
  --m-general: #1b5753;
  --m-kiosco: #f57c00;
  --m-pantalla: #1e88e5;
  --m-terminal: #43a047;
  --m-administracion: #b9782f;
  --g: clamp(16px, 4vw, 40px);
  --titulo: 'Bricolage', 'Segoe UI', sans-serif;
  --cuerpo: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetMono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font-family: var(--cuerpo);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--titulo); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
a { color: var(--verde); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cobre); outline-offset: 2px; border-radius: 4px; }

.franja { display: flex; gap: 6px; }
.franja i { display: block; height: 6px; flex: 1; border-radius: 3px; }
.franja i:nth-child(1) { background: #e53935; }
.franja i:nth-child(2) { background: #f57c00; }
.franja i:nth-child(3) { background: #fbc02d; }
.franja i:nth-child(4) { background: #43a047; }
.franja i:nth-child(5) { background: #1e88e5; }
.franja i:nth-child(6) { background: #5e35b1; }

.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.acceso-panel {
  background: var(--verde-profundo);
  color: var(--verde-texto);
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.acceso-panel::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 340px;
  height: 340px;
  border: 38px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  pointer-events: none;
}
.acceso-panel .franja { max-width: 260px; }
.acceso-panel h1 { color: #fff; font-size: clamp(34px, 4.6vw, 58px); font-weight: 800; max-width: 11ch; }
.acceso-panel h1 em { font-style: normal; color: var(--cobre-claro); }
.acceso-panel p.sub { font-size: 18px; max-width: 34ch; margin: 18px 0 0; }
.acceso-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 420px; position: relative; z-index: 1; }
.acceso-roles li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 15px;
}
.acceso-roles b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cobre-claro); }
.lema { font-family: var(--titulo); font-size: 15px; color: var(--verde-texto); opacity: 0.85; margin: 0; }

.acceso-form-caja { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 56px); background: var(--crema); }
.acceso-form { width: 100%; max-width: 380px; }
.acceso-form .logo { display: block; width: 240px; max-width: 80%; margin: 0 0 34px; }
.acceso-form h2 { font-size: 30px; margin-bottom: 6px; }
.acceso-form > p { color: var(--apagado); margin: 0 0 26px; }
.campo { display: block; margin-bottom: 16px; }
.campo > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.campo-entrada { position: relative; }
.campo input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid #cfd9d6;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  color: var(--tinta);
}
.campo input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(27, 87, 83, 0.18); }
.campo .ver {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--verde);
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
}
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--verde);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.15s;
}
.boton:hover { background: var(--verde-profundo); }
.boton[disabled] { opacity: 0.65; cursor: wait; }
.boton.completo { width: 100%; }
.boton.cobre { background: var(--cobre); }
.boton.cobre:hover { background: var(--cobre-texto); }
.error-caja {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--error);
  background: #fbeceb;
  color: #7e1b15;
  font-size: 15px;
}
.conexion { margin-top: 26px; font-size: 14px; color: var(--apagado); }
.conexion summary { cursor: pointer; font-weight: 600; color: var(--verde); }
.conexion .campo { margin: 12px 0 8px; }
.conexion small { display: block; margin-top: 6px; }
.estado-api { font-family: var(--mono); font-size: 12.5px; color: var(--apagado); word-break: break-all; }

.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--g);
  background: #fff;
  border-bottom: 1px solid var(--borde);
}
.cabecera .marca img { display: block; height: 46px; width: auto; }
.cabecera-der { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.usuario { text-align: right; line-height: 1.25; }
.usuario b { display: block; font-size: 15px; }
.usuario span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--cobre-texto); }
.enlace-boton {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #cfd9d6;
  border-radius: 6px;
  background: #fff;
  color: var(--tinta);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.enlace-boton:hover { border-color: var(--verde); color: var(--verde); }

.hero { background: var(--verde-profundo); color: #fff; padding: clamp(32px, 6vw, 72px) 0 0; }
.hero-int { max-width: 1040px; margin: 0 auto; padding: 0 var(--g); }
.hero .saludo { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cobre-claro); margin: 0 0 12px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 56px); font-weight: 800; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--cobre-claro); }
.buscador { position: relative; margin-top: clamp(22px, 3vw, 34px); max-width: 720px; }
.buscador svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; stroke: var(--apagado); fill: none; stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.buscador input {
  width: 100%;
  height: 62px;
  padding: 0 54px 0 54px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 18px;
  color: var(--tinta);
}
.buscador input::placeholder { color: #8a9a97; }
.buscador input:focus { outline: 3px solid var(--cobre); outline-offset: 2px; }
.buscador .borrar { position: absolute; right: 10px; top: 11px; width: 40px; height: 40px; border: 0; border-radius: 6px; background: var(--verde-claro); color: var(--verde); font-size: 22px; line-height: 1; }
.buscador input::-webkit-search-cancel-button { display: none; }
.buscador:not(.con-texto) .borrar { display: none; }
.atajos { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.atajos button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: var(--verde-texto);
  font-size: 14.5px;
}
.atajos button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.hero .franja { margin-top: clamp(30px, 5vw, 56px); height: 6px; gap: 0; }
.hero .franja i { border-radius: 0; height: 6px; }

.contenedor { max-width: 1040px; margin: 0 auto; padding: 0 var(--g); }
.modulos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 26px 0 4px; }
.modulos .titulo-chip { font-size: 14px; font-weight: 600; color: var(--apagado); margin-right: 6px; }
.chip {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #cfd9d6;
  border-radius: 999px;
  background: #fff;
  color: var(--tinta);
  font-weight: 600;
  font-size: 14.5px;
}
.chip::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--verde)); }
.chip:hover { border-color: var(--verde); }
.chip[aria-pressed='true'] { background: var(--verde); border-color: var(--verde); color: #fff; }
.chip[aria-pressed='true']::before { background: #fff; }

.seccion-titulo { font-size: 14px; font-family: var(--mono); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--apagado); margin: 36px 0 14px; display: flex; align-items: center; gap: 12px; }
.seccion-titulo::after { content: ''; flex: 1; border-top: 1px dashed #c5d0ce; }

.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--borde);
  border-top: 5px solid var(--c, var(--verde));
  border-radius: 4px;
  padding: 16px 20px 20px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  top: 42px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--crema);
  border: 1px solid var(--borde);
}
.ticket::before { left: -9px; }
.ticket::after { right: -9px; }
.ticket:hover { transform: translateY(-3px); border-color: var(--c, var(--verde)); }
.ticket .cod { font-family: var(--mono); font-size: 13px; color: var(--apagado); letter-spacing: 0.06em; display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px dashed #d5dddb; margin: 0 -2px 14px; }
.ticket .cod b { text-transform: uppercase; color: var(--c, var(--verde)); font-weight: 500; }
.ticket h3 { font-size: 21px; margin-bottom: 8px; }
.ticket p { margin: 0; font-size: 15px; color: var(--apagado); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.indice details { background: #fff; border: 1px solid var(--borde); border-radius: 4px; margin-bottom: 8px; }
.indice summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; font-weight: 600; }
.indice summary::-webkit-details-marker { display: none; }
.indice summary .n { font-family: var(--mono); font-size: 13px; color: #fff; background: var(--c, var(--verde)); min-width: 34px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; }
.indice summary::after { content: '+'; margin-left: auto; font-size: 22px; color: var(--apagado); font-weight: 400; }
.indice details[open] summary::after { content: '−'; }
.indice .sub { padding: 0 18px 12px 66px; display: grid; }
.indice .sub a { padding: 8px 0; text-decoration: none; color: var(--tinta); border-top: 1px solid var(--lienzo); }
.indice .sub a:hover { color: var(--verde); text-decoration: underline; }

.resultados { display: grid; gap: 10px; }
.resultado {
  display: block;
  padding: 16px 20px 16px 24px;
  background: #fff;
  border: 1px solid var(--borde);
  border-left: 5px solid var(--c, var(--verde));
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}
.resultado:hover, .resultado.activo { border-color: var(--c, var(--verde)); background: #fcfbf8; }
.resultado .ruta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--apagado); }
.resultado h3 { font-size: 20px; margin: 4px 0 6px; }
.resultado p { margin: 0; font-size: 15px; color: var(--apagado); }
mark { background: #f8e2bb; color: inherit; border-radius: 2px; padding: 0 1px; }
.vacio { padding: 28px; background: #fff; border: 1px dashed #c5d0ce; border-radius: 4px; color: var(--apagado); }
.vacio b { color: var(--tinta); }

.migas { padding: 22px 0 0; font-size: 14.5px; color: var(--apagado); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.migas a { font-weight: 600; text-decoration: none; }
.migas a:hover { text-decoration: underline; }
.tema { max-width: 780px; margin: 0 auto; padding: 18px var(--g) 70px; }
.tema-cab { padding: 10px 0 22px; border-bottom: 2px dashed #d5dddb; margin-bottom: 28px; }
.etiqueta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--apagado); }
.etiqueta::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--verde)); }
.tema h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; margin: 10px 0 0; }
.cuerpo > * + * { margin-top: 16px; }
.cuerpo p { margin-bottom: 0; }
.cuerpo b { font-weight: 700; color: var(--verde-profundo); }
.cuerpo ul { padding-left: 0; list-style: none; }
.cuerpo ul li { position: relative; padding-left: 24px; margin-bottom: 8px; }
.cuerpo ul li::before { content: ''; position: absolute; left: 4px; top: 0.62em; width: 8px; height: 8px; background: var(--cobre); border-radius: 1px; transform: rotate(45deg); }
.cuerpo ul li.sub { margin-left: 22px; }
.cuerpo ol { padding-left: 0; list-style: none; }
.cuerpo ol li { position: relative; padding-left: 46px; min-height: 34px; margin-bottom: 10px; }
.cuerpo ol li::before {
  content: counter(list-item);
  position: absolute;
  left: 0;
  top: -1px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
}
.figura { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 14px; background: var(--lienzo); border-radius: 6px; }
.figura img { display: block; width: 100%; max-width: var(--ancho, 100%); background: #fff; border: 1px solid #d4cfc4; border-radius: 4px; cursor: zoom-in; }
.figura.varias img { width: auto; flex: 0 1 auto; max-height: 520px; object-fit: contain; }
.leyenda { font-size: 14.5px; color: var(--apagado); text-align: center; font-style: italic; margin-top: 8px !important; }
.nota { padding: 14px 18px; border-left: 5px solid var(--verde); background: var(--verde-claro); border-radius: 0 4px 4px 0; }
.nota b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; color: var(--verde); }
.nota p { margin: 0; }
.nota.aviso { border-left-color: var(--cobre); background: var(--cobre-fondo); }
.nota.aviso b { color: var(--cobre-texto); }
.tabla-caja { overflow-x: auto; border: 1px solid var(--borde); border-radius: 4px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th { text-align: left; background: var(--verde-profundo); color: #fff; padding: 11px 14px; font-weight: 600; white-space: nowrap; }
th b { color: #fff; }
td { padding: 11px 14px; border-top: 1px solid var(--lienzo); vertical-align: top; }
tbody tr:nth-child(even) td { background: #fbfaf7; }
td:first-child { font-weight: 500; }
.navtema { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; }
.navtema a { display: block; padding: 14px 18px; background: #fff; border: 1px solid var(--borde); border-radius: 4px; text-decoration: none; color: var(--tinta); font-weight: 600; }
.navtema a small { display: block; font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--apagado); margin-bottom: 2px; }
.navtema a:hover { border-color: var(--verde); }
.navtema a:last-child:not(:first-child) { text-align: right; }

.pie { margin-top: 64px; padding: 26px var(--g) 36px; background: var(--verde-profundo); color: var(--verde-texto); font-size: 14.5px; }
.pie-int { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: center; }
.pie b { color: #fff; font-family: var(--titulo); font-weight: 600; font-size: 16px; }

.visor { position: fixed; inset: 0; z-index: 50; background: rgba(8, 28, 26, 0.92); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.visor img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }
.visor-cerrar { position: absolute; right: 16px; top: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; font-size: 26px; line-height: 1; }
.subir { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--cobre); color: #fff; font-size: 22px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

@media (max-width: 900px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso-panel { gap: 28px; padding-bottom: 32px; }
  .acceso-roles { display: none; }
  .acceso-panel h1 { max-width: none; }
  .acceso-form-caja { align-items: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .cabecera { flex-wrap: wrap; }
  .cabecera .marca img { height: 38px; }
  .usuario { text-align: left; }
  .tickets { grid-template-columns: 1fr; }
  .navtema { grid-template-columns: 1fr; }
  .navtema a:last-child:not(:first-child) { text-align: left; }
  .buscador input { height: 56px; font-size: 17px; }
  .indice .sub { padding-left: 18px; }
  .cuerpo ol li { padding-left: 42px; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-top: 1px solid var(--borde); padding: 8px 0; }
  tbody tr:nth-child(even) td { background: transparent; }
  td { border: 0; padding: 4px 14px; }
  td::before { content: attr(data-et); display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--apagado); font-weight: 500; }
  td:first-child { font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticket { transition: none; }
}
@media print {
  .cabecera, .hero, .modulos, .navtema, .subir, .migas, .pie { display: none !important; }
  body { background: #fff; }
}
