/* Gotas Peatonal - estilos. Letra grande, pocos colores, botones fáciles de tocar. */
:root {
  --fondo: #f6faf9;
  --tarjeta: #ffffff;
  --texto: #1f2a28;
  --suave: #5f6e6b;
  --borde: #d6e5e2;
  /* Turquesa Gotas (tiffany). Es muy claro: va con letra oscura encima. */
  --relleno: #14f7ce;
  --sobre-relleno: #08332d;
  /* Turquesa más profundo para letras, links y bordes (se lee sobre blanco). */
  --marca: #0a7f6d;
  --marca-oscuro: #06574b;
  --marca-claro: #dcfaf3;
  --ok: #1f7a4a;
  --ok-fondo: #e5f4ec;
  --error: #b3261e;
  --error-fondo: #fbe9e7;
  --alerta-fondo: #fff4e0;
  --radio: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #121a19; --tarjeta: #1a2523; --texto: #e8f3f1; --suave: #a3b8b4; --borde: #2e3f3c;
    --marca: #4ff0d4; --marca-oscuro: #9ff5e6; --marca-claro: #163a34;
    --ok: #7fd3a5; --ok-fondo: #1c3327; --error: #ff8a80; --error-fondo: #3d1f1d; --alerta-fondo: #3a2f1b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 17px; }
body { margin: 0; background: var(--fondo); color: var(--texto); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
a { color: var(--marca); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; color: var(--suave); }
small, .ayuda { color: var(--suave); }
.ayuda { font-size: .92rem; }

/* Barra superior */
.barra { background: linear-gradient(180deg, #4ffbe0 0%, var(--relleno) 55%, #0fe0bb 100%); color: var(--sobre-relleno); display: flex; flex-wrap: wrap;
  align-items: center; gap: .4rem 1rem; padding: .6rem 1rem; box-shadow: 0 4px 14px rgba(8,51,45,.22); position: relative; z-index: 10; }
.barra a { color: var(--sobre-relleno); text-decoration: none; }
.marca { font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; }
.marca span { font-weight: 400; opacity: .85; }
.marca { text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.menu { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
/* Ítems del menú: botones en relieve; el activo queda "hundido" */
.menu > a, .submenu summary { padding: .4rem .7rem; border-radius: 10px; font-weight: 500;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.22)); border: 1px solid rgba(8,51,45,.14);
  box-shadow: 0 2px 0 rgba(8,51,45,.18), inset 0 1px 0 rgba(255,255,255,.8); transition: transform .12s, box-shadow .12s, background .12s; }
.menu > a:hover, .submenu summary:hover { background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.4)); transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(8,51,45,.2), inset 0 1px 0 #fff; }
.menu > a.activo, .submenu.activo summary, .submenu[open] summary { background: var(--sobre-relleno); color: var(--relleno); border-color: var(--sobre-relleno);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.45); transform: translateY(1px); font-weight: 600; }
.barra .menu > a.activo { color: var(--relleno); }
/* Submenús (Productos, Config): se abren con un toque, sirven en el celular */
.submenu { position: relative; }
.submenu summary { list-style: none; cursor: pointer; user-select: none; }
.submenu summary::-webkit-details-marker { display: none; }
.submenu summary::after { content: " ▾"; font-size: .8em; }
.submenu-items { position: absolute; left: 0; top: calc(100% + .45rem); z-index: 20; min-width: 230px; background: var(--tarjeta); border-top: 3px solid var(--relleno) !important;
  border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .3rem; display: flex; flex-direction: column; }
.barra .submenu-items a { color: var(--texto); padding: .55rem .7rem; border-radius: 6px; }
.barra .submenu-items a:hover { background: var(--marca-claro); }
.barra .submenu-items a.activo { background: var(--marca-claro); color: var(--marca-oscuro); font-weight: 600; }
.submenu summary { white-space: nowrap; }
@media (max-width: 760px) {
  /* En el celular el menú es una tira que se desliza: el submenú se abre a lo ancho, debajo de la barra */
  .menu { align-items: center; }
  .submenu-items { position: fixed; left: .5rem; right: .5rem; min-width: 0; top: var(--submenu-top, 6rem); }
  .barra .submenu-items a { padding: .75rem .8rem; }
}
/* Usuario y botón para salir */
.quien { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.quien .avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--sobre-relleno); color: var(--relleno); box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.quien .nombre { font-weight: 600; }
.barra .salir { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem; border-radius: 10px; font-size: .88rem; font-weight: 600;
  background: rgba(255,255,255,.35); border: 1px solid rgba(8,51,45,.18); box-shadow: 0 2px 0 rgba(8,51,45,.15); transition: all .12s; }
.barra .salir:hover { background: var(--sobre-relleno); color: #fff; border-color: var(--sobre-relleno); }
.barra .salir svg { width: 1.05rem; height: 1.05rem; }
@media (max-width: 760px) {
  .quien .nombre, .barra .salir span { display: none; }
  .barra .salir { padding: .4rem .5rem; }
}

.contenido { max-width: 1150px; margin: 0 auto; padding: 1rem; }
.volver { display: inline-block; margin-bottom: .4rem; text-decoration: none; }

/* Tarjetas y grillas */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.grilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.grilla-2 > .tarjeta { margin-bottom: 1rem; }
@media (max-width: 760px) { .grilla-2 { grid-template-columns: 1fr; } }

/* Avisos */
.aviso { padding: .75rem 1rem; border-radius: var(--radio); margin-bottom: 1rem; font-weight: 500; }
.aviso-ok { background: var(--ok-fondo); color: var(--ok); }
.aviso-error { background: var(--error-fondo); color: var(--error); }

/* Botones */
.boton, button.boton { display: inline-block; background: var(--relleno); color: var(--sobre-relleno); border: 0; border-radius: 8px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.boton:hover { filter: brightness(.94); }
.boton:disabled { opacity: .6; cursor: wait; }
.boton.secundario { background: var(--marca-claro); color: var(--marca-oscuro); }
.boton.peligro { background: var(--error-fondo); color: var(--error); }
.boton.grande { font-size: 1.1rem; padding: .8rem 1.6rem; margin-top: .6rem; }
.boton.chico { min-height: 32px; padding: .25rem .6rem; font-size: .9rem; }
summary.boton { list-style: none; }
summary.boton::-webkit-details-marker { display: none; }
details.tarjeta { padding: .6rem; background: transparent; border: 0; }
details[open].tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); padding: 1rem; }

.botonera { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin: 1rem 0; }
.boton-grande { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem .6rem; text-decoration: none; color: var(--texto); font-weight: 600; text-align: center; min-height: 110px; }
.boton-grande span { font-size: 2rem; }
.boton-grande:hover { border-color: var(--marca); background: var(--marca-claro); }

/* Formularios */
input, select, textarea { font: inherit; color: var(--texto); background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 8px; padding: .55rem .7rem; min-height: 44px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 0; border-color: var(--marca); }
.formulario label { display: block; margin-bottom: .8rem; font-weight: 500; }
.formulario label input:not([type=checkbox]), .formulario label select, .formulario label textarea { display: block; width: 100%; margin-top: .25rem; font-weight: 400; }
.formulario label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.fila-campos { display: flex; gap: .8rem; flex-wrap: wrap; }
.fila-campos > label { flex: 1 1 150px; }
.angosto { max-width: 420px; }
.en-linea { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .3rem 1rem .3rem 0; }
.en-linea label { margin: 0; }
.en-linea label input, .en-linea label select { display: block; width: auto; }
input.corto, .corto { width: 6.5rem; }
.codigo { background: var(--tarjeta); border: 1px solid var(--borde); padding: 1rem; overflow: auto; border-radius: var(--radio); }

.filtros { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.filtros input[type=search] { flex: 1 1 260px; }
.buscador-grande { display: flex; gap: .5rem; }
.buscador-grande input { flex: 1; min-width: 0; font-size: 1.15rem; padding: .8rem 1rem; }

/* Tablas */
.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; background: var(--tarjeta); }
.tarjeta .tabla { background: transparent; }
.tabla th, .tabla td { padding: .55rem .6rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.tabla th { font-size: .85rem; color: var(--suave); font-weight: 600; background: var(--marca-claro); }
.tabla tfoot th { background: transparent; color: var(--texto); font-size: 1rem; }
.tabla.chica td { padding: .35rem .4rem; font-size: .92rem; }
.num { text-align: right !important; white-space: nowrap; }
.centro { text-align: center !important; }
.clic { cursor: pointer; }
.clic:hover td { background: var(--marca-claro); }
tr.alerta td { background: var(--alerta-fondo); }
tr.inactivo td { opacity: .55; }
td.bajo { color: var(--error); font-weight: 700; }
.vacio { text-align: center; color: var(--suave); padding: 2rem !important; }
.mini { width: 52px; }
.mini img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.editor td { background: var(--fondo); }
.paginas { display: flex; gap: .6rem; justify-content: center; margin: 1rem 0; }
.medios input:not([type=checkbox]) { width: 100%; min-width: 5rem; }
.medios input.corto { width: 6rem; }

/* Ficha de producto */
.foto-grande { max-width: 100%; max-height: 280px; border-radius: var(--radio); display: block; margin: .3rem 0 .8rem; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; font-weight: 600; }
.precio { font-size: 1.6rem; color: var(--marca); }
.precios-medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; }
.precios-medios div { border: 1px solid var(--borde); border-radius: 8px; padding: .5rem .7rem; display: flex; flex-direction: column; }
.precios-medios span { font-size: .85rem; color: var(--suave); }
.precios-medios b { font-size: 1.25rem; }
.lista-estado { margin: 0; padding-left: 1.1rem; }
.lista-estado li { margin-bottom: .35rem; }
.acciones-pie { display: inline-block; margin: 0 .6rem 1rem 0; }

/* Celular */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .contenido { padding: .8rem; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .menu a { white-space: nowrap; }
  .tabla.productos th:nth-child(3), .tabla.productos td:nth-child(3) { display: none; }
}

/* ---------------------------------------------------------------- Vender */
.boton-grande.destacado { background: var(--relleno); color: var(--sobre-relleno); border-color: var(--relleno); }
.pos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } }
.pos-buscar { display: flex; gap: .5rem; margin-bottom: .5rem; }
.pos-buscar input { flex: 1; min-width: 0; font-size: 1.2rem; padding: .8rem 1rem; }
.resultados { background: var(--tarjeta); border: 1px solid var(--marca); border-radius: var(--radio); margin-bottom: .8rem; max-height: 360px; overflow: auto; }
.resultados button { display: flex; justify-content: space-between; gap: 1rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--borde); padding: .6rem .8rem; font: inherit; color: var(--texto); cursor: pointer; }
.resultados button:hover { background: var(--marca-claro); }
.sin-result { padding: .8rem; }
.carrito td { vertical-align: middle; }
.cant { white-space: nowrap; }
.cant input { width: 3.4rem; text-align: center; padding: .4rem; }
.cant button, .quitar { background: var(--marca-claro); color: var(--marca-oscuro); border: 0; border-radius: 6px; width: 34px; height: 38px; font-size: 1.1rem; cursor: pointer; }
.quitar { background: transparent; color: var(--suave); }
.aviso-linea { color: var(--error); }
.pos-acciones { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; margin: .6rem 0; }
.pos-der { position: sticky; top: .5rem; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; margin: .4rem 0 1rem; }
.pos-total b { font-size: 1.3rem; }
.pos-total.grande b { font-size: 2rem; color: var(--marca); }
.medios-botones { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .5rem; }
.medios-botones button, .tipos button { background: var(--tarjeta); color: var(--texto); border: 2px solid var(--borde); border-radius: 8px; padding: .45rem .6rem; font: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.medios-botones span { font-size: .82rem; color: var(--suave); }
.medios-botones button.elegido, .tipos button.elegido { border-color: var(--marca); background: var(--marca-claro); }
.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-bottom: .6rem; }
.tipos button { text-align: center; align-items: center; font-weight: 600; min-height: 48px; justify-content: center; }
.otro-pago { display: flex; gap: .4rem; margin: .4rem 0; }
.otro-pago select { flex: 1; }
.otro-pago input { width: 8rem; }
.campo-grande { display: block; margin: .8rem 0 .3rem; font-weight: 500; }
.campo-grande input { display: block; width: 100%; font-size: 1.3rem; margin-top: .2rem; }
.vuelto { font-size: 1.3rem; min-height: 1.6rem; }
.falta { color: var(--error); font-weight: 600; min-height: 1.2rem; }
.cobrar { width: 100%; font-size: 1.3rem !important; }
.dialogo { border: 1px solid var(--borde); border-radius: var(--radio); background: var(--tarjeta); color: var(--texto); max-width: 420px; width: 92%; }
.dialogo::backdrop { background: rgba(0,0,0,.4); }
tr.anulada td { text-decoration: line-through; opacity: .6; }
.resumen-ventas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.dato { display: flex; flex-direction: column; margin: 0; }
.dato span { color: var(--suave); font-size: .9rem; }
.dato b { font-size: 1.4rem; }
.pos > * { min-width: 0; }
@media (max-width: 600px) {
  .pos-buscar { flex-wrap: wrap; }
  .pos-buscar input { flex-basis: 100%; }
  .carrito th:nth-child(3), .carrito td:nth-child(3) { display: none; }
  .carrito input.corto { width: 3.6rem; }
  .cant input { width: 2.6rem; }
  .cant button { width: 30px; }
  .carrito th, .carrito td { padding: .45rem .3rem; }
}
.pos-cliente { margin-bottom: 1rem; }
#cliente-elegido { display: flex; justify-content: space-between; align-items: center; background: var(--marca-claro); border-radius: 8px; padding: .4rem .7rem; }

