/* Hifa · prototipo. Sin dependencias externas: tipografía del sistema, un solo archivo de estilos. */
:root {
  --fondo: #13130d;
  --panel: #1b1b13;
  --panel-2: #23231a;
  --linea: #34342a;
  --crema: #f6f1ea;
  --apagado: #a9a592;
  --oliva: #566847;
  --oliva-claro: #8aa876;
  --fuente: #5eead4;
  --alto: #f28b7d;
  --medio: #e8bd55;
  --bien: #93d27f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radio: 14px;
  --sombra: 0 18px 40px -22px rgb(0 0 0 / 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgb(86 104 71 / 0.28), transparent 60%),
    radial-gradient(40rem 26rem at -10% 110%, rgb(94 234 212 / 0.07), transparent 60%),
    var(--fondo);
  color: var(--crema);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fuente); outline-offset: 3px; border-radius: 6px; }

.saltar { position: absolute; left: -999px; top: 8px; background: var(--crema); color: var(--fondo); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.saltar:focus { left: 8px; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.75rem 1.25rem; border-right: 1px solid var(--linea);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.02), transparent 40%);
}
.principal { min-width: 0; display: flex; flex-direction: column; }
#contenido { flex: 1; padding: 2.25rem clamp(1.25rem, 4vw, 3.5rem) 3rem; max-width: 70rem; width: 100%; outline: none; }

.marca { display: flex; align-items: center; gap: 0.8rem; color: var(--fuente); }
.marca-icono { width: 2.4rem; height: 2.4rem; flex: none; }
.marca-nombre { font: 600 1.7rem/1 var(--serif); color: var(--crema); letter-spacing: 0.01em; }
.marca-sub { font-size: 0.78rem; color: var(--apagado); margin-top: 0.2rem; }

.etiqueta { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--apagado); }
.espacio { padding: 0.9rem 1rem; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--panel); }
.espacio-nombre { font: 600 1.15rem/1.3 var(--serif); margin-top: 0.55rem; }
.espacio-detalle { font-size: 0.82rem; color: var(--apagado); }

#nav { display: flex; flex-direction: column; gap: 0.25rem; }
#nav a {
  display: grid; grid-template-columns: 2rem 1fr; align-items: center;
  padding: 0.7rem 0.8rem; border-radius: 10px; color: var(--apagado); text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
#nav a:hover { background: var(--panel); color: var(--crema); }
#nav a[aria-current="page"] { background: var(--panel-2); color: var(--crema); box-shadow: inset 2px 0 0 var(--fuente); }
#nav .paso { font: 500 0.72rem/1 var(--mono); color: var(--fuente); }
.lateral-pie { margin-top: auto; font: 500 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--apagado); }

.barra { display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1.25rem, 4vw, 3.5rem); border-bottom: 1px solid var(--linea); }
.miga { font-size: 0.9rem; color: var(--apagado); }
.miga span { margin: 0 0.35rem; }
.usuario { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; color: var(--apagado); }
.avatar { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--linea); color: var(--crema); font-size: 0.72rem; font-weight: 600; }
.pie { padding: 1rem clamp(1.25rem, 4vw, 3.5rem) 1.75rem; border-top: 1px solid var(--linea); font-size: 0.8rem; color: var(--apagado); }

/* ---------- Tipografía de pantallas ---------- */
.kicker { font: 500 0.74rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fuente); }
.titulo { font: 500 clamp(2rem, 4.2vw, 3.1rem)/1.08 var(--serif); margin-top: 0.7rem; letter-spacing: -0.01em; }
.bajada { color: var(--apagado); margin-top: 0.6rem; max-width: 46rem; }
.cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.7rem 1.2rem; border-radius: 999px; border: 1px solid var(--linea);
  background: transparent; font-weight: 600; font-size: 0.92rem;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.boton:hover { border-color: var(--apagado); transform: translateY(-1px); }
