/* =========================================================
 * styles.css — Mobile-first. Paleta tomada de la nota (teal/menta)
 * y del Excel de clientes (azul marino).
 * ========================================================= */

:root {
  --teal: #1d6f5f;
  --teal-oscuro: #155446;
  --teal-claro: #e6f4f0;
  --menta: #cdeee0;
  --cian: #a9dce3;
  --borde-menta: #bfe6da;
  --marino: #1f5f8b;
  --marino-oscuro: #174a6d;
  --azul-claro: #dcedf8;
  --ambar: #b26a00;
  --ambar-fondo: #fff4e0;
  --rojo: #c0392b;
  --rojo-fondo: #fdecea;
  --verde: #1e7d4f;
  --verde-fondo: #e3f5ea;
  --texto: #1d2a2e;
  --texto-suave: #5d6b70;
  --fondo: #f4f7f6;
  --blanco: #fff;
  --borde: #dbe3e1;
  --radio: 12px;
  --sombra: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .04);
  --alto-nav: 64px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fondo);
}

h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
a { color: var(--teal); }
[hidden] { display: none !important; }

/* ---------- Layout y navegación ---------- */

.contenido {
  padding: 16px 16px calc(var(--alto-nav) + 24px);
  max-width: 1100px;
  margin: 0 auto;
}

.nav {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--alto-nav);
  display: flex;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
  z-index: 10;
}
.nav-marca { display: none; }
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--texto-suave);
  text-decoration: none;
}
.nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav a.activo { color: var(--teal); }

@media (min-width: 900px) {
  .nav {
    inset: 0 auto 0 0;
    width: 230px;
    height: auto;
    flex-direction: column;
    gap: 4px;
    padding: 20px 12px;
    border-top: 0;
    border-right: 1px solid var(--borde);
  }
  .nav-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 20px;
    font-weight: 800;
    color: var(--teal-oscuro);
    line-height: 1.2;
  }
  .nav-marca small { font-weight: 500; color: var(--texto-suave); }
  .nav-logo {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), #3aa38c);
  }
  .nav a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    font-size: .95rem;
  }
  .nav a:hover { background: var(--teal-claro); }
  .nav a.activo { background: var(--teal-claro); color: var(--teal-oscuro); }
  .app { padding-left: 230px; }
  .contenido { padding: 28px 32px 40px; }
}

.vista-encabezado {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.subtitulo { margin: 2px 0 0; color: var(--texto-suave); }
.botones { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Botones ---------- */

.btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--texto);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--teal); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primario:hover { background: var(--teal-oscuro); }
.btn-peligro { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn-peligro-texto { color: var(--rojo); }
.btn-chico { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-grande { min-height: 52px; padding: 12px 22px; font-size: 1.05rem; }
.btn-bloque { width: 100%; }
.nota-form > .btn-bloque { width: calc(100% - 32px); }
.btn-icono {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texto-suave);
  font-size: 1.1rem;
  cursor: pointer;
}
.btn-icono:hover { background: var(--rojo-fondo); color: var(--rojo); }

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

input, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--texto);
  font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
input:disabled { background: var(--fondo); }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; color: var(--texto-suave); margin-bottom: 12px; }
.campo input, .campo select { color: var(--texto); font-weight: 400; }
.campo small { font-weight: 400; }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--teal); }
.buscador { margin-bottom: 14px; }
.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; margin-bottom: 8px; }
.filtros .buscador { grid-column: 1 / -1; margin-bottom: 8px; }
.filtros .check { margin-bottom: 14px; }
@media (min-width: 700px) {
  .filtros { display: flex; flex-wrap: wrap; gap: 12px; }
  .filtros .campo { min-width: 160px; }
  .filtros .buscador { flex: 1; min-width: 240px; margin-bottom: 14px; }
}

.aviso-error {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--rojo-fondo);
  color: var(--rojo);
  font-weight: 600;
}

/* ---------- Tarjetas y paneles ---------- */

.tarjetas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .tarjetas { grid-template-columns: repeat(4, 1fr); } }
.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radio);
  border-top: 4px solid var(--teal);
  background: var(--blanco);
  box-shadow: var(--sombra);
  color: var(--texto);
  text-decoration: none;
}
.tarjeta-ambar { border-top-color: var(--ambar); }
.tarjeta-roja { border-top-color: var(--rojo); }
.tarjeta-etiqueta { font-size: .85rem; color: var(--texto-suave); font-weight: 600; }
.tarjeta-valor { font-size: 1.35rem; }
.tarjeta-nota { font-size: .8rem; color: var(--texto-suave); }

