/* Panel de Efraín: estilo app bancaria, azul índigo (#405DE8), cielo (#5C9EE8), marino (#1E243F) */
:root {
  --verde: #FFD966; --lavanda: #E1E8FF; --beige: #FFF4CC; --gris: #EEF2FB; --bg: #E4ECF9; --card: #fff;
  --marino: #1E243F; --azul: #405DE8; --cielo: #5C9EE8; --rojo: #E5484D; --ok: #1c8a4a;
  --tinta: #1E243F; --suave: #5B6585;
  --radio: 26px; --sombra: 0 6px 24px rgba(30,36,63,.07);
}
html[data-m=dark] { --bg: #12151F; --card: #1E243F; --tinta: #EAEFFB; --suave: #9AA6C6; --gris: #2A3150; --lavanda: #2A3150; --beige: #3B3A22; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--tinta); font: 400 1.0625rem/1.5 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; padding-bottom: 5.5rem; }
body.solo { padding-bottom: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 .8rem; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); } h2 { font-size: 1.35rem; margin-top: 1.6rem; } h3 { font-size: 1.1rem; }
em { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 500; }
a { color: inherit; } p { margin: 0 0 .5rem; }
.suave { color: var(--suave); font-size: .92rem; } .sr { position: absolute; left: -9999px; }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; border-radius: 6px; }

