:root {
  --fondo: #FAFAFA;
  --hoja: #FFFFFF;
  --tinta: #0A0A0A;
  --tenue: #737373;
  --linea: #E7E7E7;
  --suave: #F5F5F5;
  --accion: #171717;
  --accion-osc: #000000;
  --bien: #059669;
  --mal: #E11D48;
  --fiado: #D97706;
  --radio: 16px;
  /* carta de colores: un color por medio de pago */
  --m-efectivo: #16A34A;
  --m-debito: #2563EB;
  --m-credito: #7C3AED;
  --m-qr: #0D9488;
  --m-naranja: #EA580C;
  --m-go_cuotas: #DB2777;
  --m-mercado_pago: #0EA5E9;
  --m-transferencia_banco: #64748B;
  --m-cta_cte_empresas: #A16207;
  --t-fiado: #D97706;
  --t-cobro: #0F766E;
  --t-egreso: #E11D48;
  --t-interes: #B45309;
  font-family: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  color: var(--tinta);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.cargando { padding: 2rem; color: var(--tenue); }
svg.ic { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- armazón: menú lateral ---------- */
.marco { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; background: var(--hoja); border-right: 1px solid var(--linea); display: flex; flex-direction: column; padding: 16px 8px 12px; }
.marca { display: flex; align-items: center; gap: .7rem; padding: 0 10px 22px; color: inherit; text-decoration: none; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: var(--accion); color: #fff; display: grid; place-items: center; flex: 0 0 42px; }
.logo svg.ic { width: 22px; height: 22px; }
.marca b { display: block; font-size: 1.1rem; font-weight: 800; line-height: 1.1; }
.marca small { color: var(--tenue); font-size: .92rem; }
.nav { display: grid; gap: 4px; }
.nav a, .lateral .pie button { display: flex; align-items: center; gap: .75rem; padding: .6rem .85rem; border-radius: 9px; color: #525252; text-decoration: none; font-size: .98rem; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.nav a:hover, .lateral .pie button:hover { background: var(--suave); color: var(--tinta); }
.nav a[aria-current="page"] { background: var(--accion); color: #fff; }
.lateral .pie { margin-top: auto; display: grid; gap: 4px; }
.cuerpo { min-width: 0; }
.tope-movil { display: none; }
.prueba { background: #FFFBEB; color: #92400E; border-bottom: 1px solid #FDE68A; text-align: center; padding: .5rem 16px; font-size: .92rem; }

@media (max-width: 899px) {
  .marco { display: block; }
  .tope-movil { display: flex; align-items: center; gap: .7rem; padding: 10px 16px; background: var(--hoja); border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 5; }
  .tope-movil .logo { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
  .tope-movil .logo svg.ic { width: 20px; height: 20px; }
  .tope-movil b { font-weight: 800; font-size: 1.1rem; margin-right: auto; }
  .ojo-movil { background: none; border: 1px solid var(--linea); border-radius: 10px; padding: .45rem; cursor: pointer; line-height: 0; color: #404040; }
  .lateral { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 6; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--linea); }
  .lateral .marca, .lateral .pie { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 2px; }
  .nav a { flex-direction: column; gap: .15rem; padding: .45rem .2rem; font-size: .76rem; justify-content: center; text-align: center; }
  .cuerpo { padding-bottom: 84px; }
}

/* ---------- contenido ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 28px 36px; }
@media (max-width: 899px) { main { padding: 18px 16px 24px; } }
.grilla { display: grid; gap: 16px; }
@media (min-width: 1100px) { .grilla { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.hoja { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px; }
@media (max-width: 899px) { .hoja { padding: 16px; } }
.hoja + .hoja { margin-top: 16px; }
.grilla .hoja + .hoja { margin-top: 0; }
.col { display: grid; gap: 16px; align-content: start; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .7rem; }
.tenue { color: var(--tenue); }
.chico { font-size: .9rem; }
.etiqueta { font-size: .85rem; font-weight: 600; color: var(--tenue); letter-spacing: .04em; text-transform: uppercase; margin: 1rem 0 .5rem; }

/* encabezado de página */
.cab { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .8rem 1rem; margin-bottom: 18px; }
.cab h1 { margin: 0; }
.cab .sub { color: var(--tenue); font-size: .98rem; margin-top: .15rem; }
.cab .acciones { margin-left: auto; }
.estado { display: inline-block; font-size: .8rem; font-weight: 700; padding: .2rem .65rem; border-radius: 99px; background: #D1FAE5; color: #047857; vertical-align: middle; margin-left: .4rem; }
.estado.cerrada { background: var(--suave); color: var(--tenue); }

/* ---------- formularios ---------- */
label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .9rem; }
.campo { margin-bottom: .75rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 1px solid var(--linea); border-radius: 9px; background: #fff; min-height: 40px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
input[type=file] { font-size: .95rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accion); outline-offset: 0; border-color: var(--accion); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }
.monto-grande { font-size: 1.65rem; font-weight: 800; padding: .3rem .8rem; min-height: 52px !important; }
.fila { display: flex; gap: .7rem; flex-wrap: wrap; }
.fila > * { flex: 1 1 140px; }
.fila > .angosto { flex: 0 1 120px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .45rem 1.1rem; border-radius: 9px; border: 1px solid var(--accion); background: var(--accion); color: #fff; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accion-osc); }
.btn svg.ic { width: 18px; height: 18px; flex-basis: 18px; }
.btn.sec { background: #fff; color: var(--tinta); border-color: var(--linea); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.btn.sec:hover { background: var(--suave); }
.btn.peligro { background: #fff; color: var(--mal); border-color: #FECDD3; }
.btn.peligro:hover { background: #FFF1F2; }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.botones { display: flex; flex-wrap: wrap; gap: .6rem; }
.link { background: none; border: 0; color: var(--tinta); padding: 0; cursor: pointer; text-decoration: underline; font-weight: 600; }

/* tipo de movimiento: botones como en Historial de Base44 */
.tipos { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.tipos button { background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: .45rem .9rem; cursor: pointer; font-weight: 600; color: var(--tinta); min-height: 40px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tipos button:hover { background: var(--suave); }
.tipos button[aria-pressed="true"] { background: var(--accion); color: #fff; border-color: var(--accion); }

/* medios de pago */
.medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.medio { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--linea); border-radius: 10px; background: #fff; cursor: pointer; padding: .45rem .7rem; text-align: left; min-height: 42px; font-weight: 600; line-height: 1.15; }
.medio:hover { background: var(--suave); }
.medio .muestra { width: 12px; height: 12px; border-radius: 99px; background: var(--c); flex: 0 0 12px; }
.medio[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 1.5px var(--c) inset; background: color-mix(in srgb, var(--c) 7%, #fff); }

/* billetes: lista como en Base44 */
.billetes { border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; }
.billete { display: grid; grid-template-columns: minmax(5.5rem, 1fr) 1rem 96px minmax(6.5rem, 1fr); align-items: center; gap: .8rem; padding: .35rem 1rem; }
.billete + .billete { border-top: 1px solid var(--linea); }
.billete label { margin: 0; font-weight: 500; font-size: .98rem; }
.billete .por { color: var(--tenue); text-align: center; }
.billete input { min-height: 36px; text-align: center; padding: .4rem; width: 96px; }
.billete .sub { text-align: right; color: var(--tenue); font-variant-numeric: tabular-nums; }
.billete .sub.lleno { color: var(--tinta); font-weight: 600; }
.total-conteo { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: .8rem 1.1rem; background: var(--suave); border-radius: 12px; color: #525252; font-size: .98rem; }
.total-conteo strong { font-size: 1.25rem; font-weight: 800; color: var(--tinta); }
@media (max-width: 480px) { .billete { grid-template-columns: minmax(4.5rem, 1fr) 1rem 84px; gap: .6rem; padding: .4rem .8rem; } .billete input { width: 84px; } .billete .sub { display: none; } }

/* ---------- caja vacía ---------- */
.vacia { text-align: center; padding: 38px 20px; }
.vacia .icono { width: 64px; height: 64px; border-radius: 16px; background: var(--suave); display: grid; place-items: center; margin: 0 auto 14px; color: #525252; }
.vacia .icono svg.ic { width: 30px; height: 30px; flex-basis: 30px; }
.vacia h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .4rem; }
.vacia p { color: var(--tenue); font-size: 1rem; margin-bottom: 1.2rem; }

/* ---------- lista de movimientos ---------- */
.movs { list-style: none; margin: 0; padding: 0; }
.mov { display: grid; grid-template-columns: 2.1rem 10px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .45rem .3rem; border-bottom: 1px solid var(--linea); border-radius: 0; }
.mov:last-child { border-bottom: 0; }
.mov .n { color: var(--tenue); font-variant-numeric: tabular-nums; text-align: center; font-size: .85rem; background: var(--suave); border-radius: 8px; padding: .15rem 0; }
.mov .barra-color { width: 10px; height: 10px; border-radius: 99px; background: var(--c); }
.mov .que { min-width: 0; }
.mov .que b { font-weight: 700; }
.mov .que .det { color: var(--tenue); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov .cuanto { text-align: right; font-variant-numeric: tabular-nums; }
.mov .cuanto b { font-size: 1rem; font-weight: 800; }
.mov .cuanto .det { color: var(--tenue); font-size: .85rem; }
.mov button.editar { grid-column: 3 / 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: center; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; width: 100%; min-height: 40px; }
.mov:hover { background: var(--fondo); }
.vacio { color: var(--tenue); padding: 1rem 0; }

/* ---------- resumen ---------- */
.cifra-neta { padding: .2rem 0 1rem; }
.cifra-neta .valor { font-size: 2.1rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.tile { background: var(--fondo); border: 1px solid #F0F0F0; border-radius: 12px; padding: .8rem 1rem; }
.tile .t { color: var(--tenue); font-size: .92rem; }
.tile .v { font-size: 1.22rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla td, .tabla th { padding: .4rem 0; border-bottom: 1px solid #F0F0F0; vertical-align: top; }
.tabla th { text-align: left; font-weight: 500; color: #525252; }
.tabla td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tabla tr.fuerte th, .tabla tr.fuerte td { color: var(--tinta); font-weight: 800; }
.tabla tr:last-child td, .tabla tr:last-child th { border-bottom: 0; }
.punto { display: inline-block; width: .65em; height: .65em; border-radius: 99px; background: var(--c); margin-right: .5em; vertical-align: .02em; }
.pos { color: var(--bien) !important; } .neg { color: var(--mal) !important; } .amb { color: var(--fiado) !important; }

/* ojito: oculta montos sensibles */
body.oculto .plata { color: transparent !important; display: inline-block; position: relative; width: 4.6em; overflow: hidden; vertical-align: bottom; user-select: none; text-align: left; }
body.oculto .plata::after { content: '$ ••••'; position: absolute; left: 0; top: 0; color: #A3A3A3; letter-spacing: .06em; font-weight: 700; white-space: nowrap; }
body.oculto .tabla td .plata, body.oculto .der .plata, body.oculto .total-conteo .plata, body.oculto .billete .plata { text-align: right; }
body.oculto .tabla td .plata::after, body.oculto .der .plata::after, body.oculto .total-conteo .plata::after, body.oculto .billete .plata::after { left: auto; right: 0; }
body.oculto .grafico .eje { visibility: hidden; }

/* ---------- historial ---------- */
.mes-cab { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .4rem; }
.mes-cab h2 { margin: 0; }
.dias { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.dias a { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: .2rem 1rem; padding: 13px 18px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--hoja); color: inherit; text-decoration: none; }
.dias a:hover { border-color: #D4D4D4; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.dias .f { font-weight: 700; font-size: 1.02rem; }
.dias .linea { color: var(--tenue); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin-top: .15rem; }
.dias .der { text-align: right; }
.dias .v { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dias .der .chico { display: block; }
.dias .dif { font-weight: 700; font-size: .92rem; }
.dias svg.ic { color: var(--tenue); width: 20px; height: 20px; }
@media (max-width: 560px) { .dias a { padding: 14px 14px; grid-template-columns: minmax(0, 1fr) auto; } .dias svg.ic { display: none; } }

/* ---------- diálogo y avisos ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog .dl-in { padding: 22px 26px 6px; }
dialog .dl-in > h2:first-child { font-size: 1.3rem; padding-right: 2rem; }
dialog .dl-pie { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; padding: 14px 26px 22px; background: #fff; position: sticky; bottom: 0; }
dialog .dl-pie .izq { margin-right: auto; }
dialog .x { position: absolute; top: 14px; right: 14px; background: none; border: 0; border-radius: 8px; padding: .4rem; cursor: pointer; color: #404040; line-height: 0; }
dialog .x:hover { background: var(--suave); }
@media (max-width: 560px) { dialog .dl-in { padding: 22px 18px 6px; } dialog .dl-pie { padding: 14px 18px 20px; } }
#aviso { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accion); color: #fff; padding: .75rem 1.1rem; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
@media (max-width: 899px) { #aviso { bottom: 96px; } }
#aviso.ver { opacity: 1; }
#aviso.error { background: var(--mal); }
.error-caja { background: #FFF1F2; color: #9F1239; border: 1px solid #FECDD3; border-radius: 12px; padding: .7rem .9rem; margin-bottom: .9rem; }
.nota { background: var(--fondo); border: 1px solid var(--linea); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .9rem; }
.ambar { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: 14px; padding: 1.1rem 1.3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* login */
.login-fondo { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); }
.login .marca { padding: 0 0 22px; }

/* hijos */
.hijo { display: grid; grid-template-columns: 1fr 9rem 2.8rem; gap: .5rem; margin-bottom: .5rem; }
.hijo button { border: 1px solid var(--linea); background: #fff; border-radius: 10px; cursor: pointer; font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* imprimir: solo el resumen del día */
@media print {
  body { background: #fff; }
  .lateral, .tope-movil, .prueba, .no-imprimir, dialog, #aviso { display: none !important; }
  .marco { display: block; }
  main { padding: 0; }
  .grilla { display: block; }
  .hoja { border: 0; padding: 0; }
  body.oculto .plata { color: inherit !important; width: auto; }
  body.oculto .plata::after { content: none; }
}

/* montos siempre en un renglón */
.plata, .tabla td, .tile .v, .dias .v { white-space: nowrap; }
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: .7rem .8rem; }
  .tile .v { font-size: 1.1rem; }
  .cifra-neta .valor { font-size: 2.2rem; }
  .tabla th { padding-right: .6rem; }
}

/* ---------- panel del mes (pestaña Caja) ---------- */
.mes-nav { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.mes-nav h2 { margin: 0; min-width: 10.5rem; text-align: center; }
.mes-nav button { background: none; border: 0; border-radius: 8px; padding: .35rem; cursor: pointer; line-height: 0; color: #404040; }
.mes-nav button:hover { background: var(--suave); }
.mes-nav button:disabled { opacity: .3; cursor: default; }
.mes-nav .izq svg.ic { transform: scaleX(-1); }
.mes-linea { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 14px; }
.mes-linea p { margin: 0; }
.grafico { margin-top: 6px; }
.grafico svg { max-width: 100%; height: auto; display: block; }
.grafico .eje { font-size: 11px; fill: var(--tenue); font-family: inherit; }
.grafico .mesl { font-size: 12px; fill: var(--tenue); font-family: inherit; }
.leyenda { display: flex; justify-content: center; gap: 1.2rem; font-size: .9rem; margin-top: .3rem; }
.leyenda span::before { content: ''; display: inline-block; width: .8em; height: .8em; border-radius: 2px; background: var(--c); margin-right: .4em; vertical-align: -.05em; }

/* ---------- planilla de caja (como Base44) ---------- */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1180px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.stat { background: var(--hoja); border: 1px solid var(--linea); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.stat-t { display: flex; justify-content: space-between; align-items: center; gap: .4rem; color: #525252; font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stat-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 32px; }
.stat-ic svg.ic { width: 17px; height: 17px; flex-basis: 17px; }
.stat-ic.gris { background: var(--suave); color: #525252; }
.stat-ic.verde { background: #D1FAE5; color: #059669; }
.stat-ic.rojo { background: #FFE4E6; color: #E11D48; }
.stat-ic.amarillo { background: #FEF3C7; color: #D97706; }
.stat-v { font-size: 1.3rem; font-weight: 800; margin-top: .55rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.efectivo { background: #171717; color: #fff; border-radius: var(--radio); padding: 18px 22px; margin-bottom: 16px; }
.ef-arr { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.16); font-size: 1.02rem; }
.ef-arr strong { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ef-aba { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; padding-top: 12px; font-size: .92rem; color: #E5E5E5; }
.ef-aba b { color: #fff; }
.efectivo .neg-claro { color: #FDA4AF; } .efectivo .pos-claro { color: #6EE7B7; }
body.oculto .efectivo .plata::after { color: #737373; }
.acciones-mov { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .acciones-mov { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.am { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 54px; border-radius: 10px; font-weight: 700; font-size: 1.05rem; cursor: pointer; background: #fff; border: 1px solid; }
.am.venta { background: #059669; border-color: #059669; color: #fff; }
.am.venta:hover { background: #047857; }
.am.gasto { color: #E11D48; border-color: #FECDD3; }
.am.fiado { color: #D97706; border-color: #FDE68A; }
.am.cobro { color: #0F766E; border-color: #99F6E4; }
.am.gasto:hover { background: #FFF1F2; } .am.fiado:hover { background: #FFFBEB; } .am.cobro:hover { background: #F0FDFA; }
.fila-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.link-ic { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; cursor: pointer; font-weight: 600; padding: .3rem .5rem; border-radius: 8px; }
.link-ic:hover { background: var(--suave); }
.link-ic svg.ic { width: 17px; height: 17px; flex-basis: 17px; }
.btn.peligro svg.ic { color: var(--mal); }
.solo-imprimir { display: none; }

/* ventana de registrar movimiento */
.tipos-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: .4rem 0 1.1rem; }
.tg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 78px; border: 2px solid var(--linea); border-radius: 12px; background: #fff; cursor: pointer; color: #525252; font-weight: 600; font-size: .92rem; line-height: 1.15; text-align: center; padding: .4rem; }
.tg svg.ic { width: 24px; height: 24px; flex-basis: 24px; }
.tg:hover { background: var(--fondo); }
.tg[aria-pressed="true"].venta { border-color: #10B981; background: #ECFDF5; color: #047857; }
.tg[aria-pressed="true"].egreso { border-color: #FB7185; background: #FFF1F2; color: #BE123C; }
.tg[aria-pressed="true"].fiado { border-color: #FBBF24; background: #FFFBEB; color: #B45309; }
.tg[aria-pressed="true"].cobro { border-color: #2DD4BF; background: #F0FDFA; color: #0F766E; }
@media (max-width: 480px) { .tg { min-height: 66px; font-size: .82rem; } }
.medio-cab { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .5rem; flex-wrap: wrap; }
.medio-cab .com { display: flex; align-items: center; gap: .5rem; }
.pct { display: flex; align-items: center; border: 1px solid var(--linea); border-radius: 9px; padding-right: .6rem; background: #fff; }
.pct input { border: 0 !important; box-shadow: none !important; width: 4.5rem !important; text-align: right; min-height: 36px !important; padding: .3rem .4rem !important; }
.pct span { color: var(--tenue); font-weight: 600; }
.medios-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .medios-g { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mg { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; border: 1px solid var(--linea); border-radius: 10px; background: #fff; cursor: pointer; padding: .35rem .4rem; line-height: 1.2; text-align: center; font-weight: 500; }
.mg small { color: var(--tenue); font-size: .78rem; }
.mg:hover { background: var(--fondo); }
.mg[aria-pressed="true"] { background: #171717; border-color: #171717; color: #fff; font-weight: 700; }
.mg[aria-pressed="true"] small { color: #D4D4D4; }
.btn.guardar.venta { background: #059669; border-color: #059669; }
.btn.guardar.venta:hover { background: #047857; }
.btn.guardar.egreso { background: #E11D48; border-color: #E11D48; }
.btn.guardar.fiado { background: #D97706; border-color: #D97706; }
.btn.guardar.cobro { background: #0F766E; border-color: #0F766E; }

@media print {
  main > *:not(#imprimible) { display: none !important; }
  #imprimible { display: block !important; }
}

/* ---------- cuentas ---------- */
.buscador { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: 0 .8rem; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.buscador svg.ic { color: var(--tenue); }
.buscador input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; outline: none; }
.orden { display: flex; align-items: center; gap: .6rem; margin-bottom: 14px; }
.orden label { margin: 0; font-weight: 500; color: var(--tenue); white-space: nowrap; }
.orden select { width: auto; min-width: 14rem; }
.clientes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.clientes button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: .95rem 1.2rem; cursor: pointer; font-size: 1.02rem; font-weight: 600; text-align: left; }
.clientes button:hover { border-color: #D4D4D4; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.clientes button .plata { font-weight: 800; }
.cli-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-right: 2rem; flex-wrap: wrap; }
.cli-cab h2 { margin: 0; }
.cli-cab .plata { font-size: 1.2rem; font-weight: 800; }
.cli-acc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.cli-acc .am { min-height: 44px; font-size: .95rem; }
@media (max-width: 480px) { .cli-acc { grid-template-columns: 1fr; } }
.historial-cli { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.hist { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; background: var(--fondo); border-radius: 10px; padding: .6rem .8rem; }
.hist b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist small { color: var(--tenue); }
.hist > .plata { font-weight: 800; }
.tacho { background: none; border: 0; cursor: pointer; color: var(--tenue); border-radius: 8px; padding: .35rem; line-height: 0; }
.tacho:hover { background: #FFE4E6; color: var(--mal); }
.tacho svg.ic { width: 17px; height: 17px; flex-basis: 17px; }
.acciones-mov { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .acciones-mov { grid-template-columns: repeat(3, minmax(0, 1fr)); } .am { font-size: .95rem; min-height: 50px; } }
.tipos-g { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- CTA CTE empresas ---------- */
.empresas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.empresas button { width: 100%; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto 18px; align-items: center; gap: .9rem; background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: .85rem 1.1rem; cursor: pointer; text-align: left; }
.empresas button:hover { border-color: #D4D4D4; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.pos-n { width: 2rem; height: 2rem; border-radius: 9px; background: var(--suave); display: grid; place-items: center; font-weight: 800; color: #525252; }
.empresas li:first-child .pos-n { background: #171717; color: #fff; }
.emp-info { display: grid; gap: .15rem; min-width: 0; }
.emp-info b { font-size: 1.02rem; }
.barra-emp { display: block; height: 6px; border-radius: 99px; background: var(--suave); overflow: hidden; margin-top: .25rem; }
.barra-emp span { display: block; height: 100%; background: var(--m-cta_cte_empresas); border-radius: 99px; }
.emp-tot { text-align: right; display: grid; }
.emp-tot b { font-size: 1.1rem; font-weight: 800; }
.empresas svg.ic { color: var(--tenue); width: 18px; height: 18px; }
@media (max-width: 560px) { .empresas button { grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: .6rem; padding: .75rem .8rem; } .empresas svg.ic { display: none; } }
.sin-emp { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sin-emp li { display: grid; grid-template-columns: minmax(0, 1fr) auto 13rem; align-items: center; gap: .8rem; background: var(--fondo); border-radius: 10px; padding: .45rem .7rem; }
.sin-emp select { min-height: 36px; }
@media (max-width: 560px) { .sin-emp li { grid-template-columns: minmax(0, 1fr) auto; } .sin-emp select { grid-column: 1 / -1; } }
@media (max-width: 899px) { .nav a { font-size: .7rem; } }

/* factura adjunta */
.fac { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.clip { width: 46px; border: 1px solid var(--linea); background: #fff; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: #262626; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.clip:hover { background: var(--suave); }
.clip.lleno { background: #171717; border-color: #171717; color: #fff; }
.fac-info { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-top: .35rem; min-height: 0; }
.fac-info:empty { display: none; }
.fac-info svg.ic { width: 16px; height: 16px; flex-basis: 16px; color: var(--tenue); }
.fac-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-b { display: flex; gap: 2px; }

/* ---------- métricas ---------- */
.met-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1rem; margin-bottom: .6rem; }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles-3 { grid-template-columns: 1fr 1fr; } }
.delta { font-weight: 700; font-size: .85rem; }
.met-2 { margin: 16px 0; }
@media (min-width: 1100px) { .met-2 { grid-template-columns: 1fr 1fr; } }
.reparto { display: grid; gap: .55rem; }
.rep-f { display: grid; grid-template-columns: minmax(10.5rem, 1.3fr) minmax(0, 2fr) auto; align-items: center; gap: .8rem; }
.rep-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-b { height: 10px; background: var(--suave); border-radius: 99px; overflow: hidden; }
.rep-b span { display: block; height: 100%; border-radius: 99px; }
.rep-v { display: grid; text-align: right; line-height: 1.15; }
@media (max-width: 560px) { .rep-f { grid-template-columns: minmax(0, 1fr) auto; } .rep-b { grid-column: 1 / -1; grid-row: 2; } }
.tabla-scroll { overflow-x: auto; margin-top: .6rem; }
.tabla-meses { min-width: 760px; }
.tabla-meses thead td, .tabla-meses thead th { color: var(--tenue); font-weight: 600; font-size: .85rem; }
.tabla-meses td { padding-left: .8rem; }
.tabla-meses th a { color: inherit; }
@media (max-width: 899px) { .lateral { overflow-x: auto; } .nav { grid-auto-columns: minmax(62px, 1fr); } }

/* período de métricas */
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.presets button { background: #fff; border: 1px solid var(--linea); border-radius: 9px; padding: .45rem .95rem; min-height: 38px; cursor: pointer; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.presets button:hover { background: var(--suave); }
.presets button[aria-pressed="true"] { background: var(--accion); border-color: var(--accion); color: #fff; }
.rango { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem 1rem; }
.rango .campo { margin: 0; width: 13rem; }
.rango-n { display: inline-flex; align-items: center; gap: .4rem; color: var(--tenue); padding-bottom: .55rem; }
@media (max-width: 480px) { .rango .campo { width: calc(50% - .5rem); } }
/* detalle del gráfico */
.grafico { position: relative; }
.grafico [data-hit] { cursor: pointer; }
.tip { position: absolute; z-index: 3; background: #fff; border: 1px solid #D4D4D4; box-shadow: 0 6px 18px rgba(0,0,0,.12); border-radius: 6px; padding: .6rem .8rem; font-size: .95rem; line-height: 1.6; pointer-events: none; white-space: nowrap; }
.tip b { display: block; font-weight: 600; margin-bottom: .1rem; }

/* ---------- precios ---------- */
.calc-g { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .7fr) minmax(0, .7fr); gap: 0 .8rem; }
@media (max-width: 760px) { .calc-g { grid-template-columns: 1fr 1fr; } .calc-g .prod { grid-column: 1 / -1; } .calc-g .campo:nth-child(2) { grid-column: 1 / -1; } }
.calc-g input.num { font-size: 1.1rem; font-weight: 700; }
.calc-r { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: .4rem; }
.calc-r > div { background: var(--fondo); border: 1px solid #F0F0F0; border-radius: 12px; padding: .75rem 1rem; display: grid; gap: .15rem; }
.calc-r b { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-r .tot { background: #171717; border-color: #171717; color: #fff; }
.calc-r .tot b { font-size: 1.55rem; }
body.oculto .calc-r .tot .plata::after { color: #737373; }
@media (max-width: 760px) { .calc-r { grid-template-columns: 1fr 1fr; } }
.lista-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tabla-precios { min-width: 720px; }
.tabla-precios thead td, .tabla-precios thead th { color: var(--tenue); font-weight: 600; font-size: .85rem; }
.tabla-precios td { padding-left: .8rem; }
.tabla-precios tbody tr { cursor: pointer; }
.tabla-precios tbody tr:hover { background: var(--fondo); }
.tabla-precios tbody tr.sel { background: #F0FDF4; }
.tabla-precios th { font-weight: 600; color: var(--tinta); }
@media (max-width: 640px) {
  .tabla-precios { min-width: 0; }
  .tabla-precios thead { display: none; }
  .tabla-precios tbody tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .2rem .6rem; padding: .7rem .2rem; border-bottom: 1px solid #F0F0F0; position: relative; }
  .tabla-precios tbody th { grid-column: 1 / 3; border: 0; padding: 0 2rem 0 0; }
  .tabla-precios tbody td { border: 0; padding: 0; text-align: left; font-size: .9rem; }
  .tabla-precios tbody td[data-l]::before { content: attr(data-l); display: block; color: var(--tenue); font-size: .75rem; font-weight: 500; }
  .tabla-precios tbody td.tot-pr { grid-column: 3; grid-row: 1; text-align: right; font-size: 1.05rem; }
  .tabla-precios tbody td.tot-pr::before { display: none; }
  .tabla-precios tbody td.act-pr { display: none; }
  .tabla-precios tbody td:last-child { position: absolute; right: 0; bottom: .5rem; }
}