.boton:active { transform: translateY(0); }
.boton.primario { background: var(--oliva); border-color: var(--oliva); color: #fff; }
.boton.primario:hover { background: #667a55; border-color: #667a55; }
.boton.suave { background: var(--panel-2); }
.boton[disabled] { opacity: 0.5; cursor: default; transform: none; }
.acciones { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.75rem; }
.acciones .derecha { margin-left: auto; }

/* ---------- Tarjetas y fuentes ---------- */
.tarjeta { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem 1.4rem; box-shadow: var(--sombra); }
.tarjeta + .tarjeta { margin-top: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%;
  padding: 0.22rem 0.65rem; border: 1px solid rgb(94 234 212 / 0.4); border-radius: 999px;
  font: 500 0.74rem/1.3 var(--mono); color: var(--fuente); background: rgb(94 234 212 / 0.06);
  overflow-wrap: anywhere;
}
.chip::before { content: ""; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: currentColor; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }

/* ---------- Entrevista ---------- */
.progreso { display: flex; align-items: center; gap: 0.9rem; font: 600 0.88rem/1 var(--sans); }
.barra-progreso { display: block; width: 11rem; height: 0.32rem; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.barra-progreso i { display: block; height: 100%; width: 0; background: var(--fuente); border-radius: 99px; transition: width 0.4s ease; }
.hilo { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.turno.nuevo { animation: aparecer 0.45s ease both; }
.turno .quien { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.1em; color: var(--fuente); }
.turno .pregunta { font: 500 1.25rem/1.35 var(--serif); margin-top: 0.55rem; }
.turno .respuesta { margin: 1rem 0 0 clamp(0rem, 4vw, 2.5rem); padding: 0.9rem 1.1rem; background: var(--panel-2); border-radius: 12px; border-top-left-radius: 3px; }
.turno .entiendo { margin: 0.7rem 0 0 clamp(0rem, 4vw, 2.5rem); padding-left: 0.8rem; border-left: 2px solid var(--fuente); color: var(--apagado); font-size: 0.92rem; }
.entrada { display: flex; gap: 0.6rem; margin-top: 1.25rem; padding: 0.55rem 0.6rem 0.55rem 1.1rem; border: 1px dashed var(--linea); border-radius: 999px; color: var(--apagado); font-size: 0.9rem; align-items: center; }
.entrada span { flex: 1; }

@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Mapa ---------- */
.rejilla-mapa { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.fuentes-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.fuentes-lista li { padding: 0.85rem 1rem; border: 1px solid var(--linea); border-radius: 12px; background: var(--panel); }
.fuentes-lista .nombre { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.fuentes-lista .detalle { font-size: 0.8rem; color: var(--apagado); margin-top: 0.2rem; }
.fuentes-lista li.vacio { border-style: dashed; border-color: var(--alto); }
.punto { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--fuente); flex: none; }
.vacio .punto { background: var(--alto); }
.tabla-envoltura { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
caption { text-align: left; padding: 1rem 1.2rem 0.4rem; color: var(--apagado); font-size: 0.85rem; }
th, td { text-align: left; padding: 0.8rem 1.2rem; border-top: 1px solid var(--linea); vertical-align: top; }
th { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--apagado); border-top: 0; }
tbody tr:hover { background: rgb(255 255 255 / 0.02); }
.insignia { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.65rem; border-radius: 999px; font: 600 0.72rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid currentColor; }
.insignia::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.insignia.alto { color: var(--alto); } .insignia.medio { color: var(--medio); } .insignia.bien { color: var(--bien); }
.captura { margin-top: 1.25rem; }
.captura h3 { font: 500 1.2rem/1.3 var(--serif); }
.captura ol { margin: 0.9rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.captura li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--linea); border-radius: 10px; font-size: 0.92rem; }
.captura li.hecha { border-color: var(--oliva); background: rgb(86 104 71 / 0.18); }
.captura .estado { font: 500 0.78rem/1.3 var(--mono); color: var(--bien); }
.grabando { color: var(--alto); font: 600 0.82rem/1 var(--mono); display: inline-flex; align-items: center; gap: 0.45rem; }
.grabando::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--alto); animation: latir 1s ease-in-out infinite; }
@keyframes latir { 50% { opacity: 0.25; transform: scale(0.8); } }

/* ---------- Primer día ---------- */
.plazo.separado { margin-top: 0.9rem; }
.plazo { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border: 1px solid var(--alto); border-radius: 999px; color: var(--alto); font-weight: 600; font-size: 0.9rem; }
.hallazgos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hallazgo { display: flex; flex-direction: column; padding: 1.4rem; margin: 0 !important; }
.hallazgo .num { font: 500 2.6rem/1 var(--serif); color: var(--fuente); opacity: 0.85; }
.hallazgo h3 { font: 500 1.3rem/1.25 var(--serif); margin-top: 0.8rem; }
.hallazgo p { color: var(--apagado); margin-top: 0.6rem; font-size: 0.93rem; }
.hallazgo .boton { margin-top: auto; align-self: flex-start; }
.hallazgo .chips { margin-bottom: 1.1rem; }

/* ---------- Bandeja ---------- */
.rejilla-bandeja { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.lista-pedidos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.lista-pedidos button { width: 100%; text-align: left; cursor: pointer; padding: 1rem 1.1rem; border: 1px solid var(--linea); border-radius: 12px; background: var(--panel); transition: border-color 0.2s, background 0.2s; }
.lista-pedidos button:hover { border-color: var(--apagado); }
.lista-pedidos button[aria-pressed="true"] { border-color: var(--fuente); background: var(--panel-2); }
.lista-pedidos .id { font: 600 0.8rem/1 var(--mono); color: var(--fuente); }
.lista-pedidos .cliente { font: 500 1.1rem/1.3 var(--serif); margin-top: 0.4rem; display: block; }
.lista-pedidos .resumen { font-size: 0.84rem; color: var(--apagado); display: block; margin-top: 0.2rem; }
.lista-pedidos .insignia { margin-top: 0.7rem; }
.detalle h2 { font: 500 1.7rem/1.2 var(--serif); }
.detalle .meta { color: var(--apagado); margin-top: 0.35rem; }
.bloque { margin-top: 1.4rem; }
.detalle .bloque h3 { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--apagado); margin-bottom: 0.6rem; }
.opcion { padding: 0.9rem 1.1rem; border-left: 3px solid var(--oliva-claro); background: rgb(86 104 71 / 0.16); border-radius: 0 10px 10px 0; }
.opcion small { display: block; margin-top: 0.4rem; color: var(--medio); font-size: 0.85rem; }
.correo { border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; }
.correo-cabecera { padding: 0.65rem 1rem; background: var(--panel-2); font-size: 0.85rem; color: var(--apagado); }
.correo-cabecera strong { color: var(--crema); font-weight: 600; }
.correo-cuerpo { padding: 1rem; background: #17170f; white-space: pre-wrap; }
textarea.correo-cuerpo { width: 100%; min-height: 9rem; border: 0; resize: vertical; font: inherit; color: var(--crema); }
.origen { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.origen li { font-size: 0.88rem; color: var(--apagado); }
.origen .chip { margin-right: 0.5rem; }
.resuelto { display: inline-flex; gap: 0.5rem; align-items: center; margin-top: 1.4rem; padding: 0.7rem 1rem; border-radius: 10px; border: 1px solid var(--bien); color: var(--bien); font-weight: 600; }
.resuelto.descartado { border-color: var(--apagado); color: var(--apagado); }

/* ---------- Permisos ---------- */
.rejilla-doble { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.rejilla-doble .tarjeta { margin: 0; }
.tarjeta h3 { font: 500 1.3rem/1.25 var(--serif); }
.cifras { margin: 1rem 0 0; display: grid; gap: 0.7rem; }
.cifras div { display: grid; grid-template-columns: 9rem 1fr; gap: 0.8rem; font-size: 0.93rem; padding-top: 0.7rem; border-top: 1px solid var(--linea); }
.cifras dt { color: var(--apagado); } .cifras dd { margin: 0; font-weight: 600; }
.nota { margin-top: 0.9rem; font-size: 0.85rem; color: var(--apagado); }
.chat { display: grid; gap: 0.7rem; margin-top: 1rem; }
.burbuja { padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.93rem; }
.burbuja.usuario-b { justify-self: end; max-width: 90%; background: var(--oliva); border-bottom-right-radius: 3px; }
.burbuja.hifa-b { background: var(--panel-2); border-top-left-radius: 3px; }
.burbuja .aviso-conflicto { display: block; margin-top: 0.6rem; padding-left: 0.7rem; border-left: 2px solid var(--medio); color: var(--medio); }
.burbuja.falta { border: 1px dashed var(--alto); background: transparent; color: var(--alto); }
.registro { margin-top: 1.25rem; }
.registro ol { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.45rem; font: 0.85rem/1.4 var(--mono); color: var(--apagado); }
.registro li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 0.8rem; }
.registro .hora { color: var(--fuente); }
.vacio-registro { color: var(--apagado); font-size: 0.88rem; margin-top: 0.8rem; }

/* ---------- Aviso ---------- */
.aviso { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 200%); opacity: 0; visibility: hidden; padding: 0.8rem 1.3rem; background: var(--crema); color: var(--fondo); border-radius: 999px; font-weight: 600; font-size: 0.92rem; box-shadow: var(--sombra); transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s; z-index: 20; max-width: calc(100vw - 2rem); text-align: center; }
.aviso.visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Adaptación ---------- */
@media (max-width: 62rem) {
  .hallazgos { grid-template-columns: 1fr; }
  .rejilla-mapa, .rejilla-bandeja, .rejilla-doble { grid-template-columns: 1fr; }
}
@media (max-width: 52rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding: 1rem 1.25rem; border-right: 0; border-bottom: 1px solid var(--linea); }
  .espacio, .lateral-pie { display: none; }
  #nav { flex-direction: row; overflow-x: auto; width: 100%; padding-bottom: 0.2rem; }
  #nav a { grid-template-columns: auto auto; gap: 0.5rem; white-space: nowrap; }
  .cifras div { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