/* Barra y menú: abajo en el celular, arriba en pantallas grandes */
.barra { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 1rem; background: var(--marino); color: #fff; flex-wrap: wrap; }
.barra a { color: #fff; }
.marca { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.marca img { height: 36px; width: auto; }
.salir { font-size: .92rem; font-weight: 600; }
.menu { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid rgba(30,36,63,.12); padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); }
.menu a { flex: 1; text-align: center; text-decoration: none; font-weight: 600; font-size: .85rem; padding: .7rem .2rem; border-radius: 14px; }
.menu a.on { background: var(--marino); color: #fff; }
@media (min-width: 820px) {
  body { padding-bottom: 2rem; }
  .menu { position: static; border: 0; padding: 0; background: none; gap: .3rem; }
  .menu a { flex: none; padding: .45rem 1rem; font-size: .95rem; }
}

.contenido { width: min(100% - 2rem, 920px); margin: 1.4rem auto; }
.centro { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; }

/* Avisos */
.aviso { padding: .8rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 600; background: var(--verde); }
.aviso.error { background: #fbd5d5; color: #8f0000; }

/* Formularios */
.form, .tarjeta-form { background: var(--card); border-radius: var(--radio); padding: 1.2rem; box-shadow: var(--sombra); margin-bottom: 1.2rem; }
.tarjeta-form { width: min(100%, 420px); } .tarjeta-form.ancha { width: min(100%, 520px); }
.tarjeta-form .logo { margin: 0 auto 1rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .8rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .8rem .9rem; font: inherit; font-weight: 400; color: var(--tinta); background: var(--gris); border: 1.5px solid transparent; border-radius: 14px; }
input:focus, select:focus { border-color: var(--tinta); outline: none; background: var(--card); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check input { width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; flex: none; }
.fila { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; padding: .7rem 1.4rem; border: 2px solid var(--azul); border-radius: 999px; background: var(--azul); color: #fff; font: 700 1rem "DM Sans", sans-serif; text-decoration: none; cursor: pointer; width: 100%; }
.btn.contorno { background: transparent; color: var(--azul); }
.btn:hover { transform: translateY(-1px); }
@media (min-width: 560px) { .btn { width: auto; } .tarjeta-form .btn { width: 100%; } }
.mini { display: inline-block; padding: .3rem .8rem; border: 1.5px solid var(--tinta); border-radius: 999px; background: transparent; font: 600 .82rem "DM Sans", sans-serif; text-decoration: none; cursor: pointer; color: var(--tinta); }

/* Registrar venta */
.botones-prod { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
.prod { color: var(--tinta); display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .8rem; min-height: 4rem; text-align: left; font: 700 .95rem "DM Sans", sans-serif; border: 2px solid transparent; border-radius: 16px; background: var(--verde); cursor: pointer; color: var(--tinta); }
.prod:nth-child(3n+2) { background: var(--lavanda); } .prod:nth-child(3n) { background: var(--beige); }
.prod small { font-weight: 500; } .prod.on { border-color: var(--tinta); }
@media (min-width: 560px) { .botones-prod { grid-template-columns: repeat(4, 1fr); } }
.total { font-size: 1.2rem; } .total strong { font-size: 1.6rem; }
.etiqueta { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin-bottom: .4rem; }

/* Listas */
.lista { display: grid; gap: .6rem; }
.renglon { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: var(--card); padding: .8rem 1rem; border-radius: 16px; box-shadow: var(--sombra); }
.renglon .suave { display: block; }
.renglon .der { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.renglon form { margin: 0; }
.margen { font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--verde); }
.margen.bajo { background: #fbd5d5; color: #8f0000; }
.margen.bajo::before { content: '↓ '; }

/* Inicio */
.encabezado-pagina { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.encabezado-pagina h1 { margin: 0; }
.mes select { margin: 0; font-weight: 600; background: var(--card); }
.acciones-rapidas { display: grid; gap: .6rem; margin: 1rem 0; }
@media (min-width: 560px) { .acciones-rapidas { grid-template-columns: auto auto 1fr; } }
.grande { border-radius: 30px 30px 30px 10px; padding: 1.3rem; margin: 1.2rem 0; box-shadow: var(--sombra); }
.grande.verde { background: var(--marino); color: #fff; } .grande.verde .etiqueta { color: #cdd6ee; } .grande.verde .cuentas li { border-color: rgba(255,255,255,.3); } .grande.lavanda { background: var(--lavanda); border-radius: 10px 30px 30px 30px; }
.cifra { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 700; letter-spacing: -.03em; margin: 0; }
.cuentas, .reparto, .top { list-style: none; margin: .8rem 0 0; padding: 0; }
.cuentas li, .reparto li, .top li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed rgba(30,36,63,.25); }
.cuentas li:last-child, .reparto li:last-child, .top li:last-child { border-bottom: 0; }
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.dato { background: var(--card); border-radius: 22px; padding: 1rem; box-shadow: var(--sombra); } .dato .cifra { font-size: 1.5rem; }
@media (min-width: 820px) { .rejilla { grid-template-columns: repeat(4, 1fr); } }
.dos { display: grid; gap: .8rem; } @media (min-width: 720px) { .dos { grid-template-columns: 1fr 1fr; } }
.caja { background: var(--card); border-radius: 26px 10px 26px 26px; padding: 1.2rem; box-shadow: var(--sombra); margin-bottom: .8rem; }
.caja.beige { background: var(--beige); margin-top: 1rem; }
.caja h2 { margin-top: 0; font-size: 1.2rem; }
.pie-nota { text-align: center; margin-top: 1.5rem; }

/* Pestañas de costos (como las hojas del Excel) */
.pestanas { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pestanas a { flex: 1 1 14rem; text-decoration: none; font-weight: 700; padding: .7rem 1rem; border-radius: 16px 16px 6px 6px; background: var(--beige); }
.pestanas a small { display: block; font-weight: 400; color: var(--suave); }
.pestanas a.on { background: var(--marino); color: #fff; }
.unit { font-weight: 700; } .unit small { font-weight: 400; color: var(--suave); }
.subform { background: var(--gris); border-radius: 18px; padding: 1rem; margin: 1rem 0; }
.resultado { background: var(--lavanda); border-radius: 10px 26px 26px 26px; padding: 1rem 1.2rem; margin-top: 1rem; }
.resultado .btn { margin-top: .8rem; }
[hidden] { display: none !important; }

.resumen-negocio { background: var(--gris); border-radius: 14px; padding: .7rem 1rem; margin: .8rem 0 .4rem; }
.reparto small { font-weight: 400; }

/* Caja */
.otro-det { background: var(--gris); border-radius: 16px; padding: .7rem 1rem; margin: .8rem 0; }
.otro-det summary { font-weight: 700; cursor: pointer; }
.cuenta { display: grid; gap: .6rem; margin-bottom: 1rem; }
.linea { background: var(--gris); border-radius: 16px; padding: .8rem; }
.linea-t { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.linea-g { display: grid; grid-template-columns: minmax(8.4rem, 1.5fr) 1fr 1fr; gap: .5rem; align-items: end; }
.linea label, .qcol .cap { font-size: .78rem; font-weight: 600; color: var(--suave, #555); display: block; margin: 0 0 .2rem; }
.linea input { background: var(--card); border: 1px solid #d5d5d5; border-radius: 12px; padding: .55rem .5rem; min-width: 0; }
.linea label input { margin-top: .2rem; }
.linea-g input { width: 100%; }
.qty { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem; gap: .25rem; align-items: stretch; }
.qty button { border: 0; border-radius: 12px; background: var(--lavanda); font: 700 1.2rem "DM Sans", sans-serif; cursor: pointer; }
.qty input { text-align: center; }
.linea-total { grid-column: 1 / -1; text-align: right; font-size: 1.1rem; }
.descuento-general { background: var(--lavanda); border-radius: 16px; padding: .8rem 1rem; margin-bottom: 1rem; }
.totales { list-style: none; padding: 0; margin: 0 0 1rem; }
.totales li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed #bbb; }
.totales li.grande { border: 0; font-size: 1.4rem; padding-top: .6rem; }
.totales li.grande strong { font-size: 1.8rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.ticket { border-radius: 14px; background: var(--card); padding: .2rem 0; }
.detalle-cuenta { list-style: none; margin: 0 0 .6rem; padding: 0 1rem; }
.detalle-cuenta li { display: flex; justify-content: space-between; font-size: .92rem; padding: .1rem 0; }

/* Escáner de la caja (cámara) */
#btn-escanear { width: 100%; margin-bottom: .8rem; }
.escaner { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.escaner video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.esc-mira { position: absolute; left: 8%; right: 8%; top: 22%; height: 22%; border: 3px solid var(--verde); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.esc-panel { background: var(--card); padding: .9rem 1rem 1.1rem; display: grid; gap: .6rem; border-radius: 22px 22px 0 0; }
.esc-msg { margin: 0; font-weight: 700; text-align: center; }
.esc-msg.ok { color: #1c6b34; } .esc-msg.mal { color: #a33; }
.esc-manual { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin: 0; }
.esc-manual input { margin: 0; }

/* Etiquetas */
.cant-et { display: grid; gap: .2rem; font-size: .78rem; font-weight: 600; margin: 0; }
.cant-et input { width: 5rem; text-align: center; margin: 0; }
.barra-hoja { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.hoja { display: grid; gap: 0; width: fit-content; background: var(--card); }
.hoja-normal { grid-template-columns: repeat(3, 6.4cm); } .hoja-normal .etiq { height: 3.2cm; }
.hoja-chica { grid-template-columns: repeat(4, 4.8cm); } .hoja-chica .etiq { height: 2.5cm; }
.etiq { box-sizing: border-box; padding: .18cm .25cm; border: 1px dotted #bbb; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #000; background: var(--card); }
.etiq-nombre { font-size: 9pt; font-weight: 700; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.hoja-chica .etiq-nombre { font-size: 7.5pt; }
.etiq-barras { height: 1.15cm; } .hoja-chica .etiq-barras { height: .9cm; }
.etiq-barras svg { display: block; width: 100%; height: 100%; }
.etiq-pie { display: flex; justify-content: space-between; align-items: baseline; font-size: 8pt; }
.etiq-pie strong { font-size: 11pt; }
@media print {
  @page { size: letter; margin: 1cm; }
  .barra, .no-imprimir, .aviso { display: none !important; }
  body { background: var(--card); } .contenido { padding: 0; max-width: none; }
  .etiq { border-color: transparent; }
}

/* Balance arriba de la caja */
.balance-tope { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .2rem 0 1rem; }
.balance-tope > div { background: var(--card); border-radius: 22px; padding: .9rem 1rem; box-shadow: var(--sombra); }
.balance-tope .cifra { font-size: 1.5rem; margin: .1rem 0; }

/* ---- Panel de Efraín: interruptor Negocio | Casa, avisos, avances y gráficas ---- */
.marca { color: #fff; }
.interruptor { display: inline-flex; background: rgba(255,255,255,.14); border-radius: 999px; padding: .2rem; gap: .15rem; }
.interruptor a { text-decoration: none; font-weight: 700; font-size: .92rem; padding: .35rem 1rem; border-radius: 999px; color: #fff; }
.interruptor a.on { background: var(--verde); color: var(--marino); }
.salir { color: #fff; }
.sub-menu { display: flex; gap: .4rem; overflow-x: auto; margin: -.4rem 0 1rem; padding-bottom: .2rem; }
.sub-menu a { white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .9rem; padding: .4rem .9rem; border-radius: 999px; background: var(--card); border: 1.5px solid rgba(27,34,54,.15); }
.sub-menu a.on { background: var(--marino); color: #fff; border-color: var(--marino); }
.alerta { display: block; padding: .75rem 1rem; border-radius: 14px; margin-bottom: .5rem; font-weight: 600; font-size: .95rem; border-left: 6px solid var(--verde); background: var(--beige); }
.alerta.rojo { background: #fbd5d5; border-left-color: var(--rojo); color: #7a0000; }
.alerta.ok { background: #dcf1e2; border-left-color: var(--ok); color: #14502a; }
.avance { height: .8rem; border-radius: 999px; background: #dfe3ee; overflow: hidden; margin: .3rem 0; }
.avance i { display: block; height: 100%; border-radius: 999px; background: var(--azul); }
.avance.cerca i, .avance.ritmo i { background: var(--verde); }
.avance.rebasado i { background: var(--rojo); }
.avance.meta i { background: var(--ok); }
.fila-avance { margin-bottom: .9rem; } .fila-avance .renglon-t { display: flex; justify-content: space-between; gap: .8rem; font-weight: 600; }
.dona { display: grid; gap: .8rem; align-items: center; } .dona svg { width: min(100%, 220px); margin: 0 auto; display: block; }
@media (min-width: 620px) { .dona { grid-template-columns: 220px 1fr; } }
.leyenda { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.leyenda li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; } .leyenda li span { flex: 1; }
.leyenda i { width: .8rem; height: .8rem; border-radius: 4px; flex: none; display: inline-block; }
.leyenda.en-linea { display: flex; gap: 1rem; margin-top: .4rem; }
.caja svg { width: 100%; height: auto; display: block; }
.g-eje { font: 500 9px "DM Sans", sans-serif; fill: var(--suave); } .g-rej { stroke: #e3e6ef; stroke-width: 1; } .g-cero { stroke: var(--marino); stroke-width: 1.5; }
.g-centro-n { font: 700 15px "DM Sans", sans-serif; fill: var(--marino); } .g-centro-t { font: 500 10px "DM Sans", sans-serif; fill: var(--suave); }
.rejilla.tres { grid-template-columns: 1fr; } @media (min-width: 620px) { .rejilla.tres { grid-template-columns: repeat(3, 1fr); } }
.dato.azul { background: var(--marino); color: #fff; } .dato.azul .etiqueta, .dato.azul .suave { color: #cdd6ee; }
.dato .neg { color: var(--rojo); } .cifra.neg { color: var(--rojo); }
.insignia { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--verde); color: var(--marino); vertical-align: middle; }
.insignia.roja { background: #fbd5d5; color: #8f0000; }
.tarjeta-cta { background: var(--marino); color: #fff; border-radius: 22px; padding: 1rem 1.2rem; margin-bottom: .8rem; }
.tarjeta-cta .suave, .tarjeta-cta .etiqueta { color: #cdd6ee; }
.copiable { width: 100%; min-height: 14rem; font: 400 .9rem/1.45 ui-monospace, Menlo, monospace; }
.barra-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; align-items: end; height: 8rem; margin-top: .6rem; }
.barra-dias div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .72rem; color: var(--suave); }
.barra-dias i { display: block; width: 100%; background: var(--azul); border-radius: 6px 6px 0 0; min-height: 2px; }
.nav-semana { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: 1rem; }

/* ---- Estilo "app bancaria" (paleta azul índigo) ---- */
.barra { background: var(--bg); color: var(--tinta); } .barra a, .marca, .salir { color: var(--tinta); }
.interruptor { background: var(--card); } .interruptor a { color: var(--tinta); }
.interruptor a.on { background: linear-gradient(135deg, var(--azul), var(--cielo)); color: #fff; }
.tema { border: 0; background: var(--card); color: var(--tinta); width: 2.4rem; height: 2.4rem; border-radius: 50%; cursor: pointer; font-size: 1.1rem; box-shadow: var(--sombra); }
.menu { border: 0; border-radius: 28px 28px 0 0; box-shadow: 0 -8px 30px rgba(30,36,63,.13); padding: .5rem .6rem calc(.6rem + env(safe-area-inset-bottom)); }
.menu a { color: var(--tinta); } .menu a.on { background: var(--lavanda); color: var(--azul); }
@media (min-width: 820px) { .menu { box-shadow: none; border-radius: 0; } }
.fab { position: fixed; z-index: 11; left: 50%; bottom: 3.7rem; transform: translateX(-50%); width: 3.6rem; height: 3.6rem; border-radius: 50%; border: 4px solid var(--bg); background: linear-gradient(135deg, var(--azul), var(--cielo)); color: #fff; font-size: 2rem; line-height: 1; display: grid; place-items: center; text-decoration: none; box-shadow: 0 10px 22px rgba(64,93,232,.4); padding-bottom: .2rem; }
@media (min-width: 820px) { .fab { display: none; } }
.btn { background: linear-gradient(135deg, var(--azul), var(--cielo)); border-color: transparent; box-shadow: 0 8px 18px rgba(64,93,232,.25); }
.btn.contorno { background: var(--card); color: var(--azul); border-color: var(--lavanda); box-shadow: none; }
.mini { color: var(--tinta); border-color: var(--suave); }
.grande { border-radius: 28px; }
.grande.verde { background: linear-gradient(135deg, #405DE8 0%, #4B78EE 60%, #6AA8F5 100%); color: #fff; position: relative; overflow: hidden; box-shadow: 0 12px 28px rgba(64,93,232,.28); padding: 1.4rem; }
.grande.verde::before, .grande.verde::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.grande.verde::before { width: 5.5rem; height: 5.5rem; right: -1.2rem; top: -1.2rem; } .grande.verde::after { width: 3.4rem; height: 3.4rem; right: 2.6rem; top: .6rem; background: rgba(255,255,255,.1); }
.grande.verde > * { position: relative; z-index: 1; } .grande.verde .cifra { font-size: 2.2rem; }
.caja, .dato, .renglon, .form, .tarjeta-form { border-radius: 26px; } .renglon { border-radius: 22px; }
.caja.beige { background: var(--beige); }
.alerta { color: var(--tinta); border-radius: 18px; } .alerta.rojo { background: #fbd5d5; color: #7a0000; border-left-color: var(--rojo); }
html[data-m=dark] .alerta.rojo { background: #4a2326; color: #ffb4b6; }
.insignia { color: #1E243F; } .insignia.roja { background: #fbd5d5; color: #8f0000; } .margen { background: #dcf1e2; color: #14502a; } .margen.bajo { background: #fbd5d5; color: #8f0000; }
.avance { background: var(--gris); } .avance i { background: var(--azul); } .avance.meta i { background: var(--ok); } .avance.cerca i, .avance.ritmo i { background: var(--verde); } .avance.rebasado i { background: var(--rojo); }
.g-eje, .g-centro-t { fill: var(--suave); } .g-rej { stroke: var(--gris); } .g-centro-n { fill: var(--tinta); }
.sub-menu a { background: var(--card); color: var(--tinta); border-color: var(--lavanda); } .sub-menu a.on { background: var(--azul); color: #fff; border-color: var(--azul); }
.barra-dias i { background: var(--azul); } textarea.copiable { background: var(--gris); color: var(--tinta); }
.acc { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .4rem 0 1rem; }
.acc a { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; font-weight: 600; font-size: .78rem; }
.acc i { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: var(--azul); box-shadow: var(--sombra); } .acc svg { width: 1.5rem; height: 1.5rem; }
.prod { background: var(--card) !important; border: 1.5px solid var(--lavanda); border-radius: 20px; }
.barra { flex-wrap: nowrap; gap: .4rem; padding: .6rem .8rem; } .marca { font-size: .95rem; white-space: nowrap; } .interruptor a { padding: .35rem .8rem; } .salir { font-size: .85rem; }
