/* Libro al Día · Libro de Reclamaciones virtual */
:root {
  --tinta: #0f172a;
  --texto: #1f2937;
  --tenue: #6b7280;
  --linea: #e5e7eb;
  --fondo: #f5f6f8;
  --blanco: #ffffff;
  --primario: #1e3a5f;
  --primario-2: #152b47;
  --primario-suave: #e8eef6;
  --acento: #c2410c;
  --acento-suave: #fff7ed;
  --ok: #166534;
  --ok-suave: #dcfce7;
  --peligro: #b91c1c;
  --peligro-suave: #fee2e2;
  --radio: 12px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  color-scheme: light;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primario); }
h1, h2, h3 { color: var(--tinta); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin-top: 1.8em; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
code { background: var(--primario-suave); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
[hidden] { display: none !important; }
.tenue { color: var(--tenue); }
.chico { font-size: .875rem; }
.centro { text-align: center; }
.fuerte { font-weight: 700; text-decoration: none; }
.fuerte:hover { text-decoration: underline; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--acento); margin: 0 0 .35em; }

/* ---------- botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--primario); color: #fff; border: 1.5px solid var(--primario); border-radius: 10px;
  padding: .7em 1.2em; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--primario-2); border-color: var(--primario-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .lnk:focus-visible, a:focus-visible {
  outline: 3px solid #93c5fd; outline-offset: 2px;
}
.btn-borde { background: #fff; color: var(--primario); }
.btn-borde:hover { background: var(--primario-suave); color: var(--primario-2); }
.btn-chico { padding: .45em .85em; font-size: .9rem; }
.btn-grande { padding: .9em 1.6em; font-size: 1.05rem; }
.btn-ancho { width: 100%; }
.lnk { background: none; border: 0; padding: 0; font: inherit; color: var(--primario); text-decoration: underline; cursor: pointer; }
.botones { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- barra del panel ---------- */
.barra { background: var(--primario); color: #fff; }
.barra-in { max-width: 1180px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: .6rem 1.2rem; flex-wrap: wrap; }
.barra-marca { color: #fff; text-decoration: none; }
.marca { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; letter-spacing: -.01em; }
.barra-quien { opacity: .8; font-size: .9rem; padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, .3); }
.barra-nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.barra-nav a { color: #fff; text-decoration: none; padding: .4rem .75rem; border-radius: 8px; font-weight: 550; font-size: .95rem; opacity: .85; }
.barra-nav a:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.barra-nav a[aria-current="page"] { background: rgba(255, 255, 255, .16); opacity: 1; }
.barra-salir .lnk { color: #fff; opacity: .8; font-size: .95rem; }
@media (max-width: 720px) {
  .barra-quien { border: 0; padding: 0; width: 100%; order: 3; }
  .barra-nav { margin-left: 0; width: 100%; order: 4; }
  .barra-salir { margin-left: auto; }
}

.contenedor { max-width: 1180px; margin: 0 auto; padding: 28px 16px 48px; }
.contenedor.angosto { max-width: 860px; }
.pie { text-align: center; color: var(--tenue); font-size: .85rem; padding: 24px 16px 36px; }
.pie p { margin: .2em 0; }

/* ---------- avisos ---------- */
.nota { border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1.2rem; border: 1px solid; }
.nota-ok { background: var(--ok-suave); border-color: #bbf7d0; color: #14532d; }
.nota-error { background: var(--peligro-suave); border-color: #fecaca; color: #7f1d1d; }
.nota-info { background: var(--primario-suave); border-color: #c7d6ea; color: var(--primario-2); }

/* ---------- formularios ---------- */
label, .etq { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--tinta); }
label i, .etq i { color: var(--acento); font-style: normal; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--texto); background: #fff; border: 1.5px solid #d1d5db; border-radius: 10px;
  padding: .65em .8em; min-height: 46px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[readonly], textarea[readonly] { background: var(--fondo); }
input:focus, select:focus, textarea:focus { border-color: var(--primario); }
small { display: block; color: var(--tenue); font-size: .82rem; margin-top: .3rem; }
.campo { min-width: 0; }
.campo.error input, .campo.error select, .campo.error textarea { border-color: var(--peligro); background: #fffafa; }
.campo.error label, .campo.error .etq { color: var(--peligro); }
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.ancho { grid-column: 1 / -1; }
@media (max-width: 640px) { .rejilla { grid-template-columns: 1fr; } }
.pila { display: grid; gap: 1rem; }
.pila-chica { display: grid; gap: .5rem; border: 0; padding: 0; margin: 0; }
.dato { background: var(--fondo); border: 1px solid var(--linea); border-radius: 10px; padding: .6em .8em; font-weight: 600; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: .15rem 0 0; flex: none; accent-color: var(--primario); }
.check.error { color: var(--peligro); }
.opciones { display: flex; gap: .6rem; flex-wrap: wrap; }
.opcion { margin: 0; cursor: pointer; flex: 1 1 160px; }
.opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opcion span { display: block; border: 1.5px solid #d1d5db; border-radius: 10px; padding: .7em .9em; background: #fff; font-weight: 650; }
.opcion small { font-weight: 400; }
.opcion input:checked + span { border-color: var(--primario); background: var(--primario-suave); box-shadow: inset 0 0 0 1px var(--primario); }
.opcion input:focus-visible + span { outline: 3px solid #93c5fd; outline-offset: 2px; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.acciones { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }
.prefijo { display: flex; align-items: stretch; }
.prefijo span { display: flex; align-items: center; padding: 0 .6em; background: var(--fondo); border: 1.5px solid #d1d5db; border-right: 0;
  border-radius: 10px 0 0 10px; color: var(--tenue); font-size: .85rem; white-space: nowrap; }
.prefijo input { border-radius: 0 10px 10px 0; }
.copiable { display: flex; gap: .5rem; margin: .5rem 0; }
.copiable input { min-height: 40px; font-size: .9rem; }
.fila-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--linea);
  border-radius: var(--radio); padding: .7rem; margin: 0 0 .6rem; }
.fila-form input:not([type="checkbox"]) { flex: 1 1 200px; width: auto; min-height: 40px; }
.fila-form .check { margin: 0; }
.fila-botones { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- libro público ---------- */
.libro-cab { background: var(--marca, var(--primario)); color: #fff; }
.libro-cab.clara, .libro-cab.clara h1, .libro-cab.clara p { color: var(--tinta); }
.libro-cab.clara .tenue { color: #334155; }
.libro-cab.clara .eyebrow { color: var(--acento); }
.libro-cab.clara .pestanas a { color: var(--tinta); }
.libro-logo { display: block; max-height: 64px; max-width: 220px; background: #fff; border-radius: 12px; padding: 8px 10px; margin-bottom: 14px; }
.libro-cab-in { max-width: 860px; margin: 0 auto; padding: 32px 16px 0; }
.libro-cab h1 { color: #fff; margin-bottom: .3em; }
.libro-cab p { margin: 0 0 .2em; opacity: .92; }
.libro-cab .tenue { color: #cbd5e1; }
.libro-cab .eyebrow { color: #fdba74; }
.pestanas { display: flex; gap: .3rem; margin-top: 1.4rem; }
.pestanas a { color: #fff; text-decoration: none; padding: .7rem 1rem; border-radius: 10px 10px 0 0; font-weight: 600; opacity: .8; }
.pestanas a.activa, .pestanas a:hover { background: var(--fondo); color: var(--primario); opacity: 1; }
@media (max-width: 480px) { .pestanas a { padding: .6rem .75rem; font-size: .9rem; } }
.formulario { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 24px; box-shadow: var(--sombra); }
@media (max-width: 640px) { .formulario { padding: 18px 14px; } }
.aviso-legal { background: var(--acento-suave); border: 1px solid #fed7aa; border-radius: 10px; padding: .9rem 1rem; font-size: .92rem; margin-bottom: 1.4rem; }
.aviso-legal ol { margin: .4rem 0 0; padding-left: 1.2rem; }
.grupo { border: 0; padding: 0; margin: 0 0 1.6rem; }
.grupo legend { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.08rem; color: var(--tinta); margin-bottom: .9rem; padding: 0; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primario); color: #fff; font-size: .85rem; }
.consulta { margin-top: 2rem; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 24px; }
.consulta h2 { margin-top: 0; }
.exito { text-align: center; background: #fff; border: 1px solid #bbf7d0; border-radius: var(--radio); padding: 28px 20px; margin-bottom: 1.4rem; box-shadow: var(--sombra); }
.exito-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ok-suave); color: var(--ok); font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; }
.exito-num { font-size: 1.2rem; }

/* ---------- bloques de datos ---------- */
.bloque { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px 20px; margin-bottom: 1rem; }
.bloque h3 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--primario); border-bottom: 2px solid var(--primario-suave); padding-bottom: .5rem; }
.datos { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .45rem 1rem; margin: 0; }
.datos dt { color: var(--tenue); font-size: .92rem; }
.datos dd { margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) { .datos { grid-template-columns: 1fr; } .datos dd { margin-bottom: .4rem; } }
.texto-largo { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fondo); border-radius: 10px; padding: .9rem 1rem; }
.estado-ok { border-color: #bbf7d0; }

/* ---------- panel ---------- */
.titulo-fila { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titulo-fila h1 { margin-bottom: .2em; }
.miga { margin: 0 0 .8rem; font-size: .92rem; }
.miga a { text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 0 0 1.4rem; }
.kpi { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px 18px; display: flex; flex-direction: column; gap: .2rem; }
.kpi-num { font-size: 1.9rem; font-weight: 800; color: var(--tinta); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-txt { color: var(--tenue); font-size: .88rem; }
.kpi-alerta { border-color: #fcd34d; background: #fffbeb; }
.kpi-peligro { border-color: #fca5a5; background: #fef2f2; }
.kpi-peligro .kpi-num { color: var(--peligro); }
.pestanas-panel { display: flex; gap: .3rem; border-bottom: 1px solid var(--linea); margin-bottom: 1rem; }
.pestanas-panel a { padding: .55rem .9rem; text-decoration: none; color: var(--tenue); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestanas-panel a.activa { color: var(--primario); border-bottom-color: var(--primario); }
.tabla-envoltura { overflow-x: auto; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tabla th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); font-weight: 650; padding: .8rem 1rem; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla td { padding: .75rem 1rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #fafbfc; }
.vacio { background: #fff; border: 1px dashed #d1d5db; border-radius: var(--radio); padding: 1.4rem; text-align: center; color: var(--tenue); }
.sem { display: inline-block; font-size: .8rem; font-weight: 700; padding: .22em .65em; border-radius: 999px; white-space: nowrap; margin: 0 .2rem .2rem 0; }
.sem-verde { background: var(--ok-suave); color: var(--ok); }
.sem-ok { background: #e0f2fe; color: #075985; }
.sem-ambar { background: #fef3c7; color: #92400e; }
.sem-rojo { background: var(--peligro-suave); color: var(--peligro); }
.sem-vencido { background: #7f1d1d; color: #fff; }
.sem-apoyo { background: #ffedd5; color: #9a3412; }
.sem-info { background: var(--primario-suave); color: var(--primario); }
.tarjeta { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px; margin-bottom: 1rem; }
.tarjeta.angosta { max-width: 520px; }
.tarjeta.suave { background: #fafbfc; }
.tarjeta.destacada { border-color: #c7d6ea; background: var(--primario-suave); }
.tarjeta.borrador { border-color: #fed7aa; background: var(--acento-suave); }
details.tarjeta summary { cursor: pointer; }
details.tarjeta[open] summary { margin-bottom: 1rem; }
.dos-columnas { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .dos-columnas { grid-template-columns: 1fr; } }
.bitacora { list-style: none; padding: 0; margin: 0; font-size: .9rem; display: grid; gap: .5rem; }
.lista { padding-left: 1.1rem; margin: 0; display: grid; gap: .7rem; }
.qr-caja { width: 220px; max-width: 100%; margin: 1rem 0; border: 1px solid var(--linea); border-radius: 10px; padding: 8px; background: #fff; }
.qr-caja svg { display: block; width: 100%; height: auto; }
.distintivo-muestra { margin: .6rem 0; }
.distintivo-muestra img { display: block; }
.logo-muestra { display: block; max-height: 72px; max-width: 220px; border: 1px solid var(--linea); border-radius: 10px; padding: 8px; background: #fff; margin: 4px 0 12px; }
.fila-color { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
input[type="color"] { width: 90px; height: 46px; padding: 4px; cursor: pointer; }
input[type="file"] { padding: .5em; }

/* ---------- ingreso ---------- */
.fondo { background: radial-gradient(1200px 600px at 15% -10%, #dbe6f3 0, transparent 60%), var(--fondo); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-caja { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--linea); border-radius: 16px; padding: 28px; box-shadow: var(--sombra); }
.auth-marca { color: var(--primario); text-decoration: none; display: inline-block; margin-bottom: 1.2rem; }
.auth h1 { font-size: 1.4rem; }
.auth-caja form + .centro { margin-top: 1.1rem; }

/* ---------- aviso A4 ---------- */
.aviso { background: #d9dde3; }
.barra-aviso { max-width: 210mm; margin: 16px auto; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 0 16px; }
.hoja-a4 {
  width: 210mm; min-height: 297mm; margin: 0 auto 32px; background: #fff; padding: 18mm 18mm 16mm;
  display: flex; flex-direction: column; align-items: center; text-align: center; color: #000; box-shadow: 0 6px 30px rgba(0, 0, 0, .15);
}
.a4-cinta { width: 100%; background: var(--marca, var(--primario)); color: #fff; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  font-size: 34pt; line-height: 1.1; padding: 10mm 6mm; border-radius: 4mm; }
.a4-legal { font-size: 17pt; line-height: 1.4; margin: 12mm 4mm 8mm; }
.a4-qr { width: 92mm; height: 92mm; }
.a4-logo { display: block; max-height: 24mm; max-width: 70mm; margin: 0 auto 6mm; }
.hoja-a4.clara .a4-cinta { color: var(--tinta); }
.a4-qr svg { width: 100%; height: 100%; display: block; }
.a4-instr { font-size: 16pt; line-height: 1.45; margin: 8mm 0 0; }
.a4-instr b { font-size: 18pt; color: var(--primario); }
.a4-pie { margin-top: auto; padding-top: 8mm; border-top: 1px solid #000; width: 100%; font-size: 12pt; line-height: 1.5; }
@media screen and (max-width: 840px) {
  .hoja-a4 { width: auto; min-height: 0; margin: 0 16px 24px; padding: 24px 16px; }
  .a4-cinta { font-size: 1.6rem; padding: 18px 12px; }
  .a4-legal, .a4-instr { font-size: 1rem; }
  .a4-instr b { font-size: 1.05rem; }
  .a4-qr { width: 70vw; height: 70vw; max-width: 320px; max-height: 320px; }
}

/* ---------- impresión ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .barra, .pie, .no-imprimir, .pestanas, .consulta, .btn { display: none !important; }
  .contenedor { padding: 0; max-width: none; }
  .bloque, .tarjeta, .exito { box-shadow: none; break-inside: avoid; }
  .libro-cab { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .libro-cab h1, .libro-cab p { color: #000; }
  .libro-cab-in { padding: 0 0 8px; }
  .dos-columnas { display: block; }
  body.aviso { background: #fff; }
  body.aviso .hoja-a4 { box-shadow: none; margin: 0; width: auto; min-height: 0; height: 100vh; padding: 0; }
  body.aviso .a4-cinta { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
