@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --fondo: #f4f6fb;
  --superficie: #ffffff;
  --superficie-2: #f8fafd;
  --texto: #101828;
  --tenue: #5f6b7e;
  --borde: #e3e8f0;
  --marca: #0b66e4;
  --marca-fuerte: #0850b6;
  --marca-suave: #e8f1fe;
  --marca-texto: #ffffff;
  --pos: #0b8a4d;
  --neg: #d3203f;
  --aviso-ok: #e4f6ec;
  --aviso-ok-texto: #0a6b3c;
  --aviso-error: #fdebee;
  --aviso-error-texto: #ab1731;
  --azul: #0b66e4;
  --verde: #0b9a55;
  --rojo: #dd2547;
  --magenta: #cf1b86;
  --ambar: #c77700;
  --violeta: #6d3fe0;
  --serie-1: #0b66e4;
  --serie-2: #cf1b86;
  --serie-3: #6d3fe0;
  --serie-4: #c77700;
  --sombra: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .05);
  --sombra-alta: 0 12px 28px -12px rgb(11 102 228 / .45);
  --radio: 14px;
  --ancho-lateral: 256px;
  --lateral: #000000;
  --lateral-fin: #0a1426;
  --lateral-texto: #aeb9cc;
  --lateral-hover: rgb(255 255 255 / .07);
  --lateral-activo: rgb(43 127 255 / .2);
  --lateral-borde: rgb(255 255 255 / .1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0b0f17;
    --superficie: #141a25;
    --superficie-2: #19212e;
    --texto: #e8ecf4;
    --tenue: #9aa6b9;
    --borde: #273141;
    --marca: #4c9bff;
    --marca-fuerte: #76b2ff;
    --marca-suave: #17294a;
    --marca-texto: #06101f;
    --pos: #3ed08f;
    --neg: #ff7188;
    --aviso-ok: #12321f;
    --aviso-ok-texto: #7fe3b0;
    --aviso-error: #421a22;
    --aviso-error-texto: #ffb0bd;
    --azul: #4c9bff;
    --verde: #3ed08f;
    --rojo: #ff7188;
    --magenta: #f268b8;
    --ambar: #f1b24a;
    --violeta: #a78bfa;
    --serie-1: #3d8bf2;
    --serie-2: #e34fa3;
    --serie-3: #8f6ff2;
    --serie-4: #bf8216;
    --sombra: 0 1px 2px rgb(0 0 0 / .4);
    --sombra-alta: 0 12px 28px -14px rgb(76 155 255 / .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 .9375rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
}
.menu-abierto { overflow: hidden; }

a { color: var(--marca); text-underline-offset: 2px; }
h1 { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.022em; overflow-wrap: anywhere; }
h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .7rem; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
h2 .icono { width: 18px; height: 18px; color: var(--tenue); }
small { display: block; font-size: .8rem; font-weight: 400; }
p { margin: .4rem 0; }

.icono {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Menú lateral ----------------------------------------------------- */

.lateral {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--ancho-lateral);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .9rem .9rem .8rem;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--lateral) 0, var(--lateral) 240px, var(--lateral-fin) 100%);
  color: var(--lateral-texto);
}
.lateral a { color: inherit; text-decoration: none; }
.marca img { display: block; width: 100%; max-width: 212px; height: auto; margin: 0 auto; }

.nuevo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f83ff, #0b57d0);
  box-shadow: 0 8px 20px -10px rgb(31 131 255 / .9);
  color: #fff !important;
  font-weight: 600;
  transition: filter .15s;
}
.nuevo:hover { filter: brightness(1.1); }

