/* ITULUM ERP */
:root {
  --bg: #f3f5f6;
  --card: #ffffff;
  --ink: #142229;
  --muted: #687882;
  --line: #dfe5e8;
  --line-2: #eef2f4;
  --brand: #0e5e6f;
  --brand-ink: #0a4552;
  --brand-soft: #e3f0f2;
  --top: #0f262e;
  --ambar: #d98d06;
  --verde: #1d7f48;
  --rojo: #c0392b;
  --wa: #1fa855;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(16, 34, 41, .06), 0 1px 1px rgba(16, 34, 41, .03);
  --t-visita: #0e7c86;
  --t-computadora: #4f46b8;
  --t-impresora: #b0650a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: .2rem 0 1rem; letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .8rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: .3rem 0; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recorte { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Encabezado */
.top { background: var(--top); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 20px; }
.marca { color: #fff; display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.marca:hover { text-decoration: none; }
.marca b { color: #7fd1d8; font-weight: 700; }
.marca-i {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #14a3ad, #0e5e6f); color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: 0;
}
.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a { color: #c7d6db; padding: 7px 11px; border-radius: 7px; font-size: .92rem; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.nav a.nav-cta { background: #14a3ad; color: #fff; font-weight: 600; }
.nav a.nav-cta:hover { background: #1bb7c2; }
.nav-sep { flex: 1; }
.nav-salir { opacity: .75; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

.main { max-width: 1280px; margin: 0 auto; padding: 22px 16px 60px; }

/* ---------- Mensajes */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flash-ok { background: #e8f6ee; border-color: #b7e2c8; color: #155e36; }
.flash-error { background: #fdecea; border-color: #f3c2bc; color: #8f2318; }
.flash-info { background: #e8f2fb; border-color: #bed8f1; color: #1d4f7d; }

/* ---------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: #b9c4c9; text-decoration: none; }
.btn-primario { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primario:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #188f47; border-color: #188f47; }
.btn-link, .btn-link:hover { background: none; border-color: transparent; color: var(--brand); }
button.btn-link { border: 0; padding: 0; font: inherit; cursor: pointer; }
.btn-bloque { width: 100%; }
.btn-chico { padding: 5px 10px; font-size: .85rem; }
.btn-x { border: 0; background: none; color: #b5c0c5; font-size: 1.15rem; cursor: pointer; line-height: 1; padding: 0 4px; }
.btn-x:hover { color: var(--rojo); }

/* ---------- Formularios */
.form label { display: block; font-size: .82rem; font-weight: 600; color: #3b4b53; margin-bottom: 12px; }
.form label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); width: 100%;
  padding: 9px 11px; border: 1px solid #cfd8dc; border-radius: 8px; background: #fff; margin-top: 4px;
}
input[type=checkbox] { width: auto; margin: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20, 163, 173, .35); border-color: #14a3ad; }
.form label.inline select { margin: 0; width: auto; }
.fila2, .fila3 { display: grid; gap: 0 14px; }
.fila2 { grid-template-columns: 1fr 1fr; }
.fila3 { grid-template-columns: 1fr 1fr 1fr; }
fieldset { border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.input-pre { display: flex; align-items: stretch; margin-top: 4px; max-width: 220px; }
.input-pre span { display: grid; place-items: center; padding: 0 10px; border: 1px solid #cfd8dc; border-right: 0; border-radius: 8px 0 0 8px; background: var(--line-2); font-weight: 600; }
.input-pre input { margin: 0; border-radius: 0 8px 8px 0; }
.acciones-form { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.fila-acc { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-inline select { margin: 0; }

/* ---------- Tarjetas y estructura */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--sombra); }
.card > h2:first-child { margin-top: 0; }
.t-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.t-head h1 { margin-bottom: .2rem; }
.t-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.vacio { text-align: center; padding: 48px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radio); color: var(--muted); }
.vacio .btn { margin-top: 10px; }

/* ---------- Indicadores */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 12px 14px; color: var(--ink); box-shadow: var(--sombra); border-top: 3px solid var(--brand); }
.kpi:hover { text-decoration: none; border-color: #b9c4c9; border-top-color: var(--brand); }
.kpi span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { font-size: 1.55rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-verde, .kpi-verde:hover { border-top-color: var(--verde); }
.kpi-ambar, .kpi-ambar:hover { border-top-color: var(--ambar); }
.kpi-plano, .kpi-plano:hover { border-top-color: #9fb0b7; }

/* ---------- Barra de filtros */
.barra { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.barra .filtros { margin-bottom: 0; }
.filtros input, .filtros select { width: auto; margin: 0; padding: 8px 10px; }
.filtros input[type=search] { flex: 1 1 260px; min-width: 200px; }

/* ---------- Tablas */
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.tabla th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafb; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tabla td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover td { background: #f7fbfb; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tr.urgente td:first-child { box-shadow: inset 3px 0 0 var(--rojo); }
.tabla tr.inactivo td { opacity: .55; }
.tabla-compacta { box-shadow: none; border: 0; }
.tabla-compacta th { background: none; padding: 6px 8px; }
.tabla-compacta td { padding: 8px; }
.saldo-pend { color: var(--rojo); font-weight: 700; }

.folio { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 700; font-size: .88rem; white-space: nowrap; padding-left: 8px; border-left: 3px solid var(--brand); color: var(--ink); }
.folio.t-visita { border-left-color: var(--t-visita); }
.folio.t-computadora { border-left-color: var(--t-computadora); }
.folio.t-impresora { border-left-color: var(--t-impresora); }
.folio-g { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 800; padding: 2px 10px; border-radius: 8px; color: #fff; background: var(--brand); }
.folio-g.t-visita { background: var(--t-visita); }
.folio-g.t-computadora { background: var(--t-computadora); }
.folio-g.t-impresora { background: var(--t-impresora); }

/* ---------- Etiquetas de estado */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; vertical-align: middle; }
.b-azul { background: #e3eefb; color: #1f5a96; }
.b-morado { background: #ece9fb; color: #4d3fb0; }
.b-ambar { background: #fdf1d8; color: #8d5a00; }
.b-naranja { background: #fde6d6; color: #a2470c; }
.b-verde-claro { background: #ddf5e5; color: #17703f; box-shadow: inset 0 0 0 1px #9fdcb5; }
.b-verde { background: #1d7f48; color: #fff; }
.b-rojo { background: #fbe0dc; color: #9d2a1d; }
.b-gris { background: #e8ecee; color: #56656c; }

/* ---------- Nuevo ticket */
.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tipo-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); color: var(--ink); border-top: 4px solid var(--c, var(--brand)); box-shadow: var(--sombra); }
.tipo-card:hover { text-decoration: none; border-color: #b9c4c9; border-top-color: var(--c); }
.tipo-card span { color: var(--muted); font-size: .86rem; }
.tipo-card em { font-style: normal; font-weight: 700; font-size: .88rem; color: var(--c); margin-top: auto; }
.tipo-card.t-visita { --c: var(--t-visita); }
.tipo-card.t-computadora { --c: var(--t-computadora); }
.tipo-card.t-impresora { --c: var(--t-impresora); }
.tipo-card.on { outline: 2px solid var(--c); background: #fbfdfd; }
.form-ticket { max-width: 860px; }
.busca-cliente { position: relative; margin-bottom: 12px; }
.busca-cliente input { margin: 0; background: #f8fafb; }
.sugerencias { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; box-shadow: 0 8px 24px rgba(16,34,41,.12); max-height: 320px; overflow: auto; }
.sugerencias button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font: inherit; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.sugerencias button:hover, .sugerencias button.on { background: var(--brand-soft); }
.sugerencias small { color: var(--muted); }
.cliente-sel { background: var(--brand-soft); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: .9rem; font-weight: 600; }
.nota-cobro { font-size: .88rem; color: var(--muted); align-self: center; }
.nota-cobro.destacado { background: #fdf1d8; color: #6b4500; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.aviso { color: var(--rojo); font-weight: 600; }

/* ---------- Ticket */
.cliente-linea { font-size: 1.1rem; }
.cuenta { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cuenta td { padding: 7px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.cuenta td.num { padding-left: 10px; }
.cuenta td.x { width: 22px; text-align: right; }
.cuenta td.x form { margin: 0; }
.cuenta .desc { color: var(--verde); }
.cuenta tr.tot td { font-weight: 700; border-bottom: 1px solid var(--line); }
.cuenta tr.pago td { color: var(--verde); }
.cuenta tr.saldo td { font-weight: 800; font-size: 1.12rem; border-bottom: 0; padding-top: 10px; }
.cuenta tr.saldo.pend td { color: var(--rojo); }
.cuenta tr.saldo.ok td { color: var(--verde); }
.cuenta tr.saldo.favor td { color: #1f5a96; }
details.sub { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
details.sub summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: .92rem; padding: 2px 0; }
details.sub[open] summary { margin-bottom: 10px; }
.rapidos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: #f8fafb; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .82rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.aviso-saldo { background: #fdecea; border: 1px solid #f3c2bc; color: #8f2318; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: .88rem; }
.aviso-saldo label { margin: 8px 0 0; color: #8f2318; }
#form-estado select, #form-estado textarea { margin: 0 0 10px; }

.nota-form { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.nota-form textarea { margin: 0; }
.bitacora { list-style: none; margin: 0; padding: 0; }
.bitacora li { position: relative; padding: 8px 0 10px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.bitacora li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #b9c4c9; border: 2px solid #fff; }
.bitacora li.bn-estado::before { background: var(--brand); }
.bitacora li.bn-pago::before { background: var(--verde); }
.bitacora li.bn-cargo::before { background: var(--ambar); }
.bitacora li.bn-nota::before { background: #4f46b8; }
.bn-meta { font-size: .76rem; color: var(--muted); }
.bn-txt { font-size: .92rem; }
.bitacora li.bn-sistema .bn-txt { color: var(--muted); }

/* ---------- Acceso */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: radial-gradient(circle at 30% 0%, #16414d, var(--top) 60%); }
.auth-box { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 26px 26px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth-marca { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .04em; font-size: 1.1rem; margin-bottom: 18px; }
.auth-marca b { color: var(--brand); }
.auth-box h1 { font-size: 1.3rem; }

/* ---------- Responsivo */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .t-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 56px; background: var(--top); flex-direction: column; align-items: stretch; padding: 8px 12px 14px; box-shadow: 0 10px 20px rgba(0,0,0,.25); }
  body.nav-abierto .nav { display: flex; }
  .nav a { padding: 11px 12px; }
  .nav-sep { display: none; }
  .t-grid { grid-template-columns: 1fr; }
  .t-side { order: -1; }
  .tipos { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .main { padding-top: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi b { font-size: 1.25rem; }
  .fila2, .fila3 { grid-template-columns: 1fr; }
  .filtros select { flex: 1 1 45%; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla thead { display: none; }
  .tabla { background: none; border: 0; box-shadow: none; }
  .tabla tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); margin-bottom: 10px; padding: 8px 12px; }
  .tabla td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .tabla td::before { content: attr(data-l); color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; text-align: left; flex: none; padding-top: 2px; }
  .tabla td > div { text-align: right; }
  .tabla tbody tr:hover td { background: none; }
  .tabla tr.urgente { border-left: 3px solid var(--rojo); }
  .tabla tr.urgente td:first-child { box-shadow: none; }
  .recorte { max-width: 200px; }
  .nota-form { flex-direction: column; align-items: stretch; }
  .t-acciones .btn { flex: 1; }
}

/* =================================================== Bancos y conciliación */
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: .86em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.neg { color: #b03a2e; }
.pos { color: var(--verde); }
.txt-rojo { color: var(--rojo); }
.inline-f { display: inline; margin: 0; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid rgba(0,0,0,.18); border-bottom-width: 2px; border-radius: 4px; font: 600 .72rem/1.35 ui-monospace, Consolas, monospace; text-align: center; background: rgba(255,255,255,.7); color: inherit; }
.btn-primario kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }

.subnav { display: flex; gap: 2px; flex-wrap: wrap; margin: -6px 0 16px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); }

.conc-top h1 { margin-bottom: .4rem; }
.conc-kpis { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 14px; font-size: .92rem; }
.conc-kpis > a { color: var(--ink); }
.conc-kpis > a b { font-size: 1.15rem; }
.conc-kpis > a span { color: var(--muted); }
.conc-kpis a.alerta { color: var(--rojo); }
.avance { position: relative; display: inline-block; width: 150px; height: 20px; background: var(--line-2); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.avance i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6cc59a, var(--verde)); border-radius: 999px; }
.avance em { position: relative; display: block; text-align: center; font-style: normal; font-size: .74rem; font-weight: 700; line-height: 20px; color: var(--ink); }
.conc-filtros { margin-bottom: 8px; }
.meses { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.meses a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .84rem; font-weight: 600; }
.meses a:hover { text-decoration: none; border-color: var(--brand); }
.meses a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.meses a i { font-style: normal; margin-left: 4px; background: #fde6d6; color: #a2470c; padding: 0 6px; border-radius: 999px; font-size: .74rem; }
.meses a i.cero { background: #ddf5e5; color: var(--verde); }
.meses a.on i { background: rgba(255,255,255,.25); color: #fff; }

/* Dos paneles */
.conc { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 16px; align-items: start; }
.conc-lista { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); box-shadow: var(--sombra); max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 72px; }
.conc-panel { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); box-shadow: var(--sombra); }
.panel-cerrar { display: none; }
.mv-mes { position: sticky; top: 0; z-index: 1; background: #f3f6f7; padding: 6px 12px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.mv-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); align-items: start; border-left: 3px solid transparent; }
.mv-row:hover { background: #f7fbfb; text-decoration: none; }
.mv-row.sel { background: var(--brand-soft); border-left-color: var(--brand); }
.mv-row.hecho .mv-d > span:first-child, .mv-row.hecho .mv-m { opacity: .5; }
.mv-f { font-size: .8rem; color: var(--muted); padding-top: 2px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.mv-f input { width: 16px; height: 16px; margin: 0; }
.mv-d { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mv-d > span:first-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.mv-m { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.chip-e { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.chip-e i { font-style: normal; opacity: .7; font-weight: 600; }
.e-pend { background: #fdf1d8; color: #8d5a00; }
.e-parc { background: #fde6d6; color: #a2470c; }
.e-ok { background: #ddf5e5; color: #17703f; }
.e-cat { background: #ece9fb; color: #4d3fb0; }
.e-ref { background: #e3eefb; color: #1f5a96; }
.e-canc { background: #fbe0dc; color: #9d2a1d; }
.e-rfc { background: var(--line-2); color: #3b4b53; font-family: ui-monospace, Consolas, monospace; }

#panel-cont { transition: opacity .12s; }
#panel-cont.cargando { opacity: .45; pointer-events: none; }
.panel-vacio { padding: 40px; text-align: center; color: var(--muted); }
.pm-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(#fbfdfd, #fff); }
.pm-monto { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pm-meta { color: var(--muted); font-size: .86rem; margin: 2px 0 8px; }
.pm-desc { font-size: .98rem; word-break: break-word; margin-bottom: 8px; }
.pm-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pm-sec { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.pm-sec:last-child { border-bottom: 0; }
.pm-sec h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.pm-hecho { background: #f6fbf8; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.link-row:last-of-type { border-bottom: 0; }
.link-row .muted.small { display: block; }
.aviso-p { background: #fdf1d8; color: #6b4500; padding: 8px 10px; border-radius: 8px; font-size: .86rem; margin: 8px 0 0; }
.atajos { padding: 10px 18px 14px; margin: 0; }
.atajos kbd { margin: 0 1px; }

.sug { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.sug:hover { border-color: #b9c4c9; }
.sug.combo { border-style: dashed; border-color: var(--brand); }
.sug-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sug-nom { min-width: 0; }
.sug-nom b { display: block; word-break: break-word; }
.sug-monto { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; font-size: 1.02rem; }
.sug-conc { font-size: .82rem; color: #4a5a62; margin-top: 6px; word-break: break-word; }
.sug-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.razones { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.razones span { font-size: .72rem; background: var(--line-2); color: #3b4b53; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.conf { display: inline-block; width: 46px; height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.conf i { display: block; height: 100%; background: var(--verde); }
.combo-lista { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; margin-top: 6px; color: #3b4b53; }
.resultados { margin-top: 10px; }
.resultados form { margin: 0; }
label.sel { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; cursor: pointer; margin: 0; font-weight: 600; }
label.sel input { width: auto; margin: 0; }
.js-buscar input { margin: 0; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cat-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .84rem; cursor: pointer; color: var(--ink); border-left: 3px solid #9fb0b7; }
.cat-btn:hover { border-color: var(--brand); }
.cat-btn.on { background: var(--brand-soft); border-color: var(--brand); font-weight: 700; }
.cat-btn.c-azul { border-left-color: #3b7bc4; } .cat-btn.c-morado { border-left-color: #6a5acd; } .cat-btn.c-ambar { border-left-color: var(--ambar); } .cat-btn.c-naranja { border-left-color: #d9681a; }
.fila-ref { display: flex; gap: 8px; margin: 0 0 10px; }
.fila-ref input { margin: 0; flex: 1; }
.crear-regla summary { cursor: pointer; font-size: .86rem; color: var(--brand); font-weight: 600; }
.crear-regla form { margin-top: 10px; background: #f8fafb; padding: 10px; border-radius: 8px; }
.crear-regla label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #10262e; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast-error { background: var(--rojo); }
.masivo { position: sticky; top: 64px; z-index: 5; background: #10262e; color: #fff; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.masivo[hidden] { display: none; }

/* Importar */
.zona { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 38px 16px; border: 2px dashed #b9c9cf; border-radius: 12px; background: #f8fbfc; cursor: pointer; text-align: center; margin: 0 !important; transition: border-color .15s, background .15s; }
.zona:hover, .zona.sobre { border-color: var(--brand); background: var(--brand-soft); }
.zona input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zona b { font-size: 1.05rem; color: var(--ink); }
.tipos-arch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.tipos-arch div { font-size: .88rem; }
.tipos-arch b { display: block; margin-bottom: 4px; }
.tipos-arch span { color: var(--muted); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.res-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfc; }
.res-grid b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.res-grid span { font-size: .82rem; color: var(--muted); }
.res-grid .res-ok { border-color: #9fdcb5; background: #f1fbf4; }
.res-grid .res-mal { border-color: #f3c2bc; background: #fdf1ef; }
.prev { max-height: 420px; display: block; overflow: auto; margin: 10px 0; }
.resultado { border-left: 4px solid var(--verde); }

/* Resumen */
.cuentas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.saldo-g { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tabla-meses td { vertical-align: middle; }
.bienvenida ol { padding-left: 20px; line-height: 1.6; }
.bienvenida li { margin-bottom: 6px; }
.fila-regla { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.fila-regla label { margin: 0; flex: 1 1 160px; }
.fila-cat { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.fila-cat input:not([type=checkbox]) { flex: 1 1 200px; margin: 0; }
.fila-cat select { width: auto; margin: 0; }
.cuenta-f { border-bottom: 1px solid var(--line-2); padding-bottom: 10px; margin-bottom: 10px; }
.barra-fija { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.tabla-seguras td { vertical-align: middle; }
.tabla-seguras input[type=checkbox] { width: 18px; height: 18px; margin: 0; }

@media (max-width: 960px) {
  .conc { grid-template-columns: 1fr; }
  .conc-lista { max-height: none; position: static; }
  .conc-panel { display: none; }
  .conc.panel-abierto .conc-panel { display: block; position: fixed; inset: 56px 0 0 0; max-height: none; border-radius: 0; z-index: 30; }
  .panel-cerrar { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #f3f6f7; padding: 12px 16px; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; position: sticky; top: 0; z-index: 2; }
  .tipos-arch { grid-template-columns: 1fr; }
  .atajos { display: none; }
}
@media (max-width: 760px) {
  .mv-row { grid-template-columns: 50px minmax(0, 1fr) auto; }
  .tabla-seguras td:first-child::before { content: none; }
}
.ok-p { background: #e8f6ee; color: #155e36; padding: 8px 10px; border-radius: 8px; font-size: .86rem; margin: 8px 0 0; }
.logo-fila { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 180px; height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; padding: 8px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Fotos del ticket */
#fotos.sobre { outline: 2px dashed var(--brand); outline-offset: -6px; background: var(--brand-soft); }
.fotos-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fotos-cab h2 { margin: 0; }
.fotos-btns { display: flex; gap: 6px; }
.fotos-btns label { margin: 0; cursor: pointer; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.foto { position: relative; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; user-select: none; transition: box-shadow .15s; }
.foto.fuera { opacity: .55; }
.foto.arrastrando { z-index: 20; box-shadow: 0 14px 34px rgba(16,34,41,.3); opacity: .95; transition: none; cursor: grabbing; }
.foto-img { display: block; aspect-ratio: var(--foto-aspecto, 4 / 3); background: #eef2f4; cursor: grab; }
.foto-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.foto-num { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: .78rem; display: grid; place-items: center; }
.foto.fuera .foto-num { background: #7c8a91; font-weight: 600; }
.foto-asa { position: absolute; top: 6px; right: 34px; width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.9); display: grid; place-items: center; cursor: grab; touch-action: none; font-size: 1rem; color: #3b4b53; }
.foto-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: rgba(255,255,255,.9); color: var(--rojo); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.foto-pie { border: 0; border-top: 1px solid var(--line-2); border-radius: 0; margin: 0; font-size: .8rem; padding: 6px 8px; }
.fotos-drop { margin-top: 10px; border: 2px dashed #c6d3d8; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); font-size: .9rem; }
.fotos-drop.chico { padding: 8px; font-size: .8rem; }
.fotos-estado { min-height: 1.2em; margin-top: 6px; }
body.sin-seleccion { user-select: none; cursor: grabbing; }
@media (pointer: fine) { .foto-asa { display: none; } }
.cuenta tr.sub-t td { border-bottom: 0; padding: 3px 0; color: #3b4b53; }
.iva-toggle { margin: 0; }
.iva-toggle label.check { margin: 0; font-weight: 500; font-size: .92rem; }
.iva-fila { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.iva-fila label.check { margin: 0; }
.iva-resumen { font-size: .9rem; color: #3b4b53; }

/* ===================================================== Menú lateral (v6) */
.topbar { display: none; }
body.con-menu .top { display: none; }
.side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--top); color: #c7d6db; display: flex; flex-direction: column; z-index: 40; }
.side-marca { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; color: #fff; font-weight: 600; letter-spacing: .04em; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-marca:hover { text-decoration: none; }
.side-marca img { max-height: 32px; max-width: 70px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.side-marca b { color: #7fd1d8; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-sec { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #6f8b94; font-weight: 700; padding: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #c7d6db; font-size: .92rem; margin-bottom: 1px; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side-nav a.on { background: rgba(127,209,216,.14); color: #fff; box-shadow: inset 3px 0 0 #3fc1cb; }
.side-nav a.side-cta { background: #14a3ad; color: #fff; font-weight: 700; margin: 4px 0 6px; }
.side-nav a.side-cta:hover { background: #1bb7c2; }
.ico { width: 19px; height: 19px; flex: none; }
.side-user { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.side-user > a:first-child { flex: 1; display: flex; align-items: center; gap: 10px; color: #e3eef1; padding: 6px; border-radius: 8px; min-width: 0; }
.side-user > a:first-child:hover, .side-user > a.on { background: rgba(255,255,255,.07); text-decoration: none; }
.side-user small { display: block; color: #6f8b94; font-size: .74rem; }
.side-user span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #14a3ad, #0e5e6f); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.side-salir { color: #8fa6ad; padding: 8px; border-radius: 8px; display: grid; }
.side-salir:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-velo { display: none; }
body.con-menu .main { margin-left: 236px; max-width: none; padding: 24px 28px 60px; }
body.con-menu .main > * { max-width: 1320px; }
body.ancho-completo .main > * { max-width: none; }
body.con-menu .conc-lista, body.con-menu .conc-panel { top: 16px; }
body.con-menu .conc-lista { max-height: calc(100vh - 32px); }
body.con-menu .conc-panel { max-height: calc(100vh - 32px); }
@media (max-width: 960px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; height: 54px; align-items: center; gap: 12px; padding: 0 12px; background: var(--top); color: #fff; }
  .topbar .marca { flex: 1; }
  .topbar .menu-btn { display: block; margin: 0; }
  .side { transform: translateX(-100%); transition: transform .2s ease; width: 270px; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-abierto .side { transform: none; }
  body.nav-abierto .side-velo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  body.con-menu .main { margin-left: 0; padding: 16px 16px 60px; }
  body.con-menu .conc-lista, body.con-menu .conc-panel { top: 66px; }
  .conc.panel-abierto .conc-panel { inset: 54px 0 0 0 !important; }
}

/* ===================================================== Comercial (v6) */
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on:hover { color: #fff; }
a.chip:hover { text-decoration: none; }
.btn-grande { padding: 12px 18px; font-size: 1rem; font-weight: 700; }
fieldset.sin-borde { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.sin-borde:disabled input, fieldset.sin-borde:disabled select, fieldset.sin-borde:disabled textarea { background: #f8fafb; color: #3b4b53; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.kpi small { display: block; margin-top: 2px; font-size: .78rem; }
.kpi-rojo, .kpi-rojo:hover { border-top-color: var(--rojo); }
.kpi-txt { font-size: 1.05rem !important; }
.tabs-card { margin: 0 0 14px; }
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: .8rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 6px; }
.h3-chico { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.var { font-weight: 700; font-size: .76rem; }
.var-up { color: var(--verde); }
.var-down { color: var(--rojo); }

/* Lista de productos */
.td-img { width: 52px; }
.td-img img, .sin-img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--line-2); color: #9fb0b7; border: 1px solid var(--line-2); }
.sin-img .ico { width: 20px; height: 20px; }
.tabla-prod td { vertical-align: middle; }

/* Ficha de producto */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #f8fafb; margin-bottom: 14px; gap: 2px; }
.seg label { margin: 0 !important; padding: 6px 16px; border-radius: 7px; cursor: pointer; font-size: .9rem !important; color: var(--muted) !important; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: #fff; color: var(--ink) !important; box-shadow: 0 1px 3px rgba(16,34,41,.12); }
.precio-grid .input-pre { max-width: none; }
.margen { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; background: var(--brand-soft); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: .86rem; color: #3b4b53; }
.margen b { font-size: 1.1rem; color: var(--ink); }
.margen b.neg { color: var(--rojo); }
.ac { position: relative; }
.ac-clave { text-transform: uppercase; }
.ac-desc { font-size: .82rem; color: var(--verde); font-weight: 600; min-height: 1.2em; margin-top: 3px; }
.ac-desc:empty::before { content: 'Sin clave seleccionada'; color: var(--muted); font-weight: 400; }
.ac-lista { position: absolute; left: 0; right: 0; top: 46px; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 26px rgba(16,34,41,.16); max-height: 300px; overflow-y: auto; }
.ac-lista button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; font: inherit; font-size: .88rem; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.ac-lista button:hover, .ac-lista button.on { background: var(--brand-soft); }
.ac-lista b { color: var(--brand); margin-right: 4px; }
.ac-vacio { padding: 10px 12px; color: var(--muted); font-size: .86rem; }
.chips-sat { display: flex; flex-wrap: wrap; gap: 5px; margin: -4px 0 14px; }
.chips-sat .chip { font-size: .76rem; padding: 3px 9px; }
.prod-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.prod-img { position: relative; border: 2px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; }
.prod-img.principal { border-color: var(--brand); }
.prod-img img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.prod-img-acc { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px; background: #f8fafb; border-top: 1px solid var(--line-2); }
.prod-img-acc .btn-chico { padding: 2px 6px; font-size: .72rem; }
.prod-img-acc .badge { font-size: .66rem; padding: 2px 6px; }
.zona-chica { display: flex !important; flex-direction: column; align-items: center; gap: 2px; border: 2px dashed #c6d3d8; border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; color: var(--brand) !important; margin: 0 !important; }
.zona-chica:hover { border-color: var(--brand); background: var(--brand-soft); }
.zona-chica input { display: none; }
.existencia-g { background: #e8f6ee; color: #155e36; border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; }
.existencia-g b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.existencia-g.baja { background: #fdecea; color: #8f2318; }

/* Buscador de productos */
.busca-prod { position: relative; margin-bottom: 12px; }
.busca-prod input { margin: 0; background: #f8fafb; }
.sug-prod { max-height: 380px; overflow-y: auto; }
.sug-prod button { display: flex; align-items: center; gap: 10px; }
.sug-prod img, .sin-img-ch { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line-2); }
.sug-prod em { margin-left: auto; font-style: normal; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Editor de partidas */
.tabla-partidas { width: 100%; border-collapse: collapse; min-width: 720px; }
.tabla-partidas th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); font-weight: 700; }
.tabla-partidas th small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tabla-partidas td { padding: 8px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tabla-partidas tr.vacia td { padding: 22px 6px; text-align: center; }
.tabla-partidas input, .tabla-partidas select, .tabla-partidas textarea { margin: 0; padding: 7px 8px; font-size: .9rem; }
.tabla-partidas small { display: block; margin-top: 3px; font-size: .74rem; }
.tabla-partidas td.imp { padding-top: 15px; font-weight: 600; }
.p-img { width: 48px; }
.p-img img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; display: block; }
.p-desc { min-width: 240px; }
.p-desc textarea { resize: vertical; line-height: 1.35; }
.p-acc { white-space: nowrap; padding-top: 12px !important; }
.in-num { width: 92px !important; text-align: right; }
.in-pct { width: 70px !important; }
.totales-card .tot-fila, .pos-tot .tot-fila { display: flex; justify-content: space-between; padding: 5px 0; font-size: .95rem; }
.tot-fila b { font-variant-numeric: tabular-nums; }
.tot-desc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.desc-in { display: flex; width: 150px; }
.desc-in input { margin: 0; border-radius: 8px 0 0 8px; text-align: right; padding: 7px 8px; }
.desc-in select { margin: 0; width: 66px; flex: none; border-radius: 0 8px 8px 0; border-left: 0; padding: 7px 4px; }
.tot-gran { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px !important; font-size: 1.25rem !important; font-weight: 800; }
.estado-cot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.estado-cot .chip { padding: 5px 12px; }

/* ---------- Punto de venta */
body.ancho-completo.con-menu .main { padding: 16px 18px 16px; }
.pos-app { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; height: calc(100vh - 32px); min-height: 520px; }
.pos-cat { display: flex; flex-direction: column; min-height: 0; }
.pos-busca input { margin: 0; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px; box-shadow: var(--sombra); }
.pos-chips { display: flex; gap: 6px; padding: 10px 0; overflow-x: auto; scrollbar-width: none; flex: none; }
.pos-chips .chip { white-space: nowrap; padding: 6px 13px; background: #fff; }
.pos-chips .chip.on { background: var(--brand); }
.chip-libre { border-style: dashed !important; color: var(--brand); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 20px; }
.pc { display: flex; flex-direction: column; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: var(--ink); transition: transform .08s, box-shadow .12s, border-color .12s; box-shadow: var(--sombra); }
.pc:hover { border-color: #14a3ad; box-shadow: 0 6px 18px rgba(16,34,41,.1); }
.pc:active { transform: scale(.97); }
.pc-img { aspect-ratio: 4 / 3; background: #f3f6f7; display: grid; place-items: center; overflow: hidden; }
.pc-img img { width: 100%; height: 100%; object-fit: contain; }
.pc-img i { font-style: normal; font-size: 2rem; font-weight: 800; color: #b9c8ce; }
.pc-nom { padding: 8px 10px 2px; font-size: .86rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pc-pie { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 4px 10px 9px; margin-top: auto; }
.pc-pie b { color: var(--brand); font-variant-numeric: tabular-nums; }
.pc-pie small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-agotado { opacity: .6; }
.pc-agotado .pc-pie small { color: var(--rojo); font-weight: 700; }
.pos-sin { grid-column: 1 / -1; text-align: center; padding: 30px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pos-carrito { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sombra); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pos-cli { position: relative; border-bottom: 1px solid var(--line); padding: 10px 12px; flex: none; }
.pos-cli-sel { display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 8px; padding: 4px; }
.pos-cli-sel:hover { background: #f8fafb; }
.pos-cli-sel > div { flex: 1; min-width: 0; }
.pos-cli-sel b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-cli-sel small { color: var(--muted); font-size: .78rem; }
.avatar-s { width: 34px; height: 34px; background: var(--line-2); font-size: 1rem; }
.pos-cli-busca { position: relative; padding-top: 6px; }
.pos-cli-busca input { margin: 0 0 6px; }
.pos-cli-busca .sugerencias { top: 46px; }
.pos-lineas { flex: 1; overflow-y: auto; padding: 4px 0; }
.pos-vacio { height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; color: var(--muted); padding: 20px; }
.pos-vacio b { color: var(--ink); font-size: 1.05rem; }
.pl { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "img info x" "img cant tot"; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); align-items: center; }
.pl-img { grid-area: img; width: 40px; height: 40px; border-radius: 7px; background: var(--line-2); overflow: hidden; align-self: start; }
.pl-img img { width: 100%; height: 100%; object-fit: cover; }
.pl-info { grid-area: info; min-width: 0; }
.pl-info > b { display: block; font-size: .9rem; line-height: 1.25; }
.pl > .btn-x { grid-area: x; align-self: start; }
.pl-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; font-size: .78rem; color: var(--muted); }
.pl-sub label { display: inline-flex; align-items: center; gap: 2px; margin: 0; }
.pl-sub input { margin: 0; padding: 2px 5px; font-size: .8rem; border-color: transparent; background: #f3f6f7; border-radius: 5px; text-align: right; }
.pl-sub input:hover, .pl-sub input:focus { border-color: #cfd8dc; background: #fff; }
.pl-precio { width: 78px; }
.pl-desc { width: 48px; }
.pl-cant { grid-area: cant; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; width: max-content; overflow: hidden; }
.pl-cant button { width: 30px; height: 30px; border: 0; background: #f8fafb; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.pl-cant button:hover { background: var(--brand-soft); color: var(--brand); }
.pl-cant input { width: 52px; margin: 0; border: 0; border-radius: 0; text-align: center; padding: 4px 2px; font-weight: 700; -moz-appearance: textfield; }
.pl-cant input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pl-tot { grid-area: tot; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-tot small { display: block; color: var(--verde); font-size: .74rem; font-weight: 600; }
.pl-nuevo { animation: pl-flash .8s ease; }
@keyframes pl-flash { from { background: #dff3f5; } to { background: transparent; } }
.pos-tot { border-top: 1px solid var(--line); padding: 10px 14px 14px; background: #fbfcfc; flex: none; }
.pos-desc { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.pos-desc label { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.pos-tot .tot-fila { padding: 2px 0; font-size: .9rem; color: #3b4b53; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 8px; border-top: 1px dashed var(--line); margin-top: 4px; }
.pos-total span { font-weight: 700; }
.pos-total b { font-size: 1.9rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pos-op { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; font-size: .86rem; }
.pos-op label.check { margin: 0; flex: 1; }
.pos-tot textarea { margin: 0 0 8px; font-size: .88rem; }
.btn-cobrar { width: 100%; padding: 14px; font-size: 1.15rem; font-weight: 800; border-radius: 10px; }
.btn-cobrar:disabled { opacity: .45; cursor: not-allowed; }
.caja-cerrada { position: fixed; inset: 0; z-index: 50; background: rgba(15,38,46,.55); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
body.con-menu .caja-cerrada { left: 236px; }
.caja-cerrada .card { width: 100%; max-width: 400px; padding: 22px 24px; }
.caja-cerrada .input-pre { max-width: none; }

/* Modales */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15,38,46,.55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
body.con-modal { overflow: hidden; }
.modal-caja { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 440px; padding: 22px 22px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: modal-in .15s ease; }
@keyframes modal-in { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: #9fb0b7; cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-cobro { max-width: 520px; }
.cobro-total { text-align: center; margin-bottom: 14px; }
.cobro-total span { display: block; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.cobro-total b { font-size: 2.4rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cobro-formas { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-bottom: 12px; }
.forma-btn { border: 1px solid var(--line); background: #f8fafb; border-radius: 9px; padding: 11px 8px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.forma-btn:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.forma-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.forma-credito { border-style: dashed; }
.cobro-pagos { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pago-fila { display: grid; grid-template-columns: 110px 120px minmax(0, 1fr) 24px; gap: 6px; align-items: center; font-size: .9rem; font-weight: 600; }
.pago-fila input { margin: 0; padding: 8px; }
.pago-fila .pg-monto { text-align: right; font-weight: 700; font-size: 1rem; }
.cobro-rapidos { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 10px; }
.cobro-rapidos .chip { font-weight: 600; padding: 6px 11px; }
.cobro-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 12px; }
.cobro-resumen > div { background: #f3f6f7; border-radius: 9px; padding: 8px 10px; text-align: center; }
.cobro-resumen span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.cobro-resumen b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.cobro-resumen .falta { background: #fdecea; color: #8f2318; }
.cobro-resumen .cambio { background: #e8f6ee; color: #155e36; }
.modal-listo { text-align: center; max-width: 400px; }
.listo-ok { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: #e8f6ee; color: var(--verde); display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.modal-listo h2 { font-size: 1.1rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.listo-cambio { background: #e8f6ee; border-radius: 10px; padding: 10px; margin: 6px 0 14px; color: #155e36; }
.listo-cambio span { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.listo-cambio b { font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.listo-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.listo-acc .btn-primario { grid-column: 1 / -1; padding: 12px; font-size: 1rem; }

/* ---------- Ventas, caja, por cobrar */
.rango-fechas { display: flex; align-items: center; gap: 6px; }
.rango-fechas input { width: auto; margin: 0; padding: 7px 8px; }
.atajos-fecha { display: flex; gap: 4px; flex-wrap: wrap; }
.resumen-linea { display: flex; flex-wrap: wrap; gap: 6px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radio); padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; color: #3b4b53; }
.resumen-linea b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cuenta tr.anulado td { color: #9fb0b7; text-decoration: line-through; }
.tabla-corte tfoot td { padding: 10px 8px; border-top: 2px solid var(--ink); font-weight: 700; }
.corte-ef { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 12px; background: #f8fafb; border-radius: 10px; }
.corte-ef > div { display: flex; flex-direction: column; }
.corte-ef span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.corte-ef b { font-variant-numeric: tabular-nums; }
.corte-ef i { font-style: normal; color: #9fb0b7; font-weight: 700; font-size: 1.1rem; }
.corte-ef .res { margin-left: auto; background: var(--brand); color: #fff; padding: 6px 12px; border-radius: 8px; }
.corte-ef .res span { color: #bfe6ea; }
.corte-ef .res b { font-size: 1.2rem; }
.denoms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.denoms label { display: flex !important; align-items: center; margin: 0 !important; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.denoms span { flex: none; width: 54px; padding: 6px 4px; text-align: center; background: #f3f6f7; font-size: .78rem; font-weight: 700; }
.denoms input { border: 0; margin: 0; border-radius: 0; padding: 6px; text-align: right; min-width: 0; }
.dif-box { border-radius: 9px; padding: 0; margin: -4px 0 12px; font-weight: 700; text-align: center; }
.dif-box:not(:empty) { padding: 10px; }
.dif-box.ok { background: #e8f6ee; color: #155e36; }
.dif-box.mal { background: #fdecea; color: #8f2318; }
.dif-box.sobra { background: #fdf1d8; color: #6b4500; }
.corte-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); font-size: .88rem; border-radius: 6px; }
.corte-h:hover { background: #f8fafb; text-decoration: none; }
.corte-h.on { background: var(--brand-soft); }
.corte-h small { display: block; }

/* ---------- Configuración, facturación, importación */
.tabla-formas td { vertical-align: middle; }
.tabla-formas td.c { text-align: center; }
.tabla-formas input:not([type=checkbox]), .tabla-formas select { margin: 0; padding: 6px 8px; font-size: .88rem; }
.tabla-formas select { min-width: 190px; }
.in-sat { width: 110px !important; margin: 0 !important; padding: 6px 8px !important; }
.in-uni { width: 70px !important; }
.in-error { border-color: var(--rojo) !important; background: #fff6f5 !important; }
.pasos-lista { margin: 0 0 12px; padding-left: 20px; }
.pasos-lista li { margin-bottom: 6px; }
.tabla-ent input { margin: 0; padding: 6px 8px; width: 110px; text-align: right; }
.tabla-ent td { vertical-align: middle; }

/* ---------- Reportes y gráficas */
.graf-barras { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 220px; align-items: end; padding: 10px 0 0; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.graf-chica { height: 150px; }
.gb-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.gb-col::before { content: ''; position: absolute; inset: 0 -1px; border-radius: 4px; }
.gb-col:hover::before, .gb-col:focus::before { background: rgba(14,94,111,.06); }
.gb-barra { position: relative; width: 100%; max-width: 30px; background: #14a3ad; border-radius: 4px 4px 0 0; transition: background .12s; }
.gb-col.hoy .gb-barra { background: var(--brand); }
.gb-col:hover .gb-barra, .gb-col:focus .gb-barra { background: var(--brand-ink); }
.gb-eti { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); padding-top: 4px; white-space: nowrap; text-align: center; line-height: 1.15; }
.gb-col.hoy .gb-eti { color: var(--ink); font-weight: 700; }
.gb-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--top); color: #dce8eb; font-size: .76rem; padding: 6px 9px; border-radius: 7px; white-space: nowrap; z-index: 5; pointer-events: none; line-height: 1.35; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.gb-tip b { display: block; color: #fff; font-size: .9rem; }
.gb-col:hover .gb-tip, .gb-col:focus .gb-tip { display: block; bottom: auto; top: 0; transform: translate(-50%, -105%); }
.gb-col:first-child .gb-tip, .gb-col:nth-child(2) .gb-tip { left: 0; transform: translate(0, -105%); }
.gb-col:last-child .gb-tip, .gb-col:nth-last-child(2) .gb-tip { left: auto; right: 0; transform: translate(0, -105%); }
.hb { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .88rem; color: var(--ink); }
a.hb:hover { text-decoration: none; background: #f8fafb; }
.hb-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-bar { height: 12px; background: var(--line-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: #14a3ad; border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-gris i { background: #9fb0b7; }
.hb > b { font-variant-numeric: tabular-nums; text-align: right; min-width: 70px; }
.rep-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Inicio */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h1 { margin-bottom: 0; }
.dash-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-kpis a { background: #f8fafb; border-radius: 9px; padding: 10px; color: var(--ink); border: 1px solid var(--line-2); }
.mini-kpis a:hover { text-decoration: none; border-color: #b9c4c9; }
.mini-kpis b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mini-kpis span { font-size: .76rem; color: var(--muted); }
.mini-kpis .mk-verde { background: #e8f6ee; border-color: #b7e2c8; }
.mini-kpis .mk-rojo { background: #fdecea; border-color: #f3c2bc; }
.lista-dash a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); border-radius: 6px; }
.lista-dash a:last-child { border-bottom: 0; }
.lista-dash a:hover { background: #f8fafb; text-decoration: none; }
.ld-txt { flex: 1; min-width: 0; }
.ld-txt b, .ld-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-txt b { font-weight: 600; font-size: .9rem; }
.dash-caja.abierta { border-top: 3px solid var(--verde); }
.dash-caja.cerrada { border-top: 3px solid #9fb0b7; }
.dc-cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dc-cifras span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.dc-cifras b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.dash-pend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dash-pend a { background: #f8fafb; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px; color: var(--ink); }
.dash-pend a:hover { text-decoration: none; border-color: #b9c4c9; }
.dash-pend span { display: block; font-size: .76rem; color: var(--muted); }
.dash-pend b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.dash-pend small { display: block; font-size: .76rem; font-weight: 600; }

/* ---------- Responsivo comercial */
@media (max-width: 1180px) {
  .pos-app { grid-template-columns: minmax(0, 1fr) 360px; }
  .kpis-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  body.con-menu .caja-cerrada { left: 0; }
  .pos-app { grid-template-columns: 1fr; height: auto; }
  .pos-grid { max-height: 52vh; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .pos-carrito { position: sticky; bottom: 0; max-height: none; }
  .pos-lineas { max-height: 40vh; }
  .dash-grid, .rep-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kpis-3 { grid-template-columns: 1fr; }
  .kpis-4 { grid-template-columns: 1fr 1fr; }
  .mini-kpis { grid-template-columns: 1fr 1fr; }
  .denoms { grid-template-columns: 1fr 1fr; }
  .prod-imgs { grid-template-columns: repeat(2, 1fr); }
  .hb { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) auto; }
  .pago-fila { grid-template-columns: 1fr 1fr 24px; }
  .pago-fila .pg-ref { grid-column: 1 / 3; }
  .corte-ef .res { margin-left: 0; width: 100%; }
  .graf-barras { height: 160px; gap: 2px; }
  .gb-eti { font-size: .6rem; }
  .tabla-formas, .tabla-ent { min-width: 640px; }
  .listo-acc { grid-template-columns: 1fr; }
}
.cot-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 16px; align-items: start; }
.cot-grid > .card { height: calc(100% - 16px); }
.cot-grid > .totales-card { height: auto; }
@media (max-width: 960px) { .cot-grid { grid-template-columns: 1fr; } .cot-grid > .card { height: auto; } }
#editor-partidas .fotos-cab { margin-bottom: 10px; }
[hidden] { display: none !important; }
.dash-col, .dash-grid > *, .rep-grid2 > *, .cot-grid > * { min-width: 0; }
@media (max-width: 860px) { .t-grid-prod .t-side { order: 0; } }
.tabla th.num, .tabla-partidas th.num { text-align: right; }
button.side-salir { border: 0; background: none; cursor: pointer; font: inherit; }
.pos-app > *, .pos-busca { min-width: 0; }

/* ---------- Cobro de tickets en caja, refacciones y etiquetas (v8) */
.pos-origen { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 14px; background: var(--brand-soft); color: var(--brand-ink); font-size: .85rem; font-weight: 600; border-bottom: 1px solid var(--line); flex: none; }
.pos-tot .tot-anticipo { color: var(--verde); font-weight: 600; }
.pos-tot .tot-resta { font-size: 1.1rem; font-weight: 800; color: var(--ink); padding-bottom: 8px; }
.cobro-ticket { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #e8f6ee; border: 1px solid #b7e2c8; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.cobro-ticket.pendiente { background: var(--brand-soft); border-color: #b9dfe4; }
.cobro-ticket p { margin: 0; }
.ref-busca { position: relative; margin-bottom: 8px; }
.ref-busca input { margin: 0; }
.ref-busca .sugerencias { top: 44px; }
.ref-sel { display: flex; align-items: center; gap: 8px; background: #f3f6f7; border-radius: 8px; padding: 6px 10px; font-size: .86rem; margin-bottom: 8px; }
.ref-sel b { flex: 1; }
.chip-inv { font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 700; margin-left: 4px; white-space: nowrap; }

/* ---------- Instalaciones y agenda (v10) */
.mant-card { border-top: 3px solid var(--brand); }
.mant-card.vencido { border-top-color: var(--rojo); }
.mant-fila { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.mant-fila > div { background: #f8fafb; border-radius: 9px; padding: 9px 11px; }
.mant-fila b { display: block; font-size: 1.05rem; }
.mant-fila small { display: block; font-size: .76rem; }
.lbl-m { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.mant-acc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.form-programar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; align-items: end; margin-top: 10px; }
.form-programar .full { grid-column: 1 / 4; }
.form-programar .check { padding-bottom: 14px; }
.campos-tipo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.tabla-zonas { width: 100%; border-collapse: collapse; min-width: 900px; }
#programacion { margin-top: 16px; }
.tabla-zonas td:first-child input { min-width: 190px; }
.tabla-zonas th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); }
.tabla-zonas td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tabla-zonas input, .tabla-zonas select { margin: 0; padding: 6px 8px; font-size: .88rem; }
.tabla-zonas .in-riego { width: 120px; } .tabla-zonas .in-horas { width: 110px; }
.z-dias { white-space: nowrap; }
.z-dias select { width: auto; }
.z-chk { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.z-chk label { display: inline-flex !important; flex-direction: column; align-items: center; margin: 0 !important; font-size: .7rem; font-weight: 700; color: var(--muted); }
.z-chk input { margin: 2px 0 0; width: 16px; height: 16px; }
.bitacora li.bn-mantenimiento::before { background: var(--verde); }
.bitacora li.bn-programacion::before { background: #14a3ad; }
.bitacora li.bn-contacto::before, .bitacora li.bn-programado::before { background: var(--ambar); }
.bitacora li.bn-alta::before { background: var(--brand); }

/* Agenda */
.ag-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ag-nav { display: flex; align-items: center; gap: 6px; }
.ag-nav h2 { margin: 0 8px; font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--ink); min-width: 170px; text-align: center; }
.ag-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--sombra); }
.cal-h { background: #f3f6f7; padding: 7px 8px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.cal-d { min-height: 104px; padding: 5px 6px 6px; border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.cal-d:nth-child(7n + 1) { border-left: 0; }
.cal-d:hover { background: #fafcfc; text-decoration: none; }
.cal-d.fuera { background: #fafbfb; color: #a8b4b9; }
.cal-d.sel { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.cal-n { font-size: .82rem; font-weight: 700; }
.cal-d.hoy .cal-n { background: var(--brand); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.ev { font-size: .72rem; line-height: 1.25; padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #e3f1f3; color: #0b4a58; border-left: 3px solid var(--brand); }
.ev.hecho { background: #eef2f3; color: #7d8d93; border-left-color: #b9c4c9; text-decoration: line-through; }
.ev.mant { background: #fdf1d8; color: #6b4500; border-left-color: var(--ambar); }
.ev.mant.venc { background: #fdecea; color: #8f2318; border-left-color: var(--rojo); }
.ev-mas { font-size: .7rem; color: var(--muted); padding-left: 4px; }
.ag-dia h2 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 1.05rem; }
.ag-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.ag-item.mant { border-left: 4px solid var(--ambar); }
.ag-item.venc { border-left-color: var(--rojo); }
.ag-item.visita { border-left: 4px solid var(--brand); }
.ag-item.hecho { opacity: .65; }
.ag-hora { font-weight: 800; font-size: 1rem; margin-right: 6px; }
.ag-item p { margin: 3px 0; font-size: .86rem; }
.ag-acc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ag-ok { color: var(--verde); font-size: .8rem; font-weight: 700; }
.tareas li { margin-bottom: 6px; }
@media (max-width: 1100px) { .ag-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .mant-fila { grid-template-columns: 1fr 1fr; }
  .form-programar, .campos-tipo { grid-template-columns: 1fr; }
  .form-programar .full { grid-column: auto; }
  .cal-d { min-height: 58px; padding: 3px; }
  .ev { font-size: 0; height: 6px; padding: 0; border-left-width: 0; border-radius: 3px; }
  .cal-h { font-size: .62rem; padding: 5px 2px; }
}

/* Versión (v1.5) */
.side-ver { display: block; padding: 0 16px 10px; font-size: .72rem; color: #6f8b94; }
.side-ver:hover, .side-ver.on { color: #e3eef1; text-decoration: none; }
.ver-cab { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ver-num { font-size: 2rem; font-weight: 700; }
.ver-ok { color: #1a7f37; font-weight: 600; }
.ver-mal { color: #b42318; font-weight: 600; }
.ver-lista { margin: 6px 0 0; padding-left: 20px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.ver-hist { list-style: none; margin: 0; padding: 0; }
.ver-hist > li { padding: 12px 0; border-top: 1px solid var(--borde, #e3e8eb); }
.ver-hist > li:first-child { border-top: 0; padding-top: 0; }
.ver-hist ul { margin: 6px 0 0; padding-left: 20px; }
.ver-hist .actual { font-size: .72rem; background: #e6f4ea; color: #1a7f37; padding: 1px 8px; border-radius: 99px; margin-left: 6px; font-weight: 600; }