.panel { padding: 18px; margin-bottom: 18px; border-radius: var(--radio); background: var(--blanco); box-shadow: var(--sombra); }
.panel-discreto { background: transparent; box-shadow: none; border: 1px dashed var(--borde); }
.panel-discreto p { color: var(--texto-suave); margin-top: 0; }
.dos-columnas { display: grid; gap: 0 18px; }
@media (min-width: 900px) { .dos-columnas { grid-template-columns: 1fr 1fr; } }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li + li { border-top: 1px solid var(--borde); }
.lista a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; color: var(--texto); text-decoration: none; }
.lista a:hover { background: var(--teal-claro); }
.lista small { color: var(--texto-suave); }
.lista-der { text-align: right; white-space: nowrap; }
.lista-simple { margin: 0 0 12px; padding-left: 18px; }
.lista-simple li { margin-bottom: 4px; }
.mini-titulo { font-size: .95rem; margin: 8px 0 6px; }
.vacio { color: var(--texto-suave); text-align: center; padding: 16px; list-style: none; }

/* ---------- Badges y textos de estado ---------- */

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-verde { background: var(--verde-fondo); color: var(--verde); }
.badge-ambar { background: var(--ambar-fondo); color: var(--ambar); }
.badge-rojo { background: var(--rojo-fondo); color: var(--rojo); }
.texto-rojo { color: var(--rojo); }
.texto-ambar { color: var(--ambar); }

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

.tabla-contenedor { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.tabla th { padding: 12px; text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); background: #f8faf9; border-bottom: 1px solid var(--borde); }
.tabla td { padding: 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tfoot td { font-weight: 700; background: #f8faf9; border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; }
.acciones { text-align: right; white-space: nowrap; }
.tabla-clic tbody tr[tabindex] { cursor: pointer; }
.tabla-clic tbody tr[tabindex]:hover { background: var(--teal-claro); }
.fila-alerta td { background: var(--rojo-fondo); }
.fila-alerta td:first-child { box-shadow: inset 4px 0 0 var(--rojo); }

/* En celular las tablas se vuelven tarjetas */
@media (max-width: 699px) {
  .tabla-responsiva, .tabla-partidas { box-shadow: none; background: transparent; }
  .tabla-responsiva thead, .tabla-partidas thead { display: none; }
  .tabla-responsiva tr, .tabla-partidas tr {
    display: block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: var(--radio);
    background: var(--blanco);
    box-shadow: var(--sombra);
  }
  .tabla-responsiva td, .tabla-partidas td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
    background: transparent !important;
    box-shadow: none !important;
  }
  .tabla-responsiva td[data-label]::before, .tabla-partidas td[data-label]::before {
    content: attr(data-label);
    font-size: .8rem;
    font-weight: 600;
    color: var(--texto-suave);
    text-align: left;
  }
  .tabla-responsiva td[colspan] { justify-content: center; }
  .tabla-responsiva .acciones { justify-content: flex-end; flex-wrap: wrap; }
  .tabla-responsiva tr.fila-alerta, .tabla-partidas tr.fila-alerta { box-shadow: inset 4px 0 0 var(--rojo), var(--sombra); background: var(--rojo-fondo); }
  .tabla-partidas td { flex-direction: column; align-items: stretch; text-align: left; }
  .tabla-partidas td.importe { flex-direction: row; align-items: center; font-weight: 700; }
  .tabla-partidas td.acciones { align-items: flex-end; }
}

/* ---------- Nueva nota (formulario) ---------- */

.nota-form { padding: 0 0 18px; border-radius: var(--radio); background: var(--blanco); box-shadow: var(--sombra); }
.nota-form > :not(.nota-form-encabezado) { margin-left: 16px; margin-right: 16px; }
/* La franja diagonal va en ::before para no recortar las listas desplegables */
.nota-form-encabezado {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 16px;
  padding: 18px 16px 56px;
  margin-bottom: 8px;
}
.nota-form-encabezado::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radio) var(--radio) 0 0;
  background: linear-gradient(110deg, var(--menta), var(--cian));
  clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
}
.nota-form-encabezado { isolation: isolate; z-index: 2; }
.nota-form-fecha input { max-width: 190px; }
.nota-form-cliente { grid-column: 1 / -1; max-width: 560px; }
.ayuda-campo { display: block; margin-top: 4px; color: var(--texto-suave); font-size: .82rem; }

