/* Panel de cotizaciones — Alucema */
@font-face { font-family: Archivo; font-weight: 600; src: url("fonts/Archivo-SemiBold.ttf"); font-display: swap; }
@font-face { font-family: Archivo; font-weight: 700; src: url("fonts/Archivo-Bold.ttf"); font-display: swap; }
@font-face { font-family: Archivo; font-weight: 800; src: url("fonts/Archivo-ExtraBold.ttf"); font-display: swap; }
@font-face { font-family: Plex; font-weight: 400; src: url("fonts/IBMPlexSans-Regular.ttf"); font-display: swap; }
@font-face { font-family: Plex; font-weight: 500; src: url("fonts/IBMPlexSans-Medium.ttf"); font-display: swap; }
@font-face { font-family: Plex; font-weight: 600; src: url("fonts/IBMPlexSans-SemiBold.ttf"); font-display: swap; }
@font-face { font-family: PlexCond; font-weight: 500; src: url("fonts/IBMPlexSansCondensed-Medium.ttf"); font-display: swap; }
@font-face { font-family: PlexCond; font-weight: 600; src: url("fonts/IBMPlexSansCondensed-SemiBold.ttf"); font-display: swap; }

:root {
  --deep: #0B2C52; --mid: #3E6C96; --light: #9FC3DE; --bone: #F4F8FB; --ink: #1B2027;
  --muted: #5b6672; --line: rgba(11,44,82,.14); --line2: rgba(11,44,82,.24);
  --ok: #1e6b3a; --ok-bg: #e7f5ec; --warn: #8a5a00; --warn-bg: #fff4dc; --err: #b03224; --err-bg: #fdecea;
  --r: 3px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Plex, system-ui, sans-serif; font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bone); }
a { color: var(--mid); }
h1, h2, h3 { font-family: Archivo, system-ui, sans-serif; color: var(--deep); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
.eyebrow { font-family: PlexCond, sans-serif; font-weight: 600; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mid); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.c { text-align: center; }
.hidden { display: none !important; }

/* ---------- barra superior ---------- */
.top { background: var(--deep); color: #fff; position: sticky; top: 0; z-index: 30; }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand img { height: 26px; }
.brand b { font-family: Archivo; font-weight: 800; font-size: 17px; }
.brand span { font-family: PlexCond; font-weight: 600; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--light); display: block; margin-top: -2px; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #C9D8E4; text-decoration: none; font-family: PlexCond; font-weight: 600; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; padding: 8px 11px; border-radius: var(--r); white-space: nowrap; }
.nav a:hover, .nav a.on { color: #fff; background: rgba(255,255,255,.09); }
.who { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--light); flex-shrink: 0; }
.who form { margin: 0; }
.who button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: var(--r); padding: 5px 10px; font: inherit; cursor: pointer; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 26px 20px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .eyebrow { margin-bottom: 4px; }

/* ---------- avisos ---------- */
.flash { padding: 11px 14px; border-radius: var(--r); margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cb; }
.flash.error { background: var(--err-bg); color: var(--err); border-color: #f2c4bf; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca8; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: PlexCond; font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 15px; border-radius: var(--r); border: 1px solid var(--line2); background: #fff; color: var(--deep); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--mid); }
.btn.primary { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn.primary:hover { background: var(--mid); border-color: var(--mid); }
.btn.danger { color: var(--err); border-color: #f2c4bf; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- tarjetas ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; }
.card + .card { margin-top: 16px; }
.card.frame::before, .card.frame::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--mid); }
.card.frame::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.card.frame::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.card h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 76px; }

/* ---------- formularios ---------- */
label.f { display: block; }
label.f > span { display: block; font-family: PlexCond; font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--deep); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 10px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--light); outline-offset: 0; border-color: var(--mid); }
input.bad { border-color: var(--err); background: var(--err-bg); }
input.good { border-color: #74b98c; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.hint.bad { color: var(--err); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--deep); }
.fields { display: grid; gap: 12px; }

/* ---------- tablas ---------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { background: var(--deep); color: #fff; font-family: PlexCond; font-weight: 600; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; padding: 9px 10px; text-align: left; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fafcfe; }
.tbl a.code { font-family: Archivo; font-weight: 700; color: var(--deep); text-decoration: none; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }

/* tabla editable */
.edit { width: 100%; border-collapse: collapse; }
.edit th { font-family: PlexCond; font-weight: 600; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mid); text-align: left; padding: 6px 5px; border-bottom: 2px solid var(--deep); white-space: nowrap; }
.edit td { padding: 4px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
.edit input { padding: 6px 7px; font-size: 13.5px; }
.edit td.tot { text-align: right; font-variant-numeric: tabular-nums; padding-top: 10px; white-space: nowrap; font-weight: 500; }
.edit td.n { color: var(--mid); font-family: PlexCond; font-weight: 600; padding-top: 10px; width: 34px; }
.edit tr.grupo td { background: var(--bone); }
.edit tr.grupo input { font-family: PlexCond; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mid); }
.edit .acc { white-space: nowrap; width: 1%; }
.icon { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: var(--r); font-size: 15px; line-height: 1; }
.icon:hover { color: var(--deep); background: var(--bone); }
.icon.del:hover { color: var(--err); }
.sub { margin-top: 10px; }
.section-total { display: flex; justify-content: flex-end; gap: 14px; padding: 8px 5px 0; font-family: PlexCond; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; color: var(--mid); }
.section-total b { font-family: Plex; color: var(--deep); font-size: 14px; letter-spacing: 0; }

