/* Estética Estancia El Jabalí S.A. (la de los tableros: Siembra gruesa 26-27,
   Posición comercial 26-27): minimalista y clara, fondo casi blanco, líneas
   finas, sin sombras, Archivo, verde de la marca. Un solo tema: claro.
   Layout: marca arriba, título con sello de fecha, indicadores (KPI),
   acciones de carga, pestañas y el detalle de movimientos en un panel. */
:root {
  --w-0: #ffffff;
  --w-50: #fbfbfc;
  --line-100: #ececee;
  --line-200: #e0e0e3;
  --ink-900: #1d1d1f;
  --ink-500: #6b6f75;
  --ink-300: #a3a7ad;
  --green-700: #2f6b43;
  --green-soft: rgba(47, 107, 67, 0.12);
  --green-tint: #eaf0ec;
  --green-line: #c6d6cb;
  --red-600: #b5503a;
  --greenok-600: #3f8a52;
  --amber-600: #b8860b;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 28px;
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: var(--w-50);
  --card: var(--w-0);
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --faint: var(--ink-300);
  --line: var(--line-100);
  --line-strong: var(--line-200);
  --green: var(--green-700);
  --good: var(--greenok-600);
  --bad: var(--red-600);
  --warn: var(--amber-600);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
a {
  color: var(--green);
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mut,
.muted {
  color: var(--muted);
}
.pos {
  color: var(--good);
}
.neg {
  color: var(--bad);
}
.nw {
  white-space: nowrap;
}

/* ---------- Estructura ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: calc(var(--space-6) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
}
.brand-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  height: 38px;
  width: auto;
  display: block;
}
.brand .company {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}
h1 {
  font-weight: 600;
  font-size: clamp(1.55rem, 3.8vw, 2.1rem);
  margin: 2px 0 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.top-der {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.stamp {
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.stamp b {
  color: var(--ink);
  font-weight: 600;
}
.selector-fondo {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 32px 0 13px;
  font: 500 0.85rem var(--font);
  background: var(--card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6f75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center / 15px;
  appearance: none;
  max-width: 100%;
}
.foot {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: var(--space-4);
  text-align: center;
}

/* ---------- Chips y menú de usuario ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 11px;
  font: 500 0.82rem var(--font);
  font-variant-numeric: tabular-nums;
  min-height: 34px;
}
.chip:hover {
  border-color: var(--green);
}
.chip .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.usuario {
  flex: none;
  max-width: 50%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 6px 2px;
  font: 500 0.86rem var(--font);
  color: var(--muted);
}
.usuario:hover {
  color: var(--ink);
}
.usuario .icon {
  width: 15px;
  height: 15px;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.menu .quien {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  font-weight: 600;
}
.menu .quien span {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}
.menu button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 10px;
  font: 500 0.92rem var(--font);
}
.menu button:hover {
  background: var(--bg);
}

/* ---------- Avisos ---------- */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid #ecd9a6;
  background: #fdf7e6;
  color: #7a5a06;
  font-size: 0.86rem;
  margin-bottom: var(--space-4);
}
.banner.error {
  border-color: #efc3ba;
  background: #fcefec;
  color: #8f2f22;
}
.banner.info {
  border-color: var(--green-line);
  background: var(--green-tint);
  color: var(--green);
}
.hoja-cuerpo .banner,
.login .banner {
  margin-bottom: 0;
}

/* ---------- Indicadores ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  min-width: 0;
}
.kpi .v {
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .v.lg {
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
}
.kpi .v.neg {
  color: var(--bad);
}
.kpi .l {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 6px;
}
.kpi .s {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.bar {
  display: block;
  width: 100%;
  height: 9px;
  border-radius: 5px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  margin: 4px 0 2px;
}
.bar > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  background: var(--green);
}
@media (max-width: 900px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi.principal {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  .top-der,
  .stamp {
    text-align: left;
  }
  .kpis {
    gap: var(--space-3);
  }
  .kpi {
    padding: 12px 14px 14px;
  }
  .kpi .v {
    font-size: 1.45rem;
  }
  .kpi.principal .v.lg {
    font-size: 1.6rem;
  }
  .kpi .v.lg {
    font-size: 1.1rem;
  }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: 600 0.9rem var(--font);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.btn .icon {
  color: var(--green);
}
.btn.primario {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.btn.primario .icon {
  color: #fff;
}
.btn.primario:hover {
  background: #275a38;
  color: #fff;
}
.btn.fantasma {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn.fantasma:hover {
  color: var(--green);
}
.btn.peligro {
  color: var(--bad);
  border-color: #efc3ba;
}
.btn.peligro.lleno {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn:disabled,
.btn:disabled:hover {
  background: var(--line);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
}
.btn:disabled .icon {
  color: var(--faint);
}
.btn.chico {
  height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
  border-radius: 999px;
}
.btn.grande {
  height: 48px;
  font-size: 0.98rem;
}
.btn.ancho {
  width: 100%;
}
.icono-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
}
.icono-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green);
  font: 600 0.82rem var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.acciones-fila {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------- Pestañas ---------- */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  font: 600 0.92rem var(--font);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button.on {
  color: var(--ink);
  border-bottom-color: var(--green);
}
.tabs button:hover {
  color: var(--ink);
}
.tabs .pdf {
  margin-left: auto;
  color: var(--green);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 5px;
  align-self: center;
  font-size: 0.82rem;
  background: var(--card);
}
.tabs .pdf:hover {
  border-color: var(--green);
  color: var(--green);
}
@media (max-width: 600px) {
  .tabs button {
    padding: 9px 10px;
  }
}

/* ---------- Panel de movimientos ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: var(--space-4);
  min-width: 0;
}
.panel h2,
.panel h3 {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}
.panel h2 .hint,
.panel h3 .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}
.panel-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}
.chip.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.chip.on .icon {
  color: #fff;
}
.chip.on:hover {
  background: #275a38;
}
.nota {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 10px 0 0;
}
.nota b {
  color: var(--ink);
  font-weight: 600;
}
.vacio {
  margin: 4px 0 0;
  color: var(--muted);
}
.vacio p {
  margin: 0 0 8px;
}
.vacio b {
  color: var(--ink);
  font-weight: 600;
}
.vacio ol {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Tabla (como las de los tableros) ---------- */
.tablewrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
th.l,
td.l {
  text-align: left;
}
th {
  vertical-align: bottom;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line-strong);
}
th:first-child,
td:first-child {
  box-shadow: inset -1px 0 0 var(--line);
}
td .mini {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  white-space: normal;
}
tr.grupo td {
  background: var(--green-tint);
  border-top: 2px solid var(--green);
  border-bottom: 1px solid var(--green-line);
  padding-top: 3px;
  padding-bottom: 3px;
  font-weight: 700;
  color: var(--green);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  box-shadow: none;
}
tr.grupo td .mini {
  display: inline;
  margin-left: 8px;
  font-weight: 500;
  color: var(--green);
  opacity: 0.75;
  text-transform: none;
  letter-spacing: 0;
}
tr.tot td {
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
  box-shadow: none;
}
tr.tot + tr.tot td {
  border-top: 0;
}
tr.tot td.l {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
table.movs td.mov-t {
  white-space: normal;
  min-width: 200px;
}
table.movs td.cuenta {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr.mov {
  cursor: pointer;
}
tr.mov:hover td {
  background: var(--bg);
}
.fila-link {
  border: 0;
  background: none;
  padding: 0;
  font: 600 0.88rem var(--font);
  color: var(--ink);
  text-align: left;
}
.fila-link:hover {
  color: var(--green);
}
.importe {
  font-weight: 600;
  white-space: nowrap;
}
td.comp {
  color: var(--muted);
}
td.comp .letra {
  margin-right: 6px;
  vertical-align: 1px;
}
.con-foto .icon {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: -2px;
  color: var(--faint);
}
/* Letra del comprobante, como el recuadro de las facturas argentinas */
.letra {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border: 1px solid var(--ink-500);
  border-radius: 3px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.c-ok {
  background: #cfe8d5;
  color: #1d5c32;
}
.c-pend {
  background: #fbeec1;
  color: #7a5a06;
}
.c-mal {
  background: #f8d3cc;
  color: #8f2f22;
}
.solo-movil,
.exportar-movil {
  display: none !important;
}
.barra-movil {
  display: none;
}

/* En el celular la tabla se lee como lista y las acciones van abajo. */
@media (max-width: 720px) {
  .solo-movil {
    display: block !important;
  }
  .solo-pc,
  .acciones-pc,
  .tabs .pdf {
    display: none !important;
  }
  .exportar-movil {
    display: inline-flex !important;
  }
  table.movs,
  table.movs tbody,
  table.movs tfoot {
    display: block;
  }
  table.movs thead {
    display: none;
  }
  table.movs tr {
    display: block;
  }
  table.movs td {
    box-shadow: none;
  }
  table.movs tr.mov {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--line);
  }
  table.movs tr.mov td {
    display: block;
    border: 0;
    padding: 0;
  }
  table.movs tr.mov td.fecha,
  table.movs tr.mov td.cuenta,
  table.movs tr.mov td.comp {
    display: none;
  }
  table.movs td.mov-t {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-width: 0;
  }
  table.movs td.importe {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  table.movs td.estado {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }
  table.movs tr.grupo td {
    display: flex;
    justify-content: space-between;
    padding: 3px 8px;
  }
  table.movs tr.grupo td:last-child {
    display: none;
  }
  table.movs tr.tot {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line-strong);
  }
  table.movs tr.tot + tr.tot {
    border-top: 0;
  }
  table.movs tr.tot td {
    border: 0;
    padding: 7px 2px;
  }
  .barra-movil {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: flex;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    background: var(--card);
    border-top: 1px solid var(--line);
  }
  .barra-movil .chip {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    font-size: 0.85rem;
    padding: 4px 8px;
  }
  .barra-movil .chip.on {
    flex: 1.5;
  }
  .wrap {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .aviso {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
.cargando {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 32px 4px;
}

/* ---------- Hojas (diálogos) ---------- */
dialog.hoja {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: var(--bg);
  color: var(--ink);
}
dialog.hoja::backdrop {
  background: rgba(29, 29, 31, 0.35);
}
@media (min-width: 720px) {
  dialog.hoja {
    margin: auto;
    width: min(640px, calc(100% - 48px));
    height: auto;
    max-height: calc(100% - 48px);
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
  }
}
.hoja-int {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
}
.hoja-cab {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
@media (min-width: 720px) {
  .hoja-cab {
    padding-top: 16px;
  }
}
.hoja-cab .t {
  flex: 1;
  min-width: 0;
}
.hoja-cab h2 {
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.hoja-cuerpo {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.barra-abajo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.barra-abajo .fila-botones {
  display: flex;
  gap: 10px;
}
.barra-abajo .fila-botones .btn.primario {
  flex: 1;
}

/* ---------- Formularios ---------- */
.grilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.campo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.campo.todo {
  grid-column: 1 / -1;
}
.campo > label,
.etq {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.campo > label .opc {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.ayuda {
  font-size: 0.8rem;
  color: var(--muted);
}
.ayuda.pos {
  color: var(--good);
}
.ayuda.neg {
  color: var(--bad);
}
.entrada {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 16px;
  background: var(--card);
  font-variant-numeric: tabular-nums;
}
select.entrada {
  padding: 0 34px 0 12px;
  appearance: none;
  background: var(--card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6f75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 11px center / 16px;
}
textarea.entrada {
  height: auto;
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}
.entrada:focus,
.con-unidad:focus-within {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.entrada.leido,
.con-unidad.leido {
  border-color: var(--green-line);
  background-color: var(--green-tint);
}
.entrada.invalido,
.con-unidad.invalido {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(181, 80, 58, 0.14);
}
.con-unidad {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.con-unidad .pre {
  padding-left: 12px;
  color: var(--muted);
  font-weight: 500;
}
.con-unidad input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  padding: 0 12px 0 6px;
  font-size: 16px;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.con-unidad input:focus {
  outline: none;
}
.con-unidad.grande input {
  height: 56px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.con-unidad.grande .pre {
  font-size: 1.2rem;
}
details.mas {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
details.mas > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
details.mas > .grilla {
  padding: 0 14px 14px;
}
.segmentos {
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.segmentos button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 13px;
  min-height: 34px;
  min-width: 40px;
  justify-content: center;
  font: 500 0.85rem var(--font);
}
.segmentos button:hover {
  border-color: var(--green);
}
.segmentos button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  width: 19px;
  height: 19px;
  accent-color: var(--green);
  flex: none;
}

/* ---------- Foto del comprobante ---------- */
.foto {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.foto-marco {
  width: 96px;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--green);
}
.foto-marco.con-foto {
  border-style: solid;
  border-color: var(--line);
  cursor: zoom-in;
}
.pdf-icono {
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--bad);
}
.pdf-icono b {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.foto-marco img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.foto-marco .icon {
  width: 28px;
  height: 28px;
}
.foto-lado {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.estado-lectura {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.86rem;
}
.estado-lectura.ok {
  border-color: var(--green-line);
  background: var(--green-tint);
  color: var(--green);
}
.estado-lectura.aviso {
  border-color: #ecd9a6;
  background: #fdf7e6;
  color: #7a5a06;
}
.estado-lectura.leyendo {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink);
}
.ruedita {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--green);
  border-right-color: transparent;
  animation: girar 0.8s linear infinite;
}
@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
dialog.visor {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
}
dialog.visor::backdrop {
  background: rgba(0, 0, 0, 0.86);
}
dialog.visor img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

/* ---------- Exportar ---------- */
.pestanas-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.lista-elegir {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  max-height: 320px;
  overflow-y: auto;
}
.elegir {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
}
.elegir + .elegir {
  border-top: 1px solid var(--line);
}
.elegir input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.elegir .fila-texto span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.totales {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  font-variant-numeric: tabular-nums;
}
.totales .fuerte {
  font-weight: 600;
}
.totales .linea {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-strong);
}
.totales .reponer {
  color: var(--green);
  font-size: 1.05rem;
}
.llamado {
  border-radius: var(--radius);
  border: 1px solid var(--green-line);
  background: var(--green-tint);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.historial {
  display: flex;
  flex-direction: column;
}
.historial-fila {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

/* ---------- Ajustes ---------- */
.seccion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.seccion h3 {
  font-weight: 600;
  font-size: 1.05rem;
}
.seccion > p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.caja {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-lista {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.confirmar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.86rem;
  font-weight: 500;
}
.persona {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-tint);
  color: var(--green);
  font-weight: 600;
  font-size: 0.8rem;
}
.dato-copiable {
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

/* ---------- Ingreso a la app ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-left, 0px));
}
.login form {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  margin: 0;
}
.login h1 {
  font-size: 1.5rem;
}

/* ---------- Aviso flotante ---------- */
@keyframes aparecer {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.88rem;
  animation: aparecer 0.2s ease-out;
}
.aviso .icon {
  color: #9fd3ae;
}

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