/* Transportes Melean · demo de despacho de última milla.
   Identidad: azul marino del distintivo TM, papel cálido y serif clásica para títulos. */
:root {
  --navy: #0d1c6b; --navy-2: #1a2a86; --navy-ink: #0a1450;
  --ink: #161a2e; --muted: #626779; --line: #e2ddd1; --line-2: #ece8de;
  --paper: #f4f1ea; --card: #fff; --soft: #f7f5f0; --soft-2: #eeeae0;
  --ok: #157a52; --ok-bg: #e3f3ea; --bad: #c23b31; --bad-bg: #fbe8e5; --warn: #a86e05; --warn-bg: #fbf0d6;
  --info: #2f55e4; --info-bg: #e7ecfd;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 12px; --r-s: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.45 var(--sans); color: var(--ink); background: var(--paper); overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1, h2 { font-family: var(--serif); letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.xs { width: 12px; height: 12px; vertical-align: -2px; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.4; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .sm { font-size: 12.5px; }
.eyebrow { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #e3e7fb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 6px 18px; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.brand b { display: block; font-family: var(--serif); font-size: 17px; color: #fff; font-weight: 600; }
.brand span { font-size: 12px; color: #aab3e6; }
.navbtn { display: none; }
#nav { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
#nav a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 9px; color: #cdd3f3; text-decoration: none; font-weight: 500; }
#nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
#nav a.on { background: #fff; color: var(--navy); }
#nav a span { flex: 1; }
.nb { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--info); color: #fff; font-size: 11.5px; display: grid; place-items: center; }
.nb.warn { background: #e39b16; color: #241500; } .nb.soft { background: rgba(127,140,214,.35); color: inherit; }
#nav a.on .nb.soft { background: var(--info-bg); color: var(--navy); }
.side-foot { margin-top: auto; font-size: 12px; color: #9aa4dc; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.side-foot b { display: block; color: #fff; }

.main { min-width: 0; padding: 22px 26px 60px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.top-t { min-width: 0; flex: 1 1 320px; }
.top h1 { font-size: 28px; line-height: 1.15; color: var(--navy-ink); }
.top p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.top-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clock { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 12px; }
.clock-t { display: flex; flex-direction: column; line-height: 1.1; margin-right: 6px; min-width: 78px; }
.clock-t b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--navy); }
.clock-t small { font-size: 10.5px; color: var(--muted); }
.cbtn { height: 36px; min-width: 36px; border: 0; border-radius: 9px; background: var(--soft-2); display: grid; place-items: center; padding: 0 8px; font-weight: 600; font-size: 12.5px; }
.cbtn:hover { background: #e2ddd0; }
#playBtn { background: var(--navy); color: #fff; }
#playBtn .ic { fill: currentColor; stroke: none; }

/* ---------- botones y piezas comunes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font-weight: 600; text-align: center; }
.btn:hover:not(:disabled) { background: var(--navy-2); }
.btn.s { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn.s:hover:not(:disabled) { background: var(--soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn:disabled { opacity: .45; }
.btn.wide { width: 100%; }
.lnk { background: none; border: 0; padding: 0; color: var(--info); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.row-btn { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 19px; color: var(--navy-ink); }
.card-h > div { min-width: 0; flex: 1 1 220px; }
.card-h p { margin-top: 3px; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.seg { display: inline-flex; background: var(--soft-2); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--soft-2); color: var(--muted); white-space: nowrap; }
.pill.ok, .pill.st-entregado { background: var(--ok-bg); color: var(--ok); }
.pill.bad, .pill.st-fallido { background: var(--bad-bg); color: var(--bad); }
.pill.warn, .pill.st-en_base { background: var(--warn-bg); color: var(--warn); }
.pill.st-en_ruta { background: var(--info-bg); color: var(--info); }
.pill.done { background: var(--navy); color: #fff; } .pill.soft { background: var(--soft-2); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--soft-2); color: var(--ink); }
.tag .ic { width: 13px; height: 13px; }
.tag.cold { background: #e4f1fb; color: #165d8e; }
.vdot, .cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cdot { margin-right: 6px; vertical-align: 0; }
.mini { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--info-bg); color: var(--info); font-weight: 700; }
.hint { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; margin-top: 8px; color: var(--muted); }
.hint .ic { width: 16px; height: 16px; margin-top: 1px; }
.hint.ok { color: var(--ok); } .hint.bad { color: var(--bad); } .hint.warn { color: var(--warn); }
.empty { display: flex; gap: 8px; align-items: center; color: var(--muted); padding: 6px 0; }
.empty .ic { color: var(--ok); }
.note { background: var(--soft); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.note.bad { border-color: #efc2bc; background: var(--bad-bg); }
label { font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; font-size: 14px; font-weight: 400; }
textarea { resize: vertical; }
input.soft, select.soft { border-color: #e7c36a; background: #fffaf0; }
label > input, label > select, label > textarea { margin-top: 4px; display: block; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.inline select { margin: 0; width: auto; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.kpi b { display: block; font-family: var(--serif); font-size: 27px; color: var(--navy-ink); line-height: 1.1; font-weight: 600; }
.kpi b em { font-style: normal; font-size: 16px; color: var(--muted); }
.kpi span { display: block; font-weight: 600; margin-top: 2px; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.warn { border-color: #f0d28a; background: #fffbf0; }
.kpi.warn b { color: var(--warn); }

/* ---------- despacho ---------- */
.desp { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.side-col { display: grid; gap: 14px; min-width: 0; }
.qgrid { display: grid; grid-template-columns: 74px repeat(3, minmax(0, 1fr)); gap: 6px; }
.qh { background: var(--soft); border-radius: 9px; padding: 7px 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; }
.qh.corner { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.vh { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vh span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jsel select { min-height: 30px; padding: 3px 4px; width: auto; font-size: 12.5px; margin: 0; border-radius: 7px; }
.qt { padding: 6px 4px 6px 2px; display: flex; flex-direction: column; line-height: 1.15; border-top: 1px dashed var(--line); position: relative; }
.qt b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--navy-ink); }
.qt span { font-size: 11.5px; color: var(--muted); }
.qt small { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.qt em { font-style: normal; font-size: 10.5px; background: var(--info); color: #fff; border-radius: 5px; padding: 1px 5px; align-self: flex-start; margin-top: 4px; font-weight: 700; }
.qt.live b { color: var(--info); }
.qcell { background: var(--soft); border: 1px solid transparent; border-radius: 9px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-height: 72px; min-width: 0; transition: background .15s; }
.qcell.live { background: #eef2ff; border-color: #c7d3fb; }
.qcell.closed { background: #f3f2ee; }
.qcell.off { background: repeating-linear-gradient(135deg, #f1eee6 0 6px, #ebe7dc 6px 12px); color: var(--muted); font-size: 11.5px; justify-content: center; align-items: center; text-align: center; }
.qcell.over { background: var(--info-bg); border-color: var(--info); border-style: dashed; }
.cap { height: 4px; background: #e2ddd1; border-radius: 3px; overflow: hidden; }
.cap i { display: block; height: 100%; border-radius: 3px; }
.cap-t { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { color: var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 6px; font-size: 12px; min-width: 0; width: 100%; border-left-width: 3px; }
.chip b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip span { color: var(--muted); white-space: nowrap; font-size: 11px; }
.chip small { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { border-color: #b8b2a3; }
.chip.st-entregado { border-left-color: var(--ok); background: #f6fbf8; }
.chip.st-entregado b { color: #3f5b4c; }
.chip.st-en_ruta { border-left-color: var(--info); }
.chip.st-pendiente { border-left-color: #b9b3a5; }
.chip.st-fallido, .chip.st-en_base { border-left-color: var(--bad); background: var(--bad-bg); }
.chip.redel { border-left-color: #e39b16; background: #fff8e6; }
.chip.late { box-shadow: inset 0 0 0 1px var(--bad); }
.chip.fresh { animation: fresh 1.6s ease 3; }
@keyframes fresh { 50% { background: #dfe7ff; border-color: var(--info); } }
.chip[draggable="true"] { cursor: grab; }
.chip.dragging { opacity: .4; }
.tray { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bad-bg); color: var(--bad); padding: 8px; border-radius: 9px; margin-bottom: 10px; font-weight: 600; }
.tray .chip { width: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.lg { width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 1px solid var(--line); border-left: 3px solid; }
.lg.st-entregado { border-left-color: var(--ok); } .lg.st-en_ruta { border-left-color: var(--info); } .lg.st-pendiente { border-left-color: #b9b3a5; }
.lg.st-fallido { border-left-color: var(--bad); background: var(--bad-bg); } .lg.redel { border-left-color: #e39b16; background: #fff8e6; }

/* mapa */
.map { width: 100%; height: auto; display: block; border-radius: 10px; background: #ebe7dc; aspect-ratio: 32 / 28; }
.m-bg { fill: #ece8de; }
.m-ring2 { fill: #f2efe7; stroke: #d6d0c1; stroke-width: 3; }
.m-ring { fill: #f7f5ef; stroke: #cfc8b6; stroke-width: 3.2; }
.m-river { fill: none; stroke: #b8d3e6; stroke-width: 4.5; stroke-linecap: round; }
.m-road { stroke: #ddd6c6; stroke-width: 2; fill: none; }
.m-lbl { font: 600 6.2px var(--sans); fill: #a49d8c; letter-spacing: .06em; text-anchor: middle; }
.m-road-l { font: 700 6.5px var(--sans); fill: #9d9480; }
.m-route { fill: none; stroke-width: 1.3; stroke-opacity: .32; stroke-dasharray: 3 2; }
.m-route.live { stroke-width: 2.2; stroke-opacity: .85; stroke-dasharray: none; }
.m-stop circle { fill: #fff; stroke: var(--c); stroke-width: 1.6; cursor: pointer; }
.m-stop.st-entregado circle { fill: var(--c); }
.m-stop.st-fallido circle, .m-stop.st-en_base circle { fill: #fff; stroke: var(--bad); stroke-width: 2.2; }
.m-stop.hl circle { stroke-width: 2.6; fill: #fff6d6; }
.m-new { fill: none; stroke: var(--info); stroke-width: 1.5; }
.m-base rect { fill: var(--navy); }
.m-base text { font: 700 6.5px var(--serif); fill: #fff; text-anchor: middle; }
.m-van circle { stroke: #fff; stroke-width: 1.5; }
.m-van .pulse { stroke: none; opacity: .25; animation: pulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.m-van text { font: 700 7px var(--sans); fill: #fff; text-anchor: middle; }
@keyframes pulse { from { transform: scale(.7); opacity: .45; } to { transform: scale(1.8); opacity: 0; } }
.vlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.vlist li { display: flex; gap: 9px; align-items: center; padding: 7px 9px; background: var(--soft); border-radius: 9px; }
.vlist li > div { flex: 1; min-width: 0; }
.vlist b { display: block; font-size: 13px; }
.vlist span { font-size: 12px; color: var(--muted); }
.vlist em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alerts li { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--soft); }
.alerts li span { flex: 1; min-width: 0; }
.alerts li.bad { background: var(--bad-bg); color: var(--bad); }
.alerts li.warn { background: var(--warn-bg); color: #7a5104; }
.alerts li.info { background: var(--info-bg); color: #233f9e; }
.feed, .trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed li, .trace li { display: grid; grid-template-columns: minmax(44px, auto) minmax(0, 1fr); gap: 8px; padding: 6px 0 6px 12px; border-left: 2px solid var(--line-2); position: relative; font-size: 13px; }
.feed li::before, .trace li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: #c9c2b2; }
.feed time, .trace time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.k-ok::before { background: var(--ok) !important; } .k-bad::before { background: var(--bad) !important; } .k-warn::before { background: #e39b16 !important; }
.k-as::before { background: var(--info) !important; } .k-in::before { background: #8a6ad6 !important; }

/* ---------- drawer y modal ---------- */
.drawer-bg, .modal-bg { position: fixed; inset: 0; background: rgba(10,16,48,.38); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--card); z-index: 41; transform: translateX(102%); transition: transform .25s ease; overflow-y: auto; padding: 20px; box-shadow: -10px 0 30px rgba(0,0,0,.1); }
.drawer-open .drawer { transform: none; } .drawer-open .drawer-bg { opacity: 1; pointer-events: auto; }
.dr-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dr-head h2 { font-size: 22px; color: var(--navy-ink); margin-top: 2px; }
.dr-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0; }
.facts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.reassign { background: var(--soft); border-radius: 10px; padding: 12px; margin: 14px 0; }
.reassign h3 { margin-top: 0 !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pod { background: var(--soft); border-radius: 10px; padding: 10px; margin: 12px 0; }
.pod img, .pod svg { width: 100%; max-height: 150px; object-fit: contain; display: block; background: #fff; border-radius: 8px; }
.pod p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.sig path { fill: none; stroke: #0d1c55; stroke-width: 2; stroke-linecap: round; }
.sig .sig-line { stroke: #d7d1c3; stroke-width: 1; }
.modal-bg { display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; transform: translateY(8px); transition: transform .2s; }
.modal.wide { width: min(820px, 100%); }
.modal-open .modal-bg { opacity: 1; pointer-events: auto; } .modal-open .modal { transform: none; }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.modal-h .row-btn { margin: 0; }
.console { list-style: none; margin: 12px 0; padding: 12px; background: #0e1430; color: #c9d1f5; border-radius: 10px; font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; min-height: 120px; }
.console li { display: flex; gap: 10px; } .console time { color: #7f8bc4; } .console li.ok { color: #7fe0ad; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100% - 24px)); }
.toast { background: var(--navy-ink); color: #fff; padding: 11px 14px; border-radius: 11px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: tin .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok { background: #0f5f40; } .toast.bad { background: #9c2c24; } .toast.warn { background: #7a5104; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- entrada ---------- */
.entrada { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.mails { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.mail { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; }
.mail > div { min-width: 0; }
.mail b { display: block; font-size: 13.5px; }
.mail span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mail em { grid-column: 2 / -1; font-style: normal; font-size: 11px; font-weight: 700; justify-self: start; padding: 1px 7px; border-radius: 5px; background: var(--soft-2); color: var(--muted); }
.mail.ms-nuevo { border-color: #c7d3fb; background: #f8faff; } .mail.ms-nuevo em { background: var(--info-bg); color: var(--info); }
.mail.ms-revision em { background: var(--warn-bg); color: var(--warn); }
.mail.ms-asignado em { background: var(--ok-bg); color: var(--ok); }
.mail.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.detail.empty-d { display: grid; place-items: center; text-align: center; min-height: 320px; color: var(--muted); }
.detail.empty-d h2 { color: var(--navy-ink); margin: 8px 0 6px; }
.detail.empty-d p { max-width: 44ch; }
.mailbody { background: var(--soft); border-radius: 10px; padding: 14px; line-height: 1.6; }
.attach { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px dashed #c7c0ae; border-radius: 10px; padding: 12px; margin-top: 12px; }
.attach > div { flex: 1 1 180px; min-width: 0; }
.attach b { display: block; overflow-wrap: anywhere; } .attach span { font-size: 12.5px; color: var(--muted); }
.attach > .ic { width: 30px; height: 30px; color: var(--bad); }
.steps-run { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.steps-run li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps-run li.done { color: var(--ok); } .steps-run li.run { color: var(--ink); font-weight: 600; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--info); border-radius: 50%; display: inline-block; flex: none; }
.steps-run li.run .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rv-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.rv-doc { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.rv-doc > * { max-width: 100%; }
.paper { width: 100%; background: #fffdf7; border: 1px solid #e3dccb; border-radius: 6px; padding: 14px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; color: #2b2a26; position: relative; }
.paper-h h3 { font: 700 13px/1.3 ui-monospace, Menlo, Consolas, monospace; margin-bottom: 4px; padding-right: 64px; }
.ptag { position: absolute; top: 10px; right: 10px; font: 700 10px var(--sans); background: var(--bad-bg); color: var(--bad); padding: 2px 6px; border-radius: 4px; }
.ptable { margin-top: 10px; border-top: 1px solid #e3dccb; }
.prow { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 6px 0 6px 22px; border-bottom: 1px dotted #e3dccb; position: relative; }
.prow .pn { position: absolute; left: 0; top: 6px; font-weight: 700; color: #a49d8c; }
.prow.flag { background: #fff3d6; }
.paper-f { margin-top: 10px; font: italic 11px var(--sans); color: var(--muted); }
.lbl-b { display: block; width: 100%; }
.lbl-b textarea { font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; min-height: 220px; }
.rv-items { display: grid; gap: 10px; min-width: 0; }
.rv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-head h3 { margin: 0 !important; }
.rv-head span { font-size: 12.5px; font-weight: 700; } .rv-head .warn { color: var(--warn); } .rv-head .ok { color: var(--ok); }
.rv-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.rv-item.flag { border-color: #eac56b; background: #fffbf1; }
.rv-item.fixed { border-color: #bfe0cd; }
.rv-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rv-top b { flex: 1 1 auto; min-width: 0; }
.pn { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 11px var(--sans); flex: none; }
.conf { width: 60px; height: 5px; background: var(--soft-2); border-radius: 3px; overflow: hidden; }
.conf i { display: block; height: 100%; background: linear-gradient(90deg, #e39b16, var(--ok)); }
.rv-top small { font-size: 11.5px; color: var(--muted); width: 34px; }
.rv-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rv-fields .w2 { grid-column: span 2; }
.rv-fields input, .rv-fields select { min-height: 34px; padding: 5px 7px; font-size: 13px; }
.rv-serv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tg { display: inline-flex; gap: 6px; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; color: var(--ink); background: #fff; cursor: pointer; }
.tg input { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--navy); }
.obs { font-size: 12px; color: var(--muted); font-style: italic; }
.issues { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.issues li { display: flex; gap: 6px; font-size: 12.5px; color: #7a5104; align-items: flex-start; }
.issues .ic { width: 15px; height: 15px; margin-top: 1px; }
.ok-t { border-color: #bfe0cd; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.cands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 8px; }
.cand { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px; text-align: left; display: grid; gap: 4px; min-width: 0; }
.cand .ch { display: flex; align-items: center; gap: 6px; }
.cand .ch em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ok); }
.cand small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.cand.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: #f5f7ff; }
.cand.no { background: var(--soft); opacity: .7; } .cand.no .ch em { color: var(--bad); }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; margin-bottom: 10px; }
.assigned { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.assigned li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 6px 8px; background: var(--soft); border-radius: 8px; font-size: 13px; }

/* ---------- app del conductor ---------- */
.appwrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.app-main { display: grid; gap: 10px; justify-items: center; min-width: 0; }
.app-pick { display: flex; gap: 4px; background: var(--soft-2); padding: 3px; border-radius: 10px; max-width: 100%; }
.app-pick button { border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.app-pick button.on { background: #fff; color: var(--navy); }
.phone { width: 390px; max-width: 100%; height: 780px; background: #f6f5f1; border: 11px solid #0c1233; border-radius: 42px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 22px; background: #0c1233; border-radius: 0 0 14px 14px; z-index: 2; }
.ph-top { background: var(--navy); color: #fff; padding: 30px 16px 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; border-bottom: 4px solid var(--vc); }
.ph-top b { display: block; font-size: 15px; }
.ph-top span { font-size: 12px; color: #b9c2ef; }
.ph-prog { text-align: right; } .ph-prog b { font-size: 13px; }
.ph-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ph-eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); }
.ph-h { font-size: 22px; color: var(--navy-ink); line-height: 1.2; }
.ph-sub { color: var(--muted); }
.ph-card { background: #fff; border-radius: 16px; padding: 14px; border: 1px solid var(--line); display: grid; gap: 6px; }
.ph-obs { background: var(--warn-bg); color: #6b4703; border-radius: 9px; padding: 8px 10px; font-weight: 600; }
.ph-eta { font-size: 13px; color: var(--muted); } .ph-eta b { color: var(--ink); }
.ph-big { font-size: 20px; font-weight: 700; }
.ph-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ph-load { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 60px; }
.ph-load > div { flex: 1; min-width: 0; }
.ph-load b { display: block; font-size: 14px; } .ph-load span { font-size: 12.5px; color: var(--muted); }
.ph-load em { font-style: normal; font-size: 11px; color: var(--muted); }
.ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c9c2b2; display: grid; place-items: center; flex: none; color: transparent; }
.ph-load.on { border-color: #bfe0cd; background: #f3faf6; }
.ph-load.on .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.ph-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 4px; }
.ph-actions.col { grid-template-columns: 1fr; }
.ph-actions > :only-child { grid-column: 1 / -1; }
.ph-btn { min-height: 56px; border-radius: 14px; border: 0; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; text-align: center; }
.ph-btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.ph-btn.ok { background: var(--ok); } .ph-btn.bad { background: var(--bad); }
.ph-btn.sm { min-height: 44px; font-size: 13px; padding: 6px 10px; }
.ph-btn:disabled { opacity: .4; }
.ph-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ph-mini li { display: flex; justify-content: space-between; padding: 7px 10px; background: #fff; border-radius: 9px; font-size: 13px; }
.ph-mini em { font-style: normal; color: var(--muted); }
.ph-map .map { aspect-ratio: auto; }
.ph-lbl { display: block; }
.sigbox { position: relative; height: 180px; background: #fff; border: 2px dashed #c9c2b2; border-radius: 14px; overflow: hidden; }
.sigbox canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-ph { position: absolute; inset: auto 0 14px; text-align: center; color: #b3ab99; pointer-events: none; font-size: 13px; }
.sigbox.signed { border-style: solid; border-color: var(--ok); } .sigbox.signed .sig-ph { display: none; }
.ph-shot { min-height: 170px; border: 2px dashed #c9c2b2; border-radius: 14px; background: #fff; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--navy); font-weight: 700; }
.ph-photo svg, .photo { width: 100%; height: auto; display: block; border-radius: 12px; }
.reasons { display: grid; gap: 8px; }
.reason { min-height: 50px; border: 1px solid var(--line); background: #fff; border-radius: 12px; text-align: left; padding: 10px 14px; font-weight: 600; font-size: 14.5px; }
.reason.on { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.ph-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-sum div { background: #fff; border-radius: 14px; padding: 14px; border: 1px solid var(--line); }
.ph-sum b { display: block; font-family: var(--serif); font-size: 30px; color: var(--ok); }
.ph-sum .bad b { color: var(--bad); }
.ph-sum span { font-size: 12.5px; color: var(--muted); }
.ph-ret { display: grid; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ph-ret b { display: block; } .ph-ret span { font-size: 12.5px; color: var(--muted); }
.ph-done { display: grid; justify-items: center; text-align: center; gap: 10px; margin: auto 0; color: var(--ok); }
.app-side { display: grid; gap: 14px; min-width: 0; }
.vstat { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.tips p { margin-top: 8px; }

/* ---------- base ---------- */
.base-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.base-grid .col { display: grid; gap: 14px; min-width: 0; }
.rets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ret { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.ret .row-btn { margin-top: 10px; }
.ret-m { display: flex; gap: 10px; align-items: flex-start; }
.ret-m .vdot { margin-top: 5px; }
.ret-m > div { min-width: 0; }
.ret-m b { display: block; } .ret-m span { display: block; font-size: 13px; }
.ret-why { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--bad); }
.ret-why.ok { color: var(--ok); }
.ret-why .ic { width: 15px; height: 15px; margin-top: 2px; }
.fl-van { border-top: 1px solid var(--line-2); padding: 10px 0; }
.fl-h { display: flex; align-items: center; gap: 8px; }
.fl-h span { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-h em { font-style: normal; font-size: 12px; color: var(--muted); }
.fl-van ul { list-style: none; padding: 0; margin: 6px 0 0 18px; display: grid; gap: 4px; }
.fl-van li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.fl-van li span { color: var(--muted); }
.fl-van li.redel { background: #fff8e6; border-radius: 7px; padding: 4px 8px; margin-left: -8px; }

/* ---------- flota ---------- */
.flota-top { display: grid; gap: 6px; margin-bottom: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 42px; height: 24px; border-radius: 12px; background: #cfc9bb; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--ok); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--info); outline-offset: 2px; }
.vans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.van-card { position: relative; overflow: hidden; padding-top: 20px; }
.vc-band { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.mt { border-top: 1px solid var(--line-2); padding-top: 12px; }
.mt-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--soft-2); margin: 8px 0 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar.warn i { background: #e39b16; } .bar.bad i { background: var(--bad); }
.rng { display: block; font-weight: 400; color: var(--ink); font-size: 13px; }
.rng input { padding: 0; min-height: 28px; border: 0; accent-color: var(--navy); }
.rng-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.rng-l em { font-style: normal; }

/* ---------- facturación ---------- */
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.flow span { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--navy); }
.flow span.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.flow i { width: 18px; height: 1px; background: #c9c2b2; }
.fact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pres, .invs { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.pre { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.pre-m { display: flex; align-items: center; gap: 4px; border: 0; background: none; text-align: left; padding: 0; min-width: 0; }
.pre-m > div { min-width: 0; }
.pre-m b { display: block; overflow-wrap: anywhere; } .pre-m span { font-size: 12.5px; color: var(--muted); }
.pre-n { text-align: right; } .pre-n b { display: block; font-variant-numeric: tabular-nums; } .pre-n small { font-size: 11px; color: var(--muted); }
.invs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; border-bottom: 1px solid var(--line-2); padding: 8px 0; }
.invs b { display: block; font-variant-numeric: tabular-nums; } .invs span { font-size: 12.5px; color: var(--muted); }
.invs em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.invs .pill { justify-self: start; }
.invs .row-btn { margin: 0; justify-content: flex-end; }
.tbl-wrap { overflow-x: auto; margin-bottom: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; }
.tbl tfoot td { border: 0; padding: 4px 8px; }
.tbl tfoot tr.tot td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--ink); padding-top: 8px; }
.tbl tr.adj td { color: var(--bad); }
.tbl.lines { margin: 12px 0; }
.live { font-style: normal; font-size: 11px; color: var(--ok); font-weight: 700; }
.invoice { border: 1px solid var(--line); border-radius: 8px; padding: 26px; background: #fff; }
.invoice header { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--navy); padding-bottom: 14px; }
.inv-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.inv-brand .logo { width: 64px; height: 64px; flex: none; }
.inv-brand b { display: block; font-family: var(--serif); font-size: 19px; color: var(--navy); }
.inv-brand span { display: block; font-size: 12px; color: var(--muted); }
.inv-meta { text-align: right; } .inv-meta h3 { font-family: var(--serif); font-size: 22px; letter-spacing: .12em; color: var(--navy); margin: 0 0 4px; text-transform: none; }
.inv-meta p { font-size: 13px; }
.inv-to { margin: 14px 0; } .inv-to span { display: block; font-size: 12px; color: var(--muted); } .inv-to b { font-size: 16px; }
.invoice footer { display: grid; gap: 2px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }

/* ---------- guion ---------- */
.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide button { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px 12px; }
.guide button:hover { border-color: var(--navy); }
.guide button > div { flex: 1; min-width: 0; }
.guide b { display: block; } .guide span { font-size: 12.5px; color: var(--muted); }
.gn { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff !important; display: grid; place-items: center; font: 700 13px var(--serif) !important; flex: none; }
.deps { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 4px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .desp { grid-template-columns: minmax(0, 1fr); }
  .side-col { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .side-col .mapcard { grid-row: span 2; }

  .rv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; z-index: 30; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 8px; }
  .brand { border: 0; padding: 0; flex: 1; min-width: 0; }
  .brand img { width: 36px; height: 36px; }
  .brand b { font-size: 15px; } .brand span { font-size: 11.5px; }
  .navbtn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; border-radius: 10px; padding: 8px 12px; min-height: 40px; font-weight: 600; max-width: 60%; }
  .navbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #nav { display: none; width: 100%; margin: 4px 0 0; padding-top: 8px; }
  .nav-open #nav { display: flex; }
  .side-foot { display: none; }
  .main { padding: 16px 16px 60px; }
  .entrada, .base-grid, .fact-grid { grid-template-columns: minmax(0, 1fr); }
  .vans { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .appwrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .app-side { width: 100%; max-width: 640px; }
}
@media (max-width: 760px) {
  .top h1 { font-size: 23px; }
  .top-r { width: 100%; }
  .clock { flex: 1 1 auto; }
  .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpi { padding: 10px 12px; } .kpi b { font-size: 23px; }
  .side-col { grid-template-columns: minmax(0, 1fr); }
  .side-col .mapcard { grid-row: auto; }
  .vans { grid-template-columns: minmax(0, 1fr); }
  .cands { grid-template-columns: minmax(0, 1fr); }
  .pre { grid-template-columns: minmax(0, 1fr) auto; }
  .pre-m { grid-column: 1 / -1; }
  .pre-n { text-align: left; }
  .pre .pill { justify-self: end; white-space: normal; text-align: right; }
  .pre .btn { grid-column: 1 / -1; }
  .tbl { font-size: 12.5px; }
  .tbl td, .tbl th { padding: 6px 5px; }
  .facts.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone { border: 0; border-radius: 16px; height: auto; min-height: 600px; width: 100%; }
  .notch { display: none; }
  .ph-top { padding-top: 14px; }
  .app-main { width: 100%; }
  .app-pick { width: 100%; } .app-pick button { flex: 1; justify-content: center; padding: 8px 4px; }
  .card { padding: 13px; }
  .invoice { padding: 16px; }
  .inv-meta { text-align: left; }
}
@media (max-width: 480px) {
  .main { padding: 12px 12px 60px; }
  .qgrid { grid-template-columns: 46px repeat(3, minmax(0, 1fr)); gap: 4px; }
  .qh { flex-direction: column; align-items: stretch; padding: 5px; gap: 4px; }
  .hide-s { display: none; }
  .jsel select { width: 100%; font-size: 12px; padding: 2px; }
  .qt b { font-size: 13px; } .qt span { font-size: 10.5px; } .qt small { display: none; }
  .qcell { padding: 4px; min-height: 60px; }
  .cap-t { display: none; }
  .chip { padding: 3px 4px; font-size: 11px; grid-template-columns: minmax(0, 1fr); }
  .chip span { display: none; }
  .clock-t { min-width: 64px; }
  .clock-t b { font-size: 18px; }
  .top-r .btn { padding: 8px 10px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .rv-fields { grid-template-columns: minmax(0, 1fr); }
  .rv-fields .w2 { grid-column: auto; }
  .seg button { padding: 7px 9px; font-size: 13px; }
  .app-pick button { font-size: 12px; }
  .ph-body { padding: 12px; }
  .ph-btn { font-size: 14px; }
  .flow i { display: none; }
  .dr-head h2 { font-size: 20px; }
  .drawer { padding: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .brand span { display: none; }
  .top-r { gap: 6px; }
  .cbtn.txt { padding: 0 6px; }
  .qgrid { grid-template-columns: 40px repeat(3, minmax(0, 1fr)); }
}

/* ---------- impresión de factura (sin sombras: el PDF de Vista Previa las pinta como bloques) ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  body * { visibility: hidden; box-shadow: none !important; }
  .print-doc, .print-doc * { visibility: visible; }
  .modal-bg { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-height: none; overflow: visible; padding: 0; width: 100%; transform: none; }
  .print-doc { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; }
  .app, .drawer, .toasts { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