/* ---------- totales ---------- */
.totals { width: 100%; border-collapse: collapse; }
.totals td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.totals tr.total td { border: 0; padding-top: 12px; font-family: Archivo; font-weight: 800; color: var(--deep); font-size: 20px; }
.totals .lbl { color: var(--muted); }

/* ---------- chips de estado ---------- */
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { display: inline-block; font-family: PlexCond; font-weight: 600; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: var(--bone); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cb; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca8; }
.chip.blue { background: #e8f1f9; color: var(--mid); border-color: #c9dced; }
.chip.err { background: var(--err-bg); color: var(--err); border-color: #f2c4bf; }
.fmt { font-family: PlexCond; font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.fmt.nutrisco { color: #c4561a; }
.fmt.alucema { color: var(--mid); }

/* ---------- filtros ---------- */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.summary { display: flex; gap: 22px; margin: 4px 0 12px; font-size: 13.5px; color: var(--muted); }
.summary b { color: var(--deep); }

/* ---------- buscador de clientes ---------- */
.picker { position: relative; }
.results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line2); border-top: 0; max-height: 300px; overflow-y: auto; box-shadow: 0 12px 28px rgba(11,44,82,.14); }
.results button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 11px; cursor: pointer; font: inherit; }
.results button:hover, .results button.on { background: var(--bone); }
.results small { color: var(--muted); display: block; }
.results .new { color: var(--mid); font-weight: 600; }
.selected { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line2); background: var(--bone); padding: 10px 12px; border-radius: var(--r); }
.selected b { font-family: Archivo; color: var(--deep); }

