/* Paleta Miga Fiel: amarillo, negro y blanco.
   --brand = amarillo para rellenos (botones, logo); --accent = dorado oscuro legible como texto sobre blanco. */
:root {
  --bg: #faf8f2; --surface: #ffffff; --surface-2: #fbf8ef; --border: #e9e3d3;
  --text: #15130f; --muted: #6b6558; --faint: #9a9384;
  --brand: #f5c116; --brand-ink: #111111; --accent: #8a5e00; --accent-2: #fff3c4;
  --good: #1f7a4d; --good-bg: #e2f3ea; --bad: #b3261e; --bad-bg: #fbe5e3; --warn: #8a4b00; --warn-bg: #ffe9cc;
  --bar: #1f1c17; --bar-hover: #f5c116; --shadow: 0 1px 2px rgba(30, 25, 10, .06), 0 4px 16px rgba(30, 25, 10, .05);
  --side-bg: #111111; --side-text: #f3efe4; --side-muted: #9d978a; --side-hover: #242018;
  --r: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e0c; --surface: #1a1814; --surface-2: #221f1a; --border: #36312a;
  --text: #f5f2ea; --muted: #b9b2a3; --faint: #8a8476;
  --brand: #f5c116; --brand-ink: #111111; --accent: #f5c116; --accent-2: #3a3015;
  --good: #6fd3a0; --good-bg: #173326; --bad: #ff8c84; --bad-bg: #3d1a18; --warn: #f2c25b; --warn-bg: #3a2d10;
  --bar: #f5c116; --bar-hover: #ffe27a; --shadow: none; color-scheme: dark;
    --side-bg: #080807; --side-hover: #1d1a14;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e0c; --surface: #1a1814; --surface-2: #221f1a; --border: #36312a;
  --text: #f5f2ea; --muted: #b9b2a3; --faint: #8a8476;
  --brand: #f5c116; --brand-ink: #111111; --accent: #f5c116; --accent-2: #3a3015;
  --good: #6fd3a0; --good-bg: #173326; --bad: #ff8c84; --bad-bg: #3d1a18; --warn: #f2c25b; --warn-bg: #3a2d10;
  --bar: #f5c116; --bar-hover: #ffe27a; --shadow: none; color-scheme: dark;
  --side-bg: #080807; --side-hover: #1d1a14;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--accent); }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* layout */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-bg); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 800; font-size: 19px; font-family: Georgia, "Times New Roman", serif; color: var(--brand); }
.login .brand { color: var(--text); }
.side .brand { justify-content: center; padding: 6px 8px 14px; text-decoration: none; }
.logo-side { display: block; width: 100%; max-width: 170px; height: auto; }
.login .brand { justify-content: center; padding: 0 0 18px; }
.logo-full { display: block; width: 100%; max-width: 260px; height: auto; }
.top-icon { display: none; width: 38px; height: 38px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--side-hover); }
.nav a.on { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--side-muted); padding: 14px 10px 4px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.main { padding: 22px 26px 60px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { flex: 1; min-width: 180px; }
.btn.menu-btn { display: none; }
.userbox { font-size: 12px; color: var(--side-muted); padding: 14px 10px 0; border-top: 1px solid #2c2820; margin-top: 14px; }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card > .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card > .hd h2 { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi.hl { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand), var(--shadow); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--text); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn.pri:hover { border-color: var(--brand-ink); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); box-shadow: 0 0 0 4px var(--accent-2); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: auto; }
label.f { display: block; font-size: 12px; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input, .inline select { width: auto; }
.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
tr.cancel td { color: var(--faint); text-decoration: line-through; }
tr.grp td { background: var(--accent-2); color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.vip { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.mayorista { background: var(--accent-2); color: var(--accent); border-color: transparent; }
.badge.ok { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs a.on { color: var(--text); border-color: var(--brand); font-weight: 600; }
.datenav { display: inline-flex; align-items: center; gap: 4px; }
.datenav input { width: 150px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.ok { background: var(--good-bg); color: var(--good); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.qty { width: 74px; text-align: right; padding: 5px 7px; }
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 16px; }
.prodrow { display: grid; grid-template-columns: 1fr 74px 96px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.prodrow.has { background: var(--accent-2); border-radius: 6px; padding: 3px 6px; }
.prodrow .c { font-weight: 600; font-size: 13px; }
.prodrow .p { font-size: 11px; color: var(--muted); }
.prodrow input.nota { padding: 5px 7px; font-size: 12px; }
.pgrid td, .pgrid th { padding: 3px 6px; }
.pgrid .qty { width: 62px; }
.pgrid .qty.has { background: var(--accent-2); border-color: var(--brand); font-weight: 600; }
.pgrid tr.has td:first-child b { color: var(--accent); }
.pgrid .nota { width: 130px; padding: 5px 7px; font-size: 12px; }
.lineahd { font-weight: 700; color: var(--accent); margin: 14px 0 4px; font-size: 12px; letter-spacing: .05em; }
.totalbar { position: sticky; bottom: -4vh; z-index: 2; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 0 calc(4vh + 6px); margin-top: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-card h3 { color: var(--accent); margin-bottom: 8px; letter-spacing: .04em; }
.prod-total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.libro th, .libro td { padding: 4px 6px; font-size: 12px; border: 1px solid var(--border); }
.libro td.has { background: var(--accent-2); font-weight: 600; }
.libro th:first-child, .libro td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 220px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart .gridline { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--bar); }
.chart .bar.on { fill: var(--bar-hover); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 9, 6, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 1020px; }
.modal .mh { display: flex; align-items: center; margin-bottom: 14px; }
.modal .mh h2 { flex: 1; font-size: 18px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 60; font-weight: 500; max-width: 90vw; }
.toast.err { background: var(--bad); color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side-bg); }
.login .card { border-top: 4px solid var(--brand); }
.login .card { width: 100%; max-width: 360px; padding: 28px; }
.login .brand { justify-content: center; font-size: 22px; padding-bottom: 20px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .btn.menu-btn { display: inline-flex; }
  .top-icon { display: block; }
  .main { padding: 14px 16px 60px; }
  .g2, .g3, .form { grid-template-columns: 1fr; }
  .kpi .v { font-size: 19px; }
  .hide-m { display: none; }
}
@media print {
  .side, .top .btns, .no-print, .menu-btn { display: none !important; }
  .app { display: block; } .main { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; color: #000; font-size: 12px; }
  td, th { padding: 3px 5px; }
}
.userbox a { color: var(--brand); }

/* ---------- versión simple ---------- */
.resumen-mes { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.resumen-mes > b { color: var(--text); font-size: 14px; }
.resumen-mes span b { color: var(--text); font-variant-numeric: tabular-nums; }
.hoy table td, .hoy table th { padding: 4px 6px; }
.hoy td.cli { font-weight: 600; white-space: nowrap; }
.hoy td.cli a { color: var(--text); text-decoration: none; }
.hoy td.cli a:hover { text-decoration: underline; }
.hoy tr.vacia td.cli, .hoy tr.vacia td.cli a { color: var(--faint); font-weight: 500; }
input.cell { padding: 5px 7px; text-align: right; font-variant-numeric: tabular-nums; }
input.cell.money { width: 104px; }
input.cell.bol { width: 52px; }
.cobro { display: inline-flex; gap: 4px; }
.cobro select { width: 70px; padding: 5px 4px; font-size: 12px; }
.hoy td.acc { white-space: nowrap; }
.accs { display: inline-flex; gap: 6px; align-items: center; }
.btn.fxbtn { padding: 4px 8px; }
.btn.var { max-width: 190px; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; font-weight: 400; color: var(--muted); }
.btn.var.has { color: var(--text); background: var(--accent-2); border-color: var(--brand); }
.hoy tr.ok td { animation: okflash 1s ease-out; }
@keyframes okflash { from { background: var(--good-bg); } to { background: transparent; } }
.hoy-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.lqh { font-size: 15px; } .lqh b { font-size: 22px; margin-left: 8px; font-variant-numeric: tabular-nums; } .lqh small { color: var(--muted); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 4px 18px; }
.vrow { display: grid; grid-template-columns: 96px 1fr; gap: 2px 8px; align-items: center; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.vrow span { font-weight: 600; font-size: 13px; }
.vrow input { padding: 5px 8px; }
.vrow input.has { background: var(--accent-2); border-color: var(--brand); font-weight: 600; }
.vrow input.bad { border-color: var(--bad); background: var(--bad-bg); }
.vrow small { grid-column: 2; color: var(--bad); font-size: 11px; }
.vrow small:empty { display: none; }
input.lc { width: 56px; padding: 3px 5px; text-align: right; border-color: transparent; background: transparent; border-radius: 4px; }
input.lc:hover { border-color: var(--border); }
input.lc.has { background: var(--accent-2); font-weight: 600; }
.libro { width: auto; min-width: 420px; }
.libro td { padding: 1px 2px; }
.libro td:first-child { padding: 3px 8px; white-space: nowrap; }
@media (max-width: 860px) {
  .hoy td.cli { position: sticky; left: 0; background: var(--surface); z-index: 1; }
  input.cell.money { width: 92px; }
}
@media print {
  input.cell, input.lc { border: 0; background: none; padding: 0; width: auto; }
  .cobro select { display: none; }
  .resumen-mes { display: none; }
}
[hidden] { display: none !important; }

/* edición directa en la tabla */
input.ie, select.ie { border-color: transparent; background: transparent; padding: 4px 6px; border-radius: 5px; min-width: 0; }
input.ie { width: 100%; }
input.ie.n { text-align: right; font-variant-numeric: tabular-nums; }
input.ie.b { font-weight: 600; }
select.ie { width: auto; cursor: pointer; }
tr:hover input.ie, tr:hover select.ie { border-color: var(--border); background: var(--surface); }
input.ie:focus, select.ie:focus { background: var(--surface); }
input.ie::placeholder { color: var(--faint); }
.ie.saved { animation: okflash 1s ease-out; }

/* ---------- Factura X ---------- */
body.solo-doc .side, body.solo-doc .top { display: none; }
body.solo-doc .app { grid-template-columns: 1fr; }
body.solo-doc .main { max-width: 820px; margin: 0 auto; }
.fx-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.fx-bar b { font-size: 18px; } .fx-bar .muted { flex: 1; }
.fx { background: #fff; color: #111; border: 1px solid #ddd; border-radius: 8px; padding: 22px 26px; margin-bottom: 22px; font-size: 13px; }
.fx-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; border-bottom: 2px solid #111; padding-bottom: 12px; }
.fx-emisor { display: flex; gap: 12px; align-items: center; line-height: 1.35; }
.fx-emisor img { width: 120px; height: auto; }
.fx-emisor b { font-size: 15px; }
.fx-letra { text-align: center; }
.fx-letra span { display: block; width: 54px; height: 54px; margin: 0 auto 4px; border: 2px solid #111; font: 700 36px/50px system-ui, sans-serif; }
.fx-letra small { display: block; max-width: 110px; font-size: 9px; line-height: 1.2; text-transform: uppercase; }
.fx-nro { text-align: right; line-height: 1.5; }
.fx-nro b { font-size: 16px; }
.fx-cli { display: flex; gap: 10px 28px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid #ccc; }
.fx-cli small { display: block; font-size: 10px; text-transform: uppercase; color: #666; }
.fx-cli b { font-size: 15px; }
.fx-items { margin: 10px 0; }
.fx-items th { background: #f3f3f3; color: #111; border-bottom: 1px solid #999; padding: 5px 6px; }
.fx-items td { padding: 4px 6px; border-bottom: 1px solid #e5e5e5; color: #111; }
.fx-items tbody tr:hover td { background: none; }
.fx-tot { display: flex; justify-content: flex-end; flex-direction: column; align-items: flex-end; gap: 6px; }
.fx-total { display: flex; gap: 18px; align-items: baseline; border: 2px solid #111; padding: 6px 12px; }
.fx-total b { font-size: 20px; }
.fx-tot table { width: auto; min-width: 260px; }
.fx-tot td { padding: 2px 6px; border: 0; color: #111; }
.fx-saldo td { font-weight: 700; border-top: 1px solid #111 !important; }
.fx-notas { margin: 10px 0 0; font-style: italic; }
.fx footer { margin-top: 14px; padding-top: 8px; border-top: 1px dashed #999; text-align: center; font-size: 10px; color: #555; }
@media (max-width: 600px) { .fx-head { grid-template-columns: 1fr; } .fx-nro { text-align: left; } .fx { padding: 16px; } }
@media print {
  body.solo-doc .main { max-width: none; }
  /* varias por hoja, separadas por una línea para cortar */
  .fx { border: 0; border-radius: 0; padding: 0 0 8mm; margin: 0 0 8mm; break-inside: avoid; border-bottom: 1px dashed #777; font-size: 11.5px; }
  .fx:last-of-type { border-bottom: 0; }
  .fx-emisor img { width: 100px; }
  .fx-items th { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Hoy ordenado ---------- */
.card.hoy { width: fit-content; max-width: 100%; }
#hoytb { width: auto; table-layout: fixed; }
#hoytb th { white-space: normal; line-height: 1.2; vertical-align: bottom; font-size: 11.5px; }
#hoytb td { padding: 3px 6px; }
#hoytb td.cli { overflow: hidden; text-overflow: ellipsis; }
#hoytb input.cell.money { width: 100%; }
#hoytb input.cell.bol { width: 44px; }
#hoytb select.cell.medio { width: 100%; padding: 5px 6px; font-size: 13px; }
#hoytb input.cell:disabled { background: var(--surface-2); color: var(--faint); }
#hoytb .btn.var { max-width: 190px; width: 100%; }
#hoytb tfoot td { white-space: nowrap; }
.hoy-ayuda { max-width: 980px; line-height: 1.6; margin-top: 8px; }
/* fichas */
.datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.datos small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.datos .full { grid-column: 1 / -1; }
.tcli input.ie { min-width: 90px; }
.filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filtros label.f { width: auto; min-width: 160px; }
.pcts { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.pcts label.f { width: 120px; }
.tprod input.ie.n { text-align: right; }
.fac-items select { min-width: 220px; }
.fac-tot { align-items: flex-end; }
input.lc.fac { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
@media (max-width: 860px) {
  .card.hoy { width: auto; }
  #hoytb { table-layout: auto; }
  #hoytb input.cell.money { width: 92px; }
  #hoytb select.cell.medio { width: 130px; }
}

/* ---------- ayuda ---------- */
.btn.ayuda-top { display: none; padding: 6px 10px; }
.nav-ayuda { margin-top: 4px; }
.modal.ayuda { max-width: 760px; max-height: 92vh; display: flex; flex-direction: column; }
.modal.ayuda .mb { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -6px; padding: 0 6px; }
.modal.ayuda .mf { margin-top: 10px; }
.ayuda-body details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.ayuda-body summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; }
.ayuda-body summary::-webkit-details-marker { display: none; }
.ayuda-body summary::after { content: '＋'; float: right; color: var(--muted); }
.ayuda-body details[open] summary::after { content: '－'; }
.ayuda-body details[open] summary { border-bottom: 1px solid var(--border); background: var(--accent-2); border-radius: 10px 10px 0 0; }
.ayuda-txt { padding: 4px 16px 10px; line-height: 1.55; }
.ayuda-txt ul { padding-left: 20px; margin: 6px 0; }
.ayuda-txt li { margin: 3px 0; }
.ayuda-precios { margin-top: 12px; font-size: 13px; line-height: 1.5; border-top: 1px solid var(--border); padding-top: 8px; }
.ayuda-precios p { margin: 4px 0; }
.pcts label.f { width: 150px; }
.pcts label.f:nth-child(4) { width: 210px; }
@media (max-width: 860px) {
  .btn.ayuda-top { display: inline-flex; }
  .modal.ayuda { padding: 14px; max-height: 94vh; }
}

/* ---------- 🔍 buscador de productos ---------- */
.combo { position: relative; display: flex; align-items: center; min-width: 220px; }
.combo .lupa { position: absolute; left: 9px; font-size: 13px; pointer-events: none; opacity: .75; }
.combo .combo-in { padding-left: 30px; padding-right: 28px; }
.combo .combo-x { position: absolute; right: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.combo .combo-x:hover { background: var(--surface-2); color: var(--text); }
.combo-list { position: fixed; z-index: 80; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; }
.combo-op { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.combo-op small { color: var(--muted); font-size: 11px; }
.combo-op.on, .combo-op:hover { background: var(--accent-2); }
.combo-op.todos { color: var(--muted); font-style: italic; }
.combo-vacio { padding: 10px; color: var(--muted); font-size: 13px; }
.td-combo { min-width: 240px; }
label.f.f-combo { min-width: 240px; }
label.f.f-combo .combo { margin-top: 4px; }

/* importes grandes en una sola línea */
.kpis { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
.kpi .v { white-space: nowrap; }

/* ingreso: ver la clave */
.clave-wrap { position: relative; display: block; margin-top: 4px; }
.clave-wrap input { padding-right: 42px; margin: 0; }
.ver-clave { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.ver-clave:hover { background: var(--surface-2); }