.menu { display: grid; gap: .15rem; }
.menu-titulo {
  margin: .7rem 0 .25rem;
  padding: 0 .75rem;
  color: #71809a;
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.menu-titulo:first-child { margin-top: 0; }
.menu a, .pie-lateral > a, .pie-lateral > button {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .55rem .75rem;
  border: 0;
  border-radius: 9px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.menu .icono { width: 19px; height: 19px; }
.menu a:hover, .pie-lateral > a:hover, .pie-lateral > button:hover { background: var(--lateral-hover); color: #fff; }
.menu a[aria-current] { background: var(--lateral-activo); color: #fff; font-weight: 600; }
.menu a[aria-current]::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px -9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #3b92ff;
}
.menu a[aria-current] .icono { color: #6db0ff; }

.pie-lateral { margin-top: auto; display: grid; gap: .25rem; font-size: .875rem; }
.cuenta {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .35rem;
  padding: .7rem .35rem 0;
  border-top: 1px solid var(--lateral-borde);
}
.inicial {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18b368, #0b66e4);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.nombre { flex: 1; min-width: 0; overflow: hidden; color: #e4e9f2; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.cuenta form { display: flex; }
.cuenta button { display: flex; padding: .4rem; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; }
.cuenta button:hover { background: var(--lateral-hover); color: #fff; }
.lateral :is(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.contenido { margin-left: var(--ancho-lateral); }
.barra-movil, .fondo-menu { display: none; }

main { max-width: 1180px; margin: 0 auto; padding: 1.75rem; display: grid; gap: 1.1rem; }
main > * { min-width: 0; }

/* --- Base ------------------------------------------------------------- */

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.15rem;
  min-width: 0;
}
.angosta { width: 100%; max-width: 400px; margin: 3rem auto 0; }
.media { width: 100%; max-width: 720px; margin: 0 auto; }

.encabezado { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.pila { display: grid; gap: 1.1rem; }
.flexible { flex: 1 1 12rem; }

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 40px;
  padding: .45rem .9rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
  box-shadow: var(--sombra);
  color: var(--texto);
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, border-color .12s, filter .12s, transform .05s;
}
.boton:hover { background: var(--superficie-2); border-color: color-mix(in srgb, var(--marca) 35%, var(--borde)); }
.boton:active { transform: translateY(1px); }
.primario { background: var(--marca); border-color: var(--marca); box-shadow: var(--sombra-alta); color: var(--marca-texto); font-weight: 600; }
.primario:hover { background: var(--marca-fuerte); border-color: var(--marca-fuerte); }
.peligro { border-color: color-mix(in srgb, var(--neg) 45%, var(--borde)); color: var(--neg); }
.peligro:hover { background: var(--aviso-error); border-color: var(--neg); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.tenue { color: var(--tenue); }
.razon { color: var(--neg); }
.vacio { display: block; padding: 1rem; color: var(--tenue); text-align: center; }
td.vacio { display: table-cell; padding: 1.5rem; }

.aviso { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .7rem .9rem; border-radius: 11px; font-weight: 500; }
.aviso .icono { margin-top: .12rem; }
.aviso.ok { background: var(--aviso-ok); color: var(--aviso-ok-texto); }
.aviso.error { background: var(--aviso-error); color: var(--aviso-error-texto); }

/* --- Etiquetas de estado ---------------------------------------------- */

.etiqueta {
  --tono: var(--tenue);
  display: inline-block;
  padding: .12rem .6rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tono) 13%, transparent);
  color: var(--tono);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.etiqueta.alerta { --tono: var(--neg); font-size: .85rem; vertical-align: middle; }
.etiqueta.pagada, .estado-listo { --tono: var(--verde); }
.estado-recibido { --tono: var(--ambar); }
.estado-diseno { --tono: var(--magenta); }
.estado-impresion { --tono: var(--azul); }
.estado-entregado { --tono: var(--tenue); }

/* --- Inicio y tarjetas de indicadores ---------------------------------- */

.hero-caja {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.75rem;
  overflow: hidden;
  padding: 1.35rem 1.5rem;
  border-radius: 18px;
  background:
    radial-gradient(420px 220px at 92% 0, rgb(207 27 134 / .32), transparent 70%),
    radial-gradient(520px 260px at 62% 120%, rgb(11 154 85 / .3), transparent 70%),
    linear-gradient(120deg, #050a14 10%, #0a3f94 95%);
  box-shadow: 0 18px 36px -22px rgb(11 87 208 / .8);
  color: #fff;
  text-decoration: none;
  transition: transform .15s;
}
.hero-caja:hover { transform: translateY(-1px); }
.hero-caja span { display: flex; align-items: center; gap: .4rem; color: #c6d6ee; font-size: .84rem; font-weight: 500; }
.hero-caja strong { display: block; margin-top: .1rem; font-size: 2.1rem; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.hero-caja b { display: block; margin-top: .1rem; font-size: 1.15rem; font-weight: 650; }
.hero-cuentas { display: flex; flex-wrap: wrap; gap: .75rem 2.25rem; padding-left: 2.25rem; border-left: 1px solid rgb(255 255 255 / .18); }
.hero-ir { margin-left: auto; display: grid !important; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgb(255 255 255 / .13); color: #fff !important; }

.indicadores { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.indicadores.seis { grid-template-columns: repeat(3, 1fr); }
.indicadores .tarjeta > span { color: var(--tenue); font-size: .84rem; font-weight: 500; }
.indicadores strong { display: block; margin-top: .15rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi { position: relative; padding-right: 3.9rem; }
.kpi-icono {
  --tono: var(--azul);
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tono) 13%, transparent);
  color: var(--tono);
}
.kpi-icono .icono { width: 20px; height: 20px; }
.kpi-icono.verde { --tono: var(--verde); }
.kpi-icono.rojo { --tono: var(--rojo); }
.kpi-icono.magenta { --tono: var(--magenta); }
.kpi-icono.ambar { --tono: var(--ambar); }
.kpi-icono.violeta { --tono: var(--violeta); }
.tarjeta.destacada { background: linear-gradient(125deg, #050a14, #0a3f94); border-color: transparent; color: #fff; }
.tarjeta.destacada > span { color: #c6d6ee !important; }
.tarjeta.destacada .kpi-icono { --tono: #ffffff; }

.columnas { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem 1rem; padding: .45rem 0; border-top: 1px solid var(--borde); }
.lista li:first-child { border-top: 0; }
.lista li > * { max-width: 100%; overflow-wrap: break-word; }
.lista b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.lista a { text-decoration: none; font-weight: 500; }
.lista a:hover { text-decoration: underline; }

/* --- Gráficas ---------------------------------------------------------- */

.graficas { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.graficas .tarjeta { display: flex; flex-direction: column; }
.graficas h2 { margin-bottom: .1rem; }
.grafica-sub { margin: 0 0 .7rem; color: var(--tenue); font-size: .84rem; }
.grafica { position: relative; flex: 1; min-width: 0; }
.grafica-zona { position: relative; }
.grafica-zona svg { display: block; overflow: visible; }
.grafica-leyenda { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .45rem; color: var(--tenue); font-size: .8rem; font-weight: 500; }
.grafica-leyenda span { display: inline-flex; align-items: center; gap: .4rem; }
.clave { width: 10px; height: 10px; border-radius: 3px; background: var(--tono-serie); }
.serie-1 { --tono-serie: var(--serie-1); fill: var(--serie-1); }
.serie-2 { --tono-serie: var(--serie-2); fill: var(--serie-2); }
.serie-3 { --tono-serie: var(--serie-3); fill: var(--serie-3); }
.serie-4 { --tono-serie: var(--serie-4); fill: var(--serie-4); }

.rejilla { stroke: var(--borde); stroke-width: 1; shape-rendering: crispEdges; }
.base { stroke: color-mix(in srgb, var(--tenue) 55%, var(--borde)); stroke-width: 1; shape-rendering: crispEdges; }
.eje { fill: var(--tenue); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.etiqueta-dato { fill: var(--texto); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.banda { fill: transparent; }
.banda.activa { fill: color-mix(in srgb, var(--tenue) 11%, transparent); }
.objetivo { fill: transparent; outline: none; cursor: crosshair; }
.objetivo:focus-visible { stroke: var(--marca); stroke-width: 2; }
.area { fill-opacity: .11; }
.trazo { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trazo-1 { stroke: var(--serie-1); }
.guia { stroke: color-mix(in srgb, var(--tenue) 55%, var(--borde)); stroke-width: 1; shape-rendering: crispEdges; }
.punto-grafica { stroke: var(--superficie); stroke-width: 2; }

.grafica-tip {
  position: absolute;
  z-index: 5;
  min-width: 130px;
  padding: .5rem .65rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
  box-shadow: 0 10px 24px -8px rgb(16 24 40 / .28);
  font-size: .8rem;
  pointer-events: none;
}
.tip-titulo { margin-bottom: .25rem; color: var(--tenue); font-weight: 500; }
.tip-fila { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.tip-fila strong { font-variant-numeric: tabular-nums; }
.tip-fila span { color: var(--tenue); }
.tip-clave { width: 12px; height: 2px; border-radius: 2px; background: var(--tono-serie); }

.barras { display: grid; gap: .8rem; }
.barra-texto { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; }
.barra-texto span { min-width: 0; overflow-wrap: anywhere; }
.barra-texto b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.barra-pista { height: 10px; margin: .25rem 0 .15rem; border-radius: 4px; background: color-mix(in srgb, var(--borde) 55%, transparent); }
.barra-valor { height: 100%; border-radius: 4px; background: var(--tono-serie); }

.grafica-vacia { flex: 1; display: grid; place-content: center; justify-items: center; gap: .5rem; min-height: 190px; padding: 1rem; color: var(--tenue); font-size: .875rem; text-align: center; }
.grafica-vacia .icono { width: 30px; height: 30px; opacity: .55; }
.grafica-datos { margin-top: .4rem; }
.grafica-datos summary { color: var(--tenue); font-size: .8rem; font-weight: 500; }
.grafica-datos summary .icono { width: 15px; height: 15px; }

/* --- Tablas ------------------------------------------------------------ */

.tabla-scroll { overflow-x: auto; container-type: inline-size; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--borde);
  color: var(--tenue);
  font-size: .73rem;
  font-weight: 650;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
}
th.num { text-align: right; }
td { padding: .65rem; border-bottom: 1px solid var(--borde); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
@media (hover: hover) { tbody tr:hover { background: var(--superficie-2); } }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sin-corte { white-space: nowrap; }
.acciones-fila a { margin-left: .6rem; font-size: .875rem; }
.anulado td { opacity: .55; }
.anulado td:nth-child(-n+2), .anulado .num { text-decoration: line-through; }

summary { list-style: none; display: flex; align-items: center; gap: .35rem; width: max-content; max-width: 100%; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
details[open] > summary .girar { transform: rotate(180deg); }
.girar { transition: transform .15s; }
.anular summary { color: var(--tenue); font-size: .875rem; }
.anular summary:hover { color: var(--neg); }
.anular form { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.anular input { flex: 1 1 8rem; width: 8rem; }
.zona-anular summary { color: var(--neg); font-weight: 550; }
.zona-anular form { margin-top: .5rem; }

/* --- Formularios -------------------------------------------------------- */

input, select {
  width: 100%;
  min-height: 40px;
  padding: .45rem .7rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: color-mix(in srgb, var(--tenue) 75%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--marca); }
input:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--marca);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marca) 22%, transparent);
}
:is(.boton, a, summary):focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; border-radius: 6px; }

.formulario { display: grid; gap: .9rem; margin-top: .8rem; }
.formulario label { display: grid; gap: .3rem; align-content: start; min-width: 0; font-size: .875rem; font-weight: 600; }
.formulario.dos { grid-template-columns: 1fr 1fr; }
.formulario .ancho { grid-column: 1 / -1; }
.formulario label.check { display: flex; align-items: center; gap: .55rem; padding: 0; }
.tarjeta.formulario { margin-top: 0; }

.fila-form { display: flex; flex-wrap: wrap; gap: .55rem; align-items: end; }
.fila-form input[type="month"] { width: auto; }
.fila-form label { display: grid; gap: .25rem; }
.fila-form label.check { display: flex; gap: .5rem; }
.filtros label { color: var(--tenue); font-size: .82rem; font-weight: 500; }
.filtros input[type="search"] { min-width: 15rem; }
.check { display: flex; gap: .4rem; align-items: center; padding-bottom: .55rem; }

.campo-fecha { position: relative; display: block; min-width: 9.5rem; }
.campo-fecha input[data-fecha] { padding-right: 2.6rem; }
.campo-fecha input[type="date"] { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.campo-fecha button { position: absolute; top: 50%; right: .3rem; display: flex; padding: .35rem; border: 0; border-radius: 8px; background: none; color: var(--tenue); cursor: pointer; transform: translateY(-50%); }
.campo-fecha button:hover { color: var(--marca); }

.pie-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--borde);
}
.paginas { display: flex; justify-content: center; gap: 1rem; padding-top: .8rem; }

/* --- Venta -------------------------------------------------------------- */

.linea {
  display: grid;
  grid-template-columns: minmax(170px, 2fr) minmax(130px, 2fr) 90px 110px 90px auto;
  gap: .6rem;
  align-items: start;
  padding: .7rem 0;
  border-bottom: 1px solid var(--borde);
}
.linea label { display: grid; gap: .3rem; min-width: 0; font-size: .82rem; font-weight: 600; }
.subtotal { display: grid; gap: .6rem; font-size: .82rem; font-variant-numeric: tabular-nums; text-align: right; }
.subtotal b { font-size: 1rem; }
.quitar-linea { margin-top: 1.55rem; padding-inline: .6rem; }
#agregar-linea { margin-top: .85rem; }
.total-venta { display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem; margin: .5rem 0 0; }
.total-venta strong { color: var(--marca); font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* --- Pedidos ------------------------------------------------------------ */

.tablero { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); align-items: start; }
.columna { display: grid; gap: .55rem; padding: .7rem; border-radius: var(--radio); background: color-mix(in srgb, var(--borde) 45%, transparent); }
.columna h2 { margin: 0; padding: .1rem .2rem; font-size: .9rem; }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--tono); }
.contador { margin-left: auto; padding: 0 .5rem; border-radius: 99px; background: var(--superficie); color: var(--tenue); font-size: .78rem; font-weight: 600; }
.pedido { display: grid; gap: .2rem; padding: .8rem; }
.pedido > * { min-width: 0; overflow-wrap: anywhere; }
.pedido a { color: var(--texto); font-weight: 550; text-decoration: none; }
.pedido a:hover { color: var(--marca); }
.pedido button { width: 100%; margin-top: .45rem; font-size: .84rem; }
.columna .vacio { margin: 0; padding: .6rem; font-size: .875rem; }

.agregar-consumo { margin-top: .9rem; }
.agregar-consumo label { flex: 1 1 10rem; font-size: .82rem; font-weight: 600; }
.acciones-consumo { display: flex; align-items: center; gap: .6rem; }
.acciones-consumo .boton { min-height: 32px; padding: .15rem .55rem; font-size: .82rem; }

/* --- Comprobante -------------------------------------------------------- */

.recibo { width: 100%; max-width: 720px; margin: 0 auto; container-type: inline-size; }
.recibo header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.recibo header img { width: 130px; height: auto; border-radius: 10px; background: #000; padding: .3rem; }
.recibo header p { margin: .2rem 0 0; text-align: right; }
.recibo header h1 { font-size: 1.15rem; text-align: right; }
.totales { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1.5rem; width: min(15rem, 100%); margin: 1rem 0 0 auto; font-variant-numeric: tabular-nums; }
.totales dd { margin: 0; text-align: right; }
.legal { margin: 1.5rem 0 0; font-size: .82rem; text-align: center; }

/* --- Acceso y sin conexión ---------------------------------------------- */

.pagina-acceso main { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; max-width: none; min-height: 100vh; min-height: 100dvh; padding: 0; }
.acceso-marca {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.25rem;
  padding: 2rem;
  background:
    radial-gradient(520px 340px at 10% 100%, rgb(11 154 85 / .28), transparent 70%),
    radial-gradient(520px 340px at 100% 0, rgb(207 27 134 / .25), transparent 70%),
    radial-gradient(620px 420px at 50% 55%, rgb(11 102 228 / .3), transparent 70%),
    #000;
  color: #dbe5f5;
  text-align: center;
}
.acceso-marca img { display: block; width: min(440px, 80%); height: auto; margin-inline: auto; mix-blend-mode: screen; }
.acceso-marca p { max-width: 26rem; margin: 0; color: #a9b8d1; }
.acceso-panel { display: grid; place-content: center; padding: 2rem 1.25rem; }
.acceso-caja { width: min(380px, 88vw); display: grid; gap: .9rem; }
.acceso-caja .formulario { margin-top: .2rem; }
.acceso-caja .primario { width: 100%; }

.sin-conexion { display: grid; place-content: center; justify-items: center; gap: .75rem; min-height: 100vh; padding: 2rem; text-align: center; }
.sin-conexion img { width: 200px; height: auto; border-radius: 16px; background: #000; padding: .5rem; }
.sin-conexion .icono { width: 34px; height: 34px; color: var(--tenue); }
.sin-conexion .boton .icono { width: 18px; height: 18px; color: inherit; }

/* --- Pantallas ---------------------------------------------------------- */

@media (min-width: 1700px) {
  main { max-width: 1420px; }
}

@media (max-width: 1040px) {
  .graficas { grid-template-columns: minmax(0, 1fr); }
  .linea { grid-template-columns: 1fr 1fr 1fr auto; }
  .linea label:nth-of-type(1), .linea label:nth-of-type(2) { grid-column: 1 / -1; }
  .quitar-linea { grid-column: 4; grid-row: 3; }
  .subtotal { grid-column: 3; grid-row: 3; }
  .hero-cuentas { padding-left: 0; border-left: 0; }
}

@media (max-width: 860px) {
  .contenido { margin-left: 0; }
  main { padding: 1rem; }

  .barra-movil {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .7rem;
    background: var(--lateral);
    color: #fff;
  }
  .barra-movil button { display: flex; padding: .6rem; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; }
  .barra-movil .icono { width: 22px; height: 22px; }
  .barra-movil img { border-radius: 8px; }
  .marca-movil { font-weight: 700; }

  .lateral {
    width: min(290px, 84vw);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .22s ease, visibility .22s;
  }
  .menu-abierto .lateral { visibility: visible; transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .5); }
  .menu-abierto .fondo-menu { display: block; position: fixed; inset: 0; z-index: 15; background: rgb(5 10 20 / .6); }

  .pagina-acceso main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acceso-marca { padding: 1.5rem 1rem; }
  .acceso-marca img { width: min(240px, 62%); }
  .acceso-marca p { display: none; }
}

/* Controles cómodos para usar con el dedo; 16px evita el zoom automático en iPhone. */
@media (max-width: 860px), (pointer: coarse) {
  .boton, input:not([type="checkbox"]):not([type="date"]), select { min-height: 44px; font-size: 16px; }
  input[type="checkbox"] { width: 22px; height: 22px; }
  .menu a, .pie-lateral > a, .pie-lateral > button { padding-block: .7rem; }
  .cuenta button { padding: .55rem; }
  .campo-fecha button { padding: .7rem; }
  .campo-fecha input[data-fecha] { padding-right: 3rem; }
  summary { padding-block: .75rem; }
  .acciones-fila a, .paginas a { display: inline-block; padding-block: .6rem; }
  .acciones > .boton { flex: 1 1 auto; }
  .acciones-consumo .boton { min-height: 40px; }
  .check, .formulario label.check { min-height: 44px; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .indicadores.seis { grid-template-columns: 1fr 1fr; }
  .kpi { padding-right: 1.15rem; }
  .kpi-icono { position: static; width: 34px; height: 34px; margin-bottom: .45rem; }
  .hero-caja { padding: 1.15rem; }
  .hero-caja strong { font-size: 1.75rem; }
  .hero-principal { width: 100%; }
  .hero-ir { position: absolute; top: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
  .formulario.dos { grid-template-columns: 1fr; }
  .indicadores strong { font-size: clamp(.95rem, 4.5vw, 1.15rem); letter-spacing: -.01em; }
  .filtros input[type="search"] { min-width: 0; }
  .filtros label, .filtros > input[type="search"] { flex: 1 1 100%; }
  .tablero { grid-template-columns: 1fr; }
}

/* Según el ancho real de la tabla, con o sin menú lateral. */
@container (max-width: 700px) {
  .tabla-apilada, .tabla-apilada tbody { display: block; }
  .tabla-apilada thead { display: none; }
  .tabla-apilada tr { display: block; padding: .7rem 0; border-bottom: 1px solid var(--borde); }
  .tabla-apilada tbody tr:last-child { border-bottom: 0; }
  .tabla-apilada td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .15rem 0;
    border: 0;
    text-align: right;
    white-space: normal;
  }
  .tabla-apilada td::before { content: attr(data-titulo); flex: none; color: var(--tenue); font-size: .82rem; }
  .tabla-apilada td > div { min-width: 0; }
  .tabla-apilada td:first-child { font-weight: 600; text-align: left; }
  .tabla-apilada td:first-child::before { display: none; }
  .tabla-apilada td.vacio { display: block; font-weight: 400; text-align: center; }
  .tabla-apilada td.celda-vacia { display: none; }
  .tabla-apilada td.acciones-fila > div { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
  .tabla-apilada .acciones-fila a { margin-left: 0; }
  .tabla-apilada .anular { text-align: left; }

  /* Cada movimiento es una tarjeta, para que el monto siempre se vea. */
  .tabla-mov, .tabla-mov tbody { display: block; }
  .tabla-mov thead { display: none; }
  .tabla-mov tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: .6rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--borde);
  }
  .tabla-mov tbody tr:last-child { border-bottom: 0; }
  .tabla-mov td { display: block; padding: 0; border: 0; white-space: normal; }
  .tabla-mov td:nth-child(3) { grid-area: 1 / 1 / 2 / 3; font-weight: 500; }
  .tabla-mov td:nth-child(5) { grid-area: 1 / 3; font-weight: 650; }
  .tabla-mov td:nth-child(1) { grid-area: 2 / 1; color: var(--tenue); font-size: .82rem; }
  .tabla-mov td:nth-child(2) { grid-area: 2 / 2; color: var(--tenue); font-size: .82rem; }
  .tabla-mov td:nth-child(4) { grid-area: 2 / 3; color: var(--tenue); font-size: .82rem; }
  .tabla-mov td:nth-child(6) { grid-area: 3 / 1 / 4 / -1; }
  .tabla-mov td.vacio { grid-column: 1 / -1; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .lateral, .barra-movil, .fondo-menu, .no-imprimir, .aviso { display: none !important; }
  .contenido { margin-left: 0; }
  main { max-width: none; padding: 0; }
  .recibo { border: 0; box-shadow: none; padding: 0; max-width: none; }
}