/* ------------------------------------------------------------- Consulta */
.consulta { max-width: 640px; margin: 0 auto; }
.camara { position: relative; background: #000; border-radius: var(--radio); overflow: hidden; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: .8rem; padding: 1rem; }
.camara video { display: none; width: 100%; max-height: 50vh; object-fit: cover; }
.camara .mira { display: none; position: absolute; left: 10%; right: 10%; top: 50%; height: 0; border-top: 2px solid #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
.camara.activa { padding: 0; }
.camara.activa video, .camara.activa .mira { display: block; }
.camara.activa #activar { display: none; }
.camara .ayuda { color: #ddd; margin: .5rem; text-align: center; }
.camara.activa .ayuda { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); margin: 0; padding: .3rem; }
.ficha-consulta h2 { font-size: 1.35rem; margin-bottom: .1rem; }
.foto-consulta { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radio); background: #fff; }
.precio-lista { font-size: 1.1rem; margin: .6rem 0; }
.precio-lista b { font-size: 1.8rem; color: var(--marca); margin-left: .4rem; }
.precios-medios div.mejor { border-color: var(--ok); background: var(--ok-fondo); }
.precios-medios small { color: var(--suave); }

/* -------------------------------------------------------------- Tablero */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem 1rem; display: flex; flex-direction: column; text-decoration: none; color: var(--texto); }
.kpi span { color: var(--suave); font-size: .9rem; }
.kpi b { font-size: 1.6rem; margin: .1rem 0; }
.kpi small { color: var(--suave); }
.sin-inflacion { font-size: .8rem; }
.cuentas tr.total th { font-size: 1.2rem; border-top: 2px solid var(--texto); }
h2.separado { margin-top: 1.3rem; }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 1.25rem; } }
.cuentas tr.total th { color: var(--texto); }