/* Cliente elegido */
.cliente-elegido {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: var(--blanco);
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  background: var(--teal);
}
.cliente-elegido-datos { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cliente-elegido-datos strong { font-size: 1.1rem; }
.cliente-elegido-datos small { color: var(--texto-suave); }

/* Alta rápida de cliente */
.cliente-nuevo { padding: 14px; border: 2px dashed var(--teal); border-radius: 12px; background: var(--blanco); }
.cliente-nuevo-titulo { display: block; margin-bottom: 10px; color: var(--teal-oscuro); }
.cliente-nuevo .botones { justify-content: flex-end; }
@media (min-width: 700px) {
  .cliente-nuevo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 12px; }
  .cliente-nuevo-titulo, .cliente-nuevo .aviso-error, .cliente-nuevo .botones { grid-column: 1 / -1; }
}

/* Combobox con autocompletado */
.combo { position: relative; }
.combo input {
  padding-right: 36px;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6b70' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3 3'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.combo-lista {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  min-width: 260px;
  max-height: 300px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.combo-lista li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.combo-lista li.activo { background: var(--teal-claro); }
.combo-lista li.deshabilitada { opacity: .45; cursor: not-allowed; }
.combo-principal { display: flex; flex-direction: column; min-width: 0; }
.combo-principal small { color: var(--texto-suave); font-size: .82rem; }
.combo-stock { font-size: .82rem; font-weight: 600; white-space: nowrap; color: var(--texto-suave); }
.combo-lista mark { background: #fff1a8; color: inherit; border-radius: 2px; }
.combo-extra { margin-top: 4px; border-top: 1px solid var(--borde); color: var(--teal-oscuro); font-weight: 600; justify-content: flex-start !important; }
.combo-vacio { padding: 10px 12px; color: var(--texto-suave); font-size: .9rem; }
.tabla-partidas input:disabled { background: var(--fondo); cursor: not-allowed; }

.tabla-partidas th { color: var(--teal); background: var(--blanco); font-weight: 800; border-bottom: 2px solid #555; }
.tabla-partidas td { border-bottom: 1px solid var(--borde-menta); }
.tabla-partidas { width: calc(100% - 32px); overflow: visible; box-shadow: none; }
.tabla-partidas .combo { min-width: 240px; }
.tabla-partidas input[data-campo="precioUnitario"] { max-width: 130px; }
.input-unidad { display: flex; align-items: center; gap: 6px; }
.input-unidad input { max-width: 120px; }
.input-unidad span { font-weight: 700; min-width: 32px; }
.aviso-stock { display: block; color: var(--rojo); font-weight: 600; }
.aviso-stock:empty { display: none; }
@media (max-width: 699px) {
  .tabla-partidas .combo, .tabla-partidas input[data-campo="precioUnitario"], .input-unidad input { min-width: 0; max-width: none; }
}
#nv-agregar { margin-top: 10px; }

.totales { margin: 16px 16px 0 auto !important; border-collapse: collapse; }
.totales th { padding: 6px 12px; text-align: right; font-weight: 500; }
.totales td { min-width: 130px; padding: 6px 12px; text-align: right; border: 1px solid var(--borde); font-weight: 600; }
.totales .total th, .totales .total td { font-weight: 800; font-size: 1.1rem; }
.totales .check { justify-content: flex-end; }

.pago { margin-top: 18px; padding: 14px; border-radius: 10px; background: var(--teal-claro); }
.pago .campo { margin-bottom: 8px; max-width: 260px; }
.pago-botones { display: flex; gap: 8px; }
.pago-resumen { margin: 12px 0 0; }

/* ---------- Nota de remisión (vista e impresión) ---------- */

.remision {
  position: relative;
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 28px 24px 24px;
  background: var(--blanco);
  box-shadow: var(--sombra);
  border-radius: 4px;
  overflow: hidden;
  font-size: clamp(.78rem, 2.4vw, 1rem);
}
.remision-banda {
  position: absolute;
  inset: 0 0 auto 0;
  height: 270px;
  background: linear-gradient(110deg, var(--menta) 0%, #bfe6e0 50%, var(--cian) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%);
}
.remision-encabezado, .nota-form-encabezado { position: relative; }
.remision-encabezado { display: grid; grid-template-columns: 1fr auto; gap: 28px 16px; margin-bottom: 70px; }
.r-etiqueta { font-weight: 800; font-size: 1.25em; letter-spacing: .01em; color: var(--texto); }
.r-valor { font-size: 1.35em; margin-top: 4px; }
.r-folio { text-align: left; padding-right: 8%; }
.r-folio span { display: block; font-size: 1em; white-space: nowrap; }
.r-folio strong { font-size: 1.25em; }
.r-cliente { grid-column: 1 / -1; }
.r-valor-cliente { font-size: 1.3em; font-weight: 800; margin-top: 4px; }

.remision-tabla { position: relative; width: 100%; border-collapse: collapse; table-layout: fixed; }
.remision-tabla th {
  padding: 10px;
  text-align: left;
  color: var(--teal);
  font-weight: 800;
  border: 1px solid #8a9a96;
  border-bottom: 2px solid #555;
  background: var(--blanco);
}
.remision-tabla tbody::before { content: ""; display: table-row; height: 18px; }
.remision-tabla td { height: 2.6em; padding: 6px 10px; border: 1px solid var(--borde-menta); font-weight: 600; overflow-wrap: anywhere; }
.remision-tabla td:first-child { font-weight: 500; }

.remision-pie { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 4px; }
.remision-totales { border-collapse: collapse; }
.remision-totales th { padding: 3px 10px; text-align: right; font-weight: 400; white-space: nowrap; }
.remision-totales td { min-width: 9em; padding: 3px 10px; text-align: right; border: 1px solid #b9c4c1; font-weight: 600; }
.remision-totales .total th, .remision-totales .total td { font-weight: 800; }
.remision-totales .separador th, .remision-totales .separador td { padding-top: 10px; }
.remision-totales .separador td { border-top-width: 3px; border-top-color: var(--teal); }
.remision-estatus { padding-top: 6px; }

/* ---------- Estado de cuenta (estilo Excel) ---------- */

.estado-cuenta { margin-bottom: 18px; background: var(--blanco); box-shadow: var(--sombra); border-radius: 4px; overflow: hidden; }
.ec-banner {
  padding: 18px 12px;
  text-align: center;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  background: var(--marino-oscuro);
  border: 2px solid #0e3550;
}
.ec-sub { margin: 0; padding: 8px 12px; color: var(--texto-suave); font-size: .9rem; text-align: center; }
.ec-tabla { width: 100%; min-width: 560px; border-collapse: collapse; }
.ec-tabla th { padding: 8px 10px; text-align: left; color: #fff; background: var(--marino); font-weight: 800; border-right: 1px solid rgba(255, 255, 255, .25); }
.ec-tabla td { padding: 8px 10px; background: var(--azul-claro); border-bottom: 1px solid #fff; }
.ec-tabla tbody tr:nth-child(even) td { background: #eef6fc; }
.ec-tabla tbody tr[tabindex] { cursor: pointer; }
.ec-tabla tbody tr[tabindex]:hover td { background: #c5e1f3; }
.ec-tabla tfoot td { font-weight: 800; background: #fff; border-top: 2px solid var(--marino); }

/* ---------- Modal ---------- */

dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(20, 40, 36, .45); }
.modal-form { padding: 18px; }
.modal-encabezado { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-encabezado h2 { margin: 0; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--alto-nav) + 12px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast { padding: 12px 18px; border-radius: 10px; color: #fff; font-weight: 600; background: var(--verde); box-shadow: var(--sombra); animation: aparecer .2s ease-out; }
.toast-info { background: var(--marino); }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { #toasts { left: auto; right: 24px; bottom: 24px; transform: none; } }

/* ---------- Impresión ---------- */

@media print {
  @page { margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .nav, #toasts, dialog { display: none !important; }
  .app { padding: 0 !important; }
  .contenido { margin: 0 !important; padding: 0 !important; max-width: none; }
  /* Solo se imprime el área marcada de la vista activa */
  .vista > :not(.print-area) { display: none !important; }
  .remision, .estado-cuenta { box-shadow: none; max-width: none; margin: 0; font-size: 11pt; }
  .tabla-contenedor { overflow: visible; }
  .ec-tabla { min-width: 0; }
}

/* Nota en pantallas angostas: compactar para que quepan las 4 columnas */
@media screen and (max-width: 599px) {
  .remision { padding: 18px 12px; font-size: .74rem; }
  .remision-tabla th, .remision-tabla td { padding: 6px 4px; }
  .remision-tabla th { font-size: .78em; overflow-wrap: normal; }
  .remision-tabla td:not(:first-child) { white-space: nowrap; overflow-wrap: normal; }
  .remision-encabezado { margin-bottom: 56px; }
}

/* ---------- Inventario: entradas, salidas y movimientos ---------- */

.btn-entrada { color: var(--verde); border-color: #a9d9bf; background: var(--verde-fondo); }
.btn-entrada:hover { border-color: var(--verde); }
.btn-salida { color: var(--rojo); border-color: #efbdb7; background: var(--rojo-fondo); }
.btn-salida:hover { border-color: var(--rojo); }
.badge-azul { background: var(--azul-claro); color: var(--marino); }
.texto-verde { color: var(--verde); }

.pestanas { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--borde); overflow-x: auto; overflow-y: hidden; }
.pestanas a {
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--texto-suave);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.pestanas a.activa { color: var(--teal-oscuro); border-bottom-color: var(--teal); }

.resumen-producto {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--teal-claro);
}
.ayuda { margin-top: 0; color: var(--texto-suave); font-size: .9rem; }
.vista-previa { padding: 10px 12px; border-radius: 10px; background: var(--fondo); }
.vista-previa:empty { display: none; }
.tabla-responsiva .acciones .btn { margin: 2px 0; }

/* ---------- Login ---------- */

.login { min-height: 100vh; display: grid; background: var(--fondo); }
.login-marca { display: none; }
.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 0 0, var(--menta), transparent 55%),
    radial-gradient(circle at 100% 100%, var(--cian), transparent 50%),
    var(--fondo);
}
.login-form {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  border-radius: 20px;
  background: var(--blanco);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 24px 60px rgba(29, 111, 95, .14);
}
.login-form h1 { font-size: 1.7rem; }
.login-form .subtitulo { margin: 4px 0 24px; }
.login-form .check { margin: 4px 0 8px; font-size: .95rem; }
.login-form .btn-bloque { margin-top: 12px; }
.login-logo-movil {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 12px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), #3aa38c);
}
.login-pie { margin: 0; color: var(--texto-suave); font-size: .82rem; }

.input-password { position: relative; display: block; }
.input-password input { padding-right: 88px; }
.btn-ver {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-ver:hover { background: var(--teal-claro); }

.sacudir { animation: sacudir .4s; }
@keyframes sacudir {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@media (prefers-reduced-motion: reduce) { .sacudir { animation: none; } }

@media (min-width: 900px) {
  .login { grid-template-columns: 1.1fr 1fr; }
  .login-panel { background: var(--fondo); }
  .login-logo-movil { display: none; }
  .login-marca {
    position: relative;
    display: flex;
    align-items: center;
    padding: 64px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(140deg, var(--teal-oscuro) 0%, var(--teal) 45%, #3aa38c 100%);
  }
  /* Franja diagonal menta, como en la nota de remisión */
  .login-marca::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 38%;
    background: linear-gradient(110deg, rgba(205, 238, 224, .35), rgba(169, 220, 227, .55));
    clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 100%);
  }
  .login-marca-contenido { position: relative; z-index: 1; max-width: 420px; }
  .login-logo { width: 56px; height: 56px; font-size: 1.6rem; font-weight: 800; background: rgba(255, 255, 255, .18); }
  .login-marca h2 { margin: 24px 0 8px; font-size: 2.4rem; letter-spacing: -.01em; }
  .login-marca p { margin: 0 0 28px; font-size: 1.15rem; opacity: .9; }
  .login-marca ul { margin: 0; padding: 0; list-style: none; }
  .login-marca li { position: relative; padding-left: 30px; margin-bottom: 12px; opacity: .95; }
  .login-marca li::before {
    content: "✓";
    position: absolute;
    left: 0;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: .75rem;
    background: rgba(255, 255, 255, .22);
  }
  .burbuja { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
  .b1 { width: 320px; height: 320px; top: -90px; right: -110px; }
  .b2 { width: 160px; height: 160px; top: 38%; right: 12%; }
  .b3 { width: 90px; height: 90px; top: 14%; left: 54%; background: rgba(255, 255, 255, .12); }
}

/* Usuario y salir en el menú lateral; en celular el botón está en Inicio */
.nav-usuario { display: none; }
.avatar-chico { width: 32px; height: 32px; font-size: .9rem; }
@media (min-width: 900px) {
  .nav-usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 12px 8px 0;
    border-top: 1px solid var(--borde);
    font-weight: 600;
  }
  .nav-usuario .btn { margin-left: auto; }
  .solo-movil { display: none; }
}

/* Logo de Espuma: burbujas en trazo blanco */
.nav-logo .logo-burbujas { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
