/* Panel de administración. Fuentes del sistema: carga rápida en el local. */
:root {
  --rojo: #CF1419; --rojo-oscuro: #A10F13; --amarillo: #F6B21B; --crema: #FFF8EC; --tinta: #2B1A12;
  --sutil: #5E4A3F; --borde: #E8D6BC; --blanco: #fff; --verde: #0F7A36; --gris: #6B6159;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--crema); color: var(--tinta); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
a { color: var(--rojo-oscuro); }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; }
.contenedor { max-width: 900px; margin: 0 auto; padding: 16px; }
.sutil { color: var(--sutil); }
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: 14px; padding: 14px; margin-bottom: 12px; }

.barra { background: var(--blanco); border-bottom: 4px solid var(--amarillo); padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.logo { font-weight: 800; color: var(--rojo); text-decoration: none; margin-right: auto; min-height: 44px; display: flex; align-items: center; }
.barra nav { display: flex; flex-wrap: wrap; gap: 2px; order: 3; width: 100%; }
.barra nav a { padding: 10px 10px; min-height: 44px; text-decoration: none; color: var(--tinta); font-weight: 700; border-radius: 8px; }
.barra nav a[aria-current="page"] { background: var(--tinta); color: var(--blanco); }
.barra form { margin: 0; }
.link { background: none; border: 0; color: var(--rojo-oscuro); font-weight: 700; min-height: 44px; cursor: pointer; text-decoration: underline; }
@media (min-width: 700px) { .barra nav { order: 0; width: auto; } }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--rojo); background: var(--rojo); color: var(--blanco); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--rojo-oscuro); }
.btn-chico { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn-sec { background: var(--blanco); color: var(--rojo-oscuro); }
.btn-sec:hover { background: #FFF0EE; }
.btn-peligro { background: var(--blanco); color: var(--rojo-oscuro); border-style: dashed; }
.btn-wa { background: var(--verde); border-color: var(--verde); }
.btn-wa:hover { background: #0B5E29; }

.flash { background: #DDF3E3; border: 1px solid #9CCFAA; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.flash-error { background: #FDE2E1; border-color: #E9A3A0; color: #7A0B0F; }

.cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cabecera h1 { margin: 0; }
.interruptor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.estado-pedidos { font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.estado-pedidos.on { background: #DDF3E3; color: #0B5E29; }
.estado-pedidos.off { background: #FDE2E1; color: #7A0B0F; }

.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filtros .ancho { grid-column: 1 / -1; }
.acciones-filtro { display: flex; gap: 8px; flex-wrap: wrap; }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
input, select { width: 100%; min-height: 44px; padding: 8px 10px; border: 2px solid #B9A88F; border-radius: 10px; font: inherit; background: var(--blanco); }

.lista { list-style: none; padding: 0; margin: 0 0 12px; }
.fila { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.fila:hover { border-color: var(--rojo); }
.fila-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fila-montos { display: flex; gap: 16px; font-weight: 700; }
.chip { font-size: .8rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.chip-pendiente_senia { background: var(--amarillo); color: var(--tinta); }
.chip-confirmado { background: #DDF3E3; color: #0B5E29; }
.chip-retirado { background: #DCE7F7; color: #1C3F73; }
.chip-cancelado { background: #E6E0D8; color: #4E4640; text-decoration: line-through; }

.datos { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.datos dt { color: var(--sutil); font-weight: 700; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.nota { white-space: pre-wrap; }
.items { list-style: none; padding: 0; margin: 0 0 10px; }
.items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--borde); }
.montos dd { text-align: right; }
.acciones { display: grid; gap: 10px; margin: 16px 0; }
.acciones form { margin: 0; }
.acciones .btn { width: 100%; }

.cupo { display: grid; gap: 10px; }
.cupo h2 { text-transform: capitalize; margin: 0; }
.cupo-tipo { display: grid; gap: 4px; }
meter { width: 100%; height: 14px; }

.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--borde); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tfoot th, .tabla tfoot td { font-weight: 800; border-bottom: 0; }
.tabla td { overflow-wrap: anywhere; vertical-align: top; }
.nowrap { white-space: nowrap; }

.login { max-width: 380px; margin: 10vh auto 0; }
.form { display: grid; gap: 6px; }
.form .btn { margin-top: 10px; }
.solo-imprimir { display: none; }

/* Productos, contenido y configuración */
.ver-sitio { font-weight: 700; font-size: .9rem; min-height: 44px; display: flex; align-items: center; }
.productos-admin { list-style: none; margin: 0; padding: 0; }
.productos-admin li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.productos-admin li:last-child { border-bottom: 0; }
.productos-admin li.inactivo { opacity: .6; }
.prod-link { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; min-height: 56px; }
.prod-link img, .sin-foto { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: 0 0 56px; }
.sin-foto { display: grid; place-items: center; background: #EFE6D8; color: var(--sutil); font-size: .65rem; font-weight: 700; text-align: center; }
.prod-nombre { display: grid; font-weight: 700; line-height: 1.25; }
.prod-nombre small { font-weight: 600; text-decoration: underline; }
.precio-inline { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 800; flex: 0 0 auto; }
.precio-inline input { width: 110px; text-align: right; }
.barra-guardar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--crema) 30%); padding: 16px 0 12px; }
.barra-guardar .btn { width: 100%; }
.form-admin h2 { margin-bottom: 10px; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campos h2, .campos .ancho, .campos .check, .campos legend, .campos .foto-campo { grid-column: 1 / -1; }
.campos > div > label, .foto-campo > label { margin-bottom: 4px; }
fieldset { border: 1px solid var(--borde); border-radius: 12px; padding: 12px; margin: 0 0 12px; min-width: 0; }
legend { font-weight: 800; padding: 0 6px; }
textarea { width: 100%; padding: 8px 10px; border: 2px solid #B9A88F; border-radius: 10px; font: inherit; background: var(--blanco); }
input[type="file"] { padding: 8px; background: #FBF7F0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: 44px; margin: 0; }
.check input { width: 24px; height: 24px; min-height: 0; accent-color: var(--rojo); flex: 0 0 auto; }
.foto-actual { display: block; width: 100%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.foco-bloque { margin-bottom: 10px; }
.foco-editor { position: relative; display: inline-block; max-width: 420px; width: 100%; line-height: 0; }
.foco-editor img { width: 100%; height: auto; border-radius: 12px; cursor: crosshair; }
.foco-editor img:focus-visible { outline: 3px solid var(--rojo); outline-offset: 3px; }
.foco-marca {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--tinta), 0 2px 8px rgba(0, 0, 0, .4); background: rgba(207, 20, 25, .55);
}
.foco-vistas { display: flex; gap: 12px; margin: 8px 0 4px; }
.foco-vistas figure { margin: 0; display: grid; gap: 4px; font-size: .78rem; color: var(--sutil); text-align: center; }
.foco-vistas span { display: block; height: 72px; overflow: hidden; border-radius: 8px; background: #EFE6D8; }
.foco-vistas img { width: 100%; height: 100%; object-fit: cover; }
.vista-43 { width: 96px; } .vista-34 { width: 54px; } .vista-11 { width: 72px; }
.ayuda { font-size: .88rem; color: var(--sutil); margin: 4px 0 0; }
.grilla-2 { display: grid; gap: 12px; }
.consejos ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
details > summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
details[open] > summary { margin-bottom: 10px; }
.flash ul { margin: 0; padding-left: 1.1rem; }
@media (min-width: 700px) { .grilla-2 { grid-template-columns: 1fr 1fr; } }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12pt; }
  .barra, .no-imprimir, .flash { display: none !important; }
  .solo-imprimir { display: block; }
  .contenedor { max-width: none; padding: 0; }
  .tarjeta { border: 1px solid #999; break-inside: avoid; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prod-link { flex: 1; }
.precio-inline input { width: 104px; }
.campos > * { min-width: 0; }