/* Avisos de cosas pendientes */
.aviso-alerta { background: var(--alerta-fondo); color: var(--texto); }

/* Compras */
.renglones-compra { font-size: .95rem; }
.renglones-compra th, .renglones-compra td { padding-left: .35rem; padding-right: .35rem; }
.renglones-compra td { vertical-align: top; }
.renglones-compra .col-producto { min-width: 210px; }
.renglones-compra .col-precio { min-width: 175px; }
.renglones-compra input { padding: .35rem .45rem; font-size: .95rem; }
.renglones-compra input.ancho { width: 100%; margin: .25rem 0; }
.renglones-compra input.corto { width: 6rem; }
.renglones-compra input.mini { width: 3.4rem; }
.renglones-compra input.cant-compra { width: 3.6rem; text-align: center; }
.renglones-compra input[type=date] { width: 8.6rem; padding-left: .3rem; padding-right: .2rem; }
.sub-campos { display: flex; flex-direction: column; gap: .25rem; }
.sub-campos input { width: 100%; }
.precio-cambio { display: flex; align-items: center; gap: .4rem; margin: .2rem 0; }
.etiqueta-nuevo { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--marca-claro); color: var(--marca-oscuro); border-radius: 6px; padding: .1rem .45rem; }
.renglones-compra .check-precio { display: inline-flex; margin: 0; font-weight: 400; align-items: center; gap: .3rem; font-size: .9rem; cursor: pointer; }
.renglones-compra .check-precio input { width: 1.1rem; height: 1.1rem; }
.ayuda.resalta { color: var(--marca-oscuro); font-weight: 600; }
.total-compra { font-size: 1.15rem; margin: .2rem 0 .8rem; }
.total-compra b { font-size: 1.5rem; color: var(--marca); }
.botones-compra { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .4rem; }
.totales-compra small .boton.chico { margin-top: .2rem; }