/* ---------- modal ---------- */
dialog { border: 0; border-radius: 4px; padding: 0; width: min(620px, calc(100vw - 32px)); box-shadow: 0 30px 70px rgba(11,44,82,.35); }
dialog::backdrop { background: rgba(11,44,82,.45); }
dialog .mh { background: var(--deep); color: #fff; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; }
dialog .mh h2 { color: #fff; }
dialog .mb { padding: 20px; }
dialog .mf { padding: 0 20px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.err-box { background: var(--err-bg); color: var(--err); padding: 9px 12px; border-radius: var(--r); margin-bottom: 12px; font-size: 13.5px; }

/* ---------- itemizado ---------- */
details.box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-top: 16px; }
details.box > summary { cursor: pointer; padding: 15px 20px; font-family: Archivo; font-weight: 700; color: var(--deep); font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.box > summary::after { content: "＋"; color: var(--mid); }
details.box[open] > summary::after { content: "－"; }
details.box > .in { padding: 0 20px 20px; }
.partida { border: 1px solid var(--line2); border-radius: var(--r); margin-top: 14px; }
.partida-h { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; padding: 12px; background: var(--bone); align-items: end; }
.partida-b { padding: 10px 12px 12px; }
.partida-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); }
.partida-f .mono b { color: var(--deep); }

/* ---------- detalle ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-family: PlexCond; font-weight: 500; }
.kv dd { margin: 0; }
.track { display: grid; gap: 12px; }
.track .row, .row2 { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; min-height: 38px; }
.row2 { align-items: start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pago { display: flex; gap: 0; }
.pago label { flex: 1; }
.pago input { display: none; }
.pago span { display: block; text-align: center; padding: 8px; border: 1px solid var(--line2); cursor: pointer; font-family: PlexCond; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; color: var(--muted); }
.pago label:first-child span { border-radius: var(--r) 0 0 var(--r); }
.pago label:last-child span { border-radius: 0 var(--r) var(--r) 0; border-left: 0; }
.pago input:checked + span.p { background: var(--warn-bg); color: var(--warn); border-color: #f0dca8; }
.pago input:checked + span.g { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cb; }
.file-box { border: 1px dashed var(--line2); border-radius: var(--r); padding: 12px; background: var(--bone); }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.log li b { color: var(--ink); font-weight: 500; }
.big-code { font-family: Archivo; font-weight: 800; font-size: 28px; color: var(--deep); letter-spacing: .01em; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--deep); position: relative; overflow: hidden; padding: 20px; }
.login::before { content: ""; position: absolute; inset: 0; opacity: .1;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 48px 48px; }
.login .card { width: min(400px, 100%); padding: 32px; }
.login .brand { color: var(--deep); margin-bottom: 22px; }
.login .brand span { color: var(--mid); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty b { display: block; font-family: Archivo; color: var(--deep); font-size: 17px; margin-bottom: 6px; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .who span { display: none; }
  .track .row, .row2 { grid-template-columns: 1fr; }
  .file-box input[type=file] { max-width: 100%; }
  .head .btns .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: 1fr; }
  .partida-h { grid-template-columns: 1fr; }
  .top-in { gap: 10px; padding: 0 12px; }
  .brand span { display: none; }
  .wrap { padding: 18px 12px 50px; }
}
.tbl td.r, .tbl td.mono { white-space: nowrap; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e8833a; color: #fff; font-size: 11px; line-height: 18px; text-align: center; letter-spacing: 0; margin-left: 3px; }
.sol { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.sol + .sol { margin-top: 12px; }
.sol .msg { white-space: pre-wrap; background: var(--bone); border-left: 3px solid var(--light); padding: 10px 12px; margin-top: 10px; font-size: 14px; }
.sol .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.sol .meta a { color: var(--mid); }
.sol .acciones { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 190px; }
@media (max-width: 720px) { .sol { grid-template-columns: 1fr; } .sol .acciones { min-width: 0; } }

/* ---------- ayuda / manual ---------- */
.help { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.45); color: #fff; text-decoration: none; display: grid; place-items: center; font-family: Archivo; font-weight: 800; font-size: 14px; }
.help:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.print-only { display: none; }
.m-layout > * { min-width: 0; }
.m-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.m-toc { position: sticky; top: 76px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 10px; font-size: 13.5px; max-height: calc(100vh - 96px); overflow: auto; }
.m-toc b { font-family: PlexCond; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mid); }
.m-toc ol { margin: 8px 0 0; padding-left: 20px; }
.m-toc li { margin: 0 0 6px; color: var(--muted); }
.m-toc a { color: var(--deep); text-decoration: none; }
.m-toc a:hover { color: var(--mid); text-decoration: underline; }
.m-doc { max-width: 920px; font-size: 15px; line-height: 1.62; }
.m-doc section { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 26px 30px 18px; margin-bottom: 18px; scroll-margin-top: 76px; }
.m-doc h2 { font-size: 21px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.m-doc h2 span { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--deep); color: #fff; display: grid; place-items: center; font-size: 15px; }
.m-doc h3 { font-size: 16px; margin: 22px 0 6px; }
.m-doc p { margin: 8px 0; }
.m-doc ul, .m-doc ol { margin: 8px 0; padding-left: 22px; }
.m-doc li { margin: 4px 0; }
.m-doc code, .m-doc kbd { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bone); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }
.m-pasos > li::marker { font-family: Archivo; font-weight: 800; color: var(--deep); }
.m-num { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #E8742A; color: #fff; font: 700 12px/1 Arial, sans-serif; vertical-align: 1px; margin: 0 2px; }
.m-nota { background: var(--bone); border-left: 3px solid var(--light); padding: 8px 12px; font-size: 14px; color: var(--muted); }
.m-box { background: var(--bone); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 10px 0; }
.m-box p { margin: 4px 0 0; font-size: 14px; }
.m-box.warn { background: var(--warn-bg); border-color: #f0d9a6; }
.m-box.warn b { color: var(--warn); }
.m-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.m-fig { margin: 14px 0; }
.m-fig img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 6px 18px rgba(11,44,82,.08); }
.m-fig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-style: italic; }
.m-fig.chica img { max-width: 420px; }
.m-fig.movil img { max-width: 260px; }
.m-fig.borde img { border-color: var(--line2); }
.m-tbl { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.m-tbl th { text-align: left; font-family: PlexCond; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--deep); padding: 8px 10px; }
.m-tbl td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.m-tbl td.si { color: var(--ok); font-weight: 700; text-align: center; }
.m-tbl td.no { color: var(--muted); text-align: center; }
.m-tbl th:nth-child(n+2) { text-align: center; }
.m-doc b.ok { color: var(--ok); } .m-doc b.err { color: var(--err); }
.m-faq dt { font-family: Archivo; font-weight: 700; color: var(--deep); margin-top: 14px; }
.m-faq dd { margin: 4px 0 0; }
@media (max-width: 1000px) {
  .m-layout { grid-template-columns: minmax(0, 1fr); }
  .m-toc { position: static; max-height: none; }
  .m-cols { grid-template-columns: 1fr; }
  .m-doc section { padding: 20px 18px 12px; }
  .m-fig.chica img { max-width: 100%; }
}
@media print {
  @page { size: A4; margin: 14mm 13mm 16mm; }
  body { background: #fff; font-size: 12px; }
  .top, .no-print, .flash { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  .m-layout { display: block; }
  .m-doc { max-width: none; font-size: 12.5px; }
  .m-doc section { border: 0; padding: 0; margin: 0 0 8mm; break-before: page; }
  .m-doc section:first-child { break-before: auto; }
  .m-fig, .m-tbl tr, .m-box, .m-cols > * { break-inside: avoid; }
  .m-fig img { box-shadow: none; }
  .m-portada { break-after: page; text-align: center; padding-top: 70mm; }
  .m-portada img { height: 70px; margin-bottom: 18px; }
  .m-portada h1 { font-size: 34px; line-height: 1.15; margin: 10px 0 14px; }
  a { color: inherit; text-decoration: none; }
  .m-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 8mm; }
  .m-fig img { max-height: 115mm; width: auto; max-width: 100%; }
  .m-fig.chica img { max-width: 80mm !important; }
  .m-fig.movil img { max-width: 55mm !important; }
  .m-doc section { padding: 0 !important; }
  .m-doc h3 { break-after: avoid; }
}

/* ---- autoguardado de borradores y menú de gastos ---- */
.draft { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; border-radius: 20px; padding: 5px 12px; margin-right: 6px;
  color: var(--ok); background: var(--ok-bg); border: 1px solid #bfe3cb; }
.draft::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.draft.pend { color: var(--warn); background: var(--warn-bg); border-color: #f0dca8; }
.draft.err { color: var(--err); background: var(--err-bg); border-color: #f2c4bf; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 270px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 10px 28px rgba(11,44,82,.18); padding: 6px 0; }
.menu .mh { padding: 6px 14px; font-family: PlexCond; font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 14px; font: inherit; cursor: pointer; color: var(--ink, #1B2027); }
.menu button:hover { background: var(--bone); }
.menu button.otro { border-top: 1px solid var(--line); color: var(--mid); font-weight: 600; }
.edit tr.off td:not(.n):not(.acc) { opacity: .45; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input[type=text] { flex: 1; }
.calc-val { padding: 9px 0; font-weight: 600; color: var(--deep); font-variant-numeric: tabular-nums; }

/* Volver a la página pública */
.volver-web { color: #C9D8E4; text-decoration: none; font-family: PlexCond; font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: var(--r); white-space: nowrap; }
.volver-web:hover { color: #fff; background: rgba(255,255,255,.09); }
.login { align-content: center; justify-items: center; }
.volver-login { display: block; text-align: center; margin-top: 16px; color: #C9D8E4; text-decoration: none; font-size: 13px; font-family: PlexCond; letter-spacing: .06em; text-transform: uppercase; position: relative; }
.volver-login:hover { color: #fff; }

/* Vista previa del PDF */
.btn.preview { border-color: #2a6fb0; color: #2a6fb0; font-weight: 600; }
dialog.vista { width: min(860px, calc(100vw - 24px)); height: 92vh; }
dialog.vista[open] { display: flex; flex-direction: column; }
dialog.vista .mh { gap: 12px; flex-wrap: wrap; }
dialog.vista .mh h2 small { font-size: 12px; font-weight: 400; opacity: .75; margin-left: 8px; text-transform: none; letter-spacing: 0; }
.vista-cuerpo { flex: 1; min-height: 0; background: #6b7886; position: relative; }
.vista-cuerpo iframe { width: 100%; height: 100%; border: 0; display: block; }
#vista-carga { color: #fff; text-align: center; padding: 60px 20px; }
