:root {
  --bg: #f4f6f8; --panel: #fff; --text: #1d2733; --muted: #64748b; --line: #e2e8f0; --brand: #0f6e5a; --brand-2: #0b5546;
  --brand-soft: #e3f2ee; --warn: #b45309; --warn-soft: #fef3c7; --danger: #b91c1c; --danger-soft: #fee2e2; --info: #1d4ed8; --info-soft: #dbeafe;
  --ok: #15803d; --ok-soft: #dcfce7; --gray-soft: #eef2f6; --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 8px rgba(15,23,42,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 18px 0 8px; } h3 { font-size: 14px; margin: 12px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #0b7d3e; color: #e6f5ec; padding: 12px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 12px 12px; color: #fff; }
.side .logo .logo-img { display: block; background: #fff; border-radius: 10px; padding: 8px 12px; text-align: center; }
.side .logo .logo-img img { max-width: 100%; height: 52px; object-fit: contain; display: inline-block; }
.side .logo small { display: block; font-weight: 400; color: #c9ecd6; font-size: 11px; letter-spacing: 0; margin-top: 6px; }
.side .plegar { background: rgba(255,255,255,.15); border: 0; color: #fff; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; margin-top: 6px; font-size: 14px; }
.side .plegar:hover { background: rgba(255,255,255,.3); }
.side .grp { padding: 10px 18px 4px; font-size: 11px; text-transform: uppercase; color: #c9ecd6; letter-spacing: .6px; cursor: pointer; display: flex; justify-content: space-between; user-select: none; }
.side .grp span { transition: transform .15s; } .side .grp.cerrado span { transform: rotate(-90deg); }
.side .grp:hover { color: #fff; }
.side a { display: flex; align-items: center; gap: 8px; padding: 6px 18px; color: #f1fbf4; font-size: 13.5px; }
.side a:hover { background: rgba(255,255,255,.1); }
.side a.on { background: rgba(0,0,0,.18); color: #fff; border-left: 3px solid #b8f5c9; padding-left: 15px; font-weight: 600; }
.app.plegado { grid-template-columns: 1fr; } .app.plegado .side { display: none; } .app.plegado .top .menu-btn { display: inline-flex; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.login-logo { display: block; max-width: 240px; margin: 0 auto 6px; }
.side a .cel { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.12); padding: 0 5px; border-radius: 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .titulo { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .menu-btn { display: none; }
.content { padding: 20px; max-width: 1400px; width: 100%; }

/* Componentes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.spacer { flex: 1; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.pri:hover { background: var(--brand-2); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn.big { padding: 14px 18px; font-size: 16px; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.f.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
input, select, textarea { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; padding: 0; flex: none; }
label.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.perm-grp > label.chk { margin: 6px 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99d5c6; border-color: var(--brand); }
textarea { min-height: 70px; }
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; position: sticky; top: 0; }
table.t td { padding: 7px 8px; border-bottom: 1px solid #f0f3f6; vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f6faf9; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: #334155; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); } .b-info { background: var(--info-soft); color: var(--info); }
.b-brand { background: var(--brand-soft); color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 700; } .kpi .l { color: var(--muted); font-size: 12.5px; }
a.kpi:hover { border-color: var(--brand); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 12px; font: inherit; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; }
.tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tabs .x-tab { margin-left: 6px; color: var(--muted); cursor: pointer; font-weight: 400; }
.tabs .x-tab:hover { color: var(--danger, #b91c1c); }
tr.hist > td { background: #f8fafc; }
.alert { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 13.5px; }
.alert.warn { background: var(--warn-soft); color: #78350f; } .alert.info { background: var(--info-soft); color: #1e3a8a; }
.alert.ok { background: var(--ok-soft); color: #14532d; } .alert.danger { background: var(--danger-soft); color: #7f1d1d; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.steps span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--gray-soft); color: var(--muted); }
.steps span.on { background: var(--brand); color: #fff; } .steps span.ok { background: var(--brand-soft); color: var(--brand); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 500; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.list-item { padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.list-item:hover { border-color: var(--brand); }
.list-item .t1 { font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.progress { height: 8px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); }

/* Escaner */
.scan { display: flex; flex-direction: column; gap: 6px; }
.scan .scan-cam { width: 100%; }
.scan-mano { display: flex; gap: 6px; max-width: 340px; }
.scan-mano input { font-size: 14px; padding: 5px 8px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.scan-video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }

/* Modal y toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: min(640px, 100%); max-height: 92vh; overflow: auto; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(1000px, 100%); }
.modal h2 { margin-top: 0; }
.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 13.5px; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--ok); } .toast.warn { background: var(--warn); }

/* Calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .h { font-size: 11px; color: var(--muted); padding: 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; }
.cal .d { min-height: 92px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11.5px; background: #fff; }
.cal .d.otro { background: #fafbfc; color: #a0aec0; } .cal .d.hoy { background: #f0fbf8; }
.cal .d .n { font-weight: 600; font-size: 11px; color: var(--muted); }
.cal .ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal.semana .d { min-height: 260px; }

/* Gantt */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gantt table { border-collapse: collapse; table-layout: fixed; }
.gantt th, .gantt td { border-right: 1px solid #eef2f6; border-bottom: 1px solid #eef2f6; padding: 0; height: 34px; font-size: 11px; overflow: hidden; }
.gantt th { background: #fafbfc; color: var(--muted); font-weight: 600; padding: 4px; }
.gantt tr.maq-ini > td { border-top: 3px solid #94a3b8; }
.gantt th.we, .gantt td.we { background: #f8fafc; }
.gantt th.hoy { background: var(--brand-soft); color: var(--brand); }
.gantt td.maq { position: sticky; left: 0; background: #fff; z-index: 1; padding: 0 10px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.gantt .bar { position: relative; height: 26px; margin: 4px 1px; border-radius: 6px; color: #fff; font-size: 11px; padding: 0 6px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.gc-SE { background: #0f766e; } .gc-MZ { background: #7c3aed; } .gc-EXT { background: #1d4ed8; } .gc-PUL { background: #c2410c; } .gc-NP { background: repeating-linear-gradient(45deg, #64748b, #64748b 6px, #94a3b8 6px, #94a3b8 12px); }
.gantt .bar.nd { opacity: .55; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); }
.gantt .bar.fin { opacity: .45; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, #075a2c, #0b7d3e); }
.login .box { background: #fff; border-radius: 14px; padding: 28px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }

/* Botonera de operacion (celular) */
.ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ops a { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.ops a small { color: var(--muted); font-weight: 400; }
.ops a:hover { border-color: var(--brand); }

/* Etiquetas para imprimir */
.etq-page { display: flex; flex-wrap: wrap; gap: 6mm; }
.etq { width: 95mm; height: 55mm; border: 1px dashed #999; padding: 3mm 4mm; display: flex; flex-direction: column; gap: 1.5mm; page-break-inside: avoid; }
.etq svg { width: 100%; height: 17mm; flex: none; }
.etq .tx { font-size: 9.5pt; line-height: 1.2; overflow: hidden; }
.etq .tx b { font-size: 15pt; display: block; font-family: monospace; text-align: center; letter-spacing: 1px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: -260px; width: 250px; z-index: 40; transition: left .2s; }
  .side.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .top .menu-btn { display: inline-flex; }
  .content { padding: 12px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .card { padding: 12px; }
  .hide-m { display: none; }
}
@media print {
  .side, .top, .no-print, .toasts { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

/* Buscador de modulos e informes */
.top .buscador { position: relative; flex: 0 1 340px; min-width: 120px; }
.top .buscador input { width: 100%; }
.top .buscador .res { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 60vh; overflow: auto; z-index: 20; }
.top .buscador .res a { display: block; padding: 8px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.top .buscador .res a small { display: block; color: var(--muted); font-size: 11px; }
.top .buscador .res a.on, .top .buscador .res a:hover { background: var(--info-soft); }
@media (max-width: 900px) { .top .buscador { flex: 1; } }
/* Select con buscador */
.combo { display: flex; flex-direction: column; gap: 4px; }
.combo .combo-q { font-size: 13px; padding: 6px 8px; }
/* Visor de informes */
.inf-graf { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 12px 0; }
.inf-graf .box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.inf-graf .box h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.inf-graf .box .cv { height: 230px; }
.kpis.mini .kpi { padding: 10px 12px; } .kpis.mini .kpi .v { font-size: 20px; }
@media (max-width: 900px) { .inf-graf { grid-template-columns: 1fr; } }
/* Permisos de roles */
.perm-grp { margin-bottom: 10px; } .perm-grp b { display: block; margin-bottom: 4px; }
.perm-grp .grid { gap: 2px 12px; }
.perm-grp label.chk b { display: inline; margin: 0; }

/* Mapa del almacen */
.mapa-zona { margin: 10px 0 14px; } .mapa-zt { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.mapa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.mapa-pos { display: flex; flex-direction: column; gap: 1px; padding: 6px 7px; border-radius: 8px; border: 1px solid var(--line); color: var(--text); min-height: 64px; position: relative; transition: opacity .15s; }
.mapa-pos b { font-size: 13px; } .mapa-pos small { font-size: 11px; color: var(--muted); } .mapa-pos em { font-style: normal; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-pos .m-bar { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(0,0,0,.08); }
.mapa-pos .m-bar span { display: block; height: 100%; border-radius: 2px; background: currentColor; opacity: .55; }
.mapa-pos:hover { box-shadow: 0 0 0 2px var(--brand); }
.m-vacia { background: var(--ok-soft); border-color: #86efac; border-style: dashed; } .m-vacia b { color: var(--ok); }
.m-parcial { background: var(--warn-soft); border-color: #fcd34d; } .m-parcial b { color: var(--warn); }
.m-llena { background: var(--danger-soft); border-color: #fca5a5; } .m-llena b { color: var(--danger); }
.m-excedida { background: var(--danger); border-color: var(--danger); color: #fff; } .m-excedida small, .m-excedida b { color: #fff; }
.m-dim { opacity: .22; } .m-hit { box-shadow: 0 0 0 3px var(--info); }
/* Dibujo de las naves */
.naves { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; } .naves > .card { margin: 0; } .naves > .nave-card { flex: 0 1 auto; max-width: 100%; overflow-x: auto; }
.nv { display: flex; gap: 8px; align-items: stretch; }
.nv-side { display: flex; flex-direction: column; gap: 8px; width: 74px; }
.nv-r { display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.nv-g { display: flex; flex-direction: column; gap: 2px; justify-content: center; align-items: center; }
.nv-ba { justify-content: space-between; }
.mr { display: flex; gap: 2px; align-items: center; }
.ml { width: 22px; font-size: 10px; font-weight: 700; color: var(--muted); text-align: right; padding-right: 3px; flex: none; }
.nv-g .ml { width: auto; padding: 0; }
.mc { width: 17px; height: 17px; border-radius: 3px; border: 1px solid var(--line); font-size: 9px; line-height: 15px; text-align: center; color: var(--text); cursor: pointer; flex: none; transition: opacity .15s; }
.mc:hover { box-shadow: 0 0 0 2px var(--brand); }
.mc.mc-l { width: auto; min-width: 24px; height: 20px; line-height: 18px; padding: 0 3px; font-size: 10px; text-decoration: none; }
.mapa-piso { display: flex; flex-direction: column; gap: 4px; }
.mr-z { align-items: flex-start; } .ml-z { width: auto; min-width: 46px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.mz-cel { display: flex; flex-wrap: wrap; gap: 3px; }
.mc.m-nd, .mapa-ley i.m-nd { background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(0,0,0,.06) 3px 5px); border-style: dotted; cursor: default; }
.mn span { width: 17px; font-size: 8px; color: var(--muted); text-align: center; flex: none; overflow: visible; white-space: nowrap; }
.mpas { height: 4px; background: var(--muted); opacity: .45; border-radius: 2px; margin: 5px 0 5px 24px; }
.mx { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 2px dashed var(--info); border-radius: 8px; background: var(--info-soft, #dbeafe); color: var(--text); padding: 4px; min-height: 50px; }
.mx b { font-size: 11.5px; } .mx small { font-size: 10px; color: var(--muted); } .mx.con { border-style: solid; }
.mx-v { flex: 1; }
.mprod { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 700; color: var(--brand); border-left: 3px solid var(--brand); padding: 0 2px; text-align: center; letter-spacing: .5px; }
.mlibre { font-size: 11px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 6px; margin: 0 0 8px 82px; padding: 3px; }
.mnada { font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0; }
.mapa-ley { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.mapa-ley i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; border: 1px solid var(--line); }
.mapa-ley i.m-vacia { border-style: dashed; } #coinc { color: var(--info); font-weight: 600; }
.aviso-version { margin: 6px 10px; padding: 8px; border-radius: 6px; background: #b91c1c; color: #fff; font-size: 12px; line-height: 1.3; }
/* Formatos de etiqueta */
.etq.f-rec { width: 150mm; height: 100mm; padding: 8mm 10mm; gap: 5mm; justify-content: center; }
.etq.f-rec svg { height: 38mm; }
.etq.f-rec .e-prov { font-size: 24pt; font-weight: 700; text-align: center; line-height: 1.15; }
.etq.f-rec .e-kg { font-size: 34pt; font-weight: 800; text-align: center; }
.etq.f-mz .e-partida { font-size: 34pt; font-weight: 800; text-align: center; line-height: 1; letter-spacing: 1px; }
.etq.f-mz .e-sku { font-size: 12pt; text-align: center; }
.etq.f-pt { gap: 2mm; }
.etq.f-pt .e-cab { display: flex; align-items: center; gap: 3mm; border-bottom: 1.5px solid #3f8f3a; padding-bottom: 1.5mm; font-size: 8.5pt; line-height: 1.2; }
.etq.f-pt .e-cab img { height: 9mm; }
.etq.f-pt .e-cab b { font-size: 10.5pt; }
.etq.f-pt svg { height: 13mm; }
.etq.f-pt .e-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 4mm; font-size: 9pt; }
.etq.f-pt .e-datos span { display: block; color: #666; font-size: 7pt; text-transform: uppercase; letter-spacing: .4px; }
.etq.f-pt .e-datos b { font-size: 11pt; }
.cal.semana .ev { white-space: normal; line-height: 1.25; }
.sug { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); font-size: 13px; }
.sug > div { margin-top: 3px; } .sug .top .mono { font-size: 16px; font-weight: 700; color: var(--brand-2); }
.jornadas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 4px; }
.jornadas .jor { margin: 0; border-top: 4px solid var(--ok); } .jornadas .jor.parada { border-top-color: var(--danger); }
table.med input, table.med select { min-width: 64px; width: 100%; padding: 4px 6px; font-size: 13px; }
table.med td { padding: 4px 6px; } table.med tr.cambiado { background: #fffbeb; }

/* Resumen del bulto al escanear */
.card.escaneo { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 18px; border-left: 5px solid var(--brand); }
.card.escaneo span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card.escaneo b { font-size: 20px; } .card.escaneo .ancho { grid-column: span 2; } .card.escaneo .ancho b { font-size: 16px; font-weight: 600; }

/* Tableros tipo Power BI */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.filtros-bi .row { flex-wrap: wrap; align-items: flex-end; gap: 10px; }

/* Inicio personalizable y Mis tareas */
.inicio-cuadros { display: grid; gap: 14px; } .inicio-cuadros > .card { margin: 0; }
.tareas-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tareas-grupo { background: var(--bg); border-radius: 10px; padding: 10px; }
.tareas-grupo h4 { margin: 0 0 8px; display: flex; justify-content: space-between; font-size: 14px; }
.tarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; }
.tarea input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.tarea .tt { flex: 1; min-width: 0; cursor: pointer; } .tarea .tt b { font-weight: 600; font-size: 13.5px; display: block; }
.tarea .meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.tarea .meta .venc { color: var(--danger); font-weight: 600; } .tarea .meta .hoy { color: var(--warn); font-weight: 600; }
.tarea a.ir { font-size: 12px; white-space: nowrap; }
.tarea.hecha .tt b { text-decoration: line-through; color: var(--muted); }
.cuadros-orden li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); list-style: none; }
.cuadros-orden { padding: 0; margin: 0; } .cuadros-orden li label { flex: 1; display: flex; gap: 8px; align-items: center; }
/* Celular: cuadros por proceso */
.ops-proc h2 { font-size: 15px; margin: 16px 0 8px; }
button.x { border: 0; background: none; cursor: pointer; color: var(--danger); font-weight: 700; padding: 0 2px; }
/* Menu: titulos de grupo en verde fuerte, opciones de adentro en verde clarito */
.side .grp + .grp-items { background: #e3f5e8; padding: 4px 0; }
.side .grp + .grp-items a { color: #0b4f27; }
.side .grp + .grp-items a:hover { background: #cdeed6; }
.side .grp + .grp-items a.on { background: #b9e6c5; color: #06381b; border-left-color: #0b7d3e; }
.side .grp + .grp-items a .cel { background: rgba(11,125,62,.15); }
.side .grp { padding-top: 11px; padding-bottom: 7px; font-weight: 600; color: #fff; }
.tareas-fila .tarea { margin-bottom: 6px; }
.tareas-fila .tarea .meta .resp { color: var(--brand-2); font-weight: 600; }
.modal .tarea-form { min-width: min(460px, 82vw); }
.modal .tarea-form .chips .chip { min-width: 38px; text-align: center; padding: 5px 8px; }
.modal:has(.tarea-form) { width: min(500px, 100%); }
[data-reimp] { white-space: nowrap; }
/* Pedido de venta: precio cambiado a mano respecto de la lista */
input.manual { background: #fff7e0; border-color: var(--warn); }
/* Plan de carga */
.plan { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.plan .camion.drop { outline: 2px dashed var(--brand); outline-offset: 2px; }
.plan tbody.pd { cursor: grab; }
.plan tbody.pd.drag { opacity: .4; }
.plan tbody.pd + tbody.pd tr:first-child td { border-top: 2px solid var(--border, #d0d7de); }
.plan td.ord { text-align: center; width: 54px; }
.plan .mv { display: flex; gap: 2px; justify-content: center; margin-top: 4px; }
.plan .mv .btn { padding: 0 5px; font-size: 10px; }
.progress.over > div { background: var(--danger); }
.txt-ok { color: var(--ok); } .txt-warn { color: var(--warn); } .txt-danger { color: var(--danger); font-weight: 600; }
.ubi { padding: 8px 0; border-top: 1px solid var(--gray-soft); }
@media (max-width: 700px) { .plan { grid-template-columns: 1fr; } }
.plan > .card { min-width: 0; }
.plan .tbl-wrap { overflow-x: auto; }
#dia { width: auto; }
/* Fotos: vista previa y ampliacion */
.foto-prev { max-width: 160px; border-radius: 8px; margin-top: 6px; cursor: zoom-in; }
.zoom-bg { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 1000; display: flex; align-items: center; justify-content: center; overflow: auto; }
.zoom-bg img { max-width: 96vw; max-height: 94vh; cursor: zoom-in; }
.zoom-bg.real { display: block; }
.zoom-bg.real img { max-width: none; max-height: none; cursor: zoom-out; }
.zoom-x { position: fixed; top: 12px; right: 12px; z-index: 1001; }

/* Precios de compra tipo chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.chat-dia { align-self: center; font-size: 12px; color: var(--muted); background: var(--gray-soft); border-radius: 12px; padding: 2px 10px; }
.burbuja { align-self: flex-start; max-width: min(520px, 100%); background: var(--brand-soft); border-radius: 12px 12px 12px 2px; padding: 8px 12px; }
.burbuja .precio { font-size: 18px; font-weight: 600; }
.chat-in { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* Plan de carga en formato planilla */
.planilla-carga tr.pl-sep td { background: #000; height: 8px; padding: 0; }
.planilla-carga tr.pl-tot td { background: var(--gray-soft); font-weight: 600; }
.planilla-carga tr.pl-ini td { border-top: 1px solid var(--line); }
.planilla-carga select { padding: 4px 6px; }
.fam3 { gap: 6px; flex-wrap: nowrap; } .fam3 select { min-width: 0; flex: 1; }
#it .fam3 select { min-width: 120px; }

/* Tablero de KPI */
.kpi-cab h1 { margin: 2px 0 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(560px, 100%), 1fr)); gap: 12px; margin: 12px 0; }
.kpi-card { display: grid; grid-template-columns: 210px 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 180px; }
.kpi-izq { padding: 12px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; cursor: default; }
.kpi-card .kpi-izq[onclick], .kpi-izq:hover { background: #fafbfc; }
.kpi-t { font-weight: 600; font-size: 14px; }
.kpi-v { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: auto; word-break: break-word; }
.kpi-v small { font-size: 16px; margin-left: 4px; vertical-align: top; }
.kpi-v.bien { color: var(--ok); } .kpi-v.mal { color: var(--danger); }
.kpi-o { font-size: 13px; }
.kpi-g { padding: 8px 10px; height: 180px; min-width: 0; }
.kpi-tabla { margin-top: 12px; } .kpi-obj { margin-top: 4px; }
.kb-tabla td { padding: 3px 8px; } .kb-tabla tr.sel td { background: var(--info-soft); } .kb-tabla tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
.kb-real { min-width: 200px; position: relative; } .kb-real span { position: relative; font-size: 12px; margin-left: 6px; }
.kb-real .kb-bar { display: inline-block; vertical-align: middle; }
.kb-bar { height: 14px; border-radius: 2px; } .kb-bar.real { background: #3f3f46; max-width: 75%; } .kb-bar.bien { background: #65a30d; } .kb-bar.mal { background: #dc2626; margin-left: auto; }
.kb-d { display: flex; min-width: 220px; } .kb-l, .kb-r { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.kb-l { justify-content: flex-end; border-right: 2px solid #64748b; } .kb-l .kb-bar { margin-left: 0; }
.kb-d span.bien { color: var(--ok); } .kb-d span.mal { color: var(--danger); }
@media (max-width: 700px) { .kpi-card { grid-template-columns: 1fr; } .kpi-izq { border-right: 0; border-bottom: 1px solid var(--line); } }
.kpi-meses { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.kpi-meses button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 5px 7px; font-size: 12px; cursor: pointer; }
.kpi-meses button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.etq.f-mat .e-fam { font-size: 20pt; font-weight: 800; text-align: center; line-height: 1.1; }
.etq.f-mat .e-col { font-size: 14pt; text-align: center; font-weight: 600; }
.etq.f-mat .e-prov2 { font-size: 12pt; text-align: center; margin-top: 2px; }
table.t.compacta td { padding: 4px 8px; vertical-align: middle; } table.t.compacta tr.grupo td { border-top: 2px solid var(--line); }
table.t.compacta .btn.sm { padding: 2px 8px; }

.multi-dd { position: relative; }
.multi-dd summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 9px 30px 9px 12px; background: var(--panel); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.multi-dd summary::-webkit-details-marker { display: none; }
.multi-dd summary::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.multi-pop { margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 8px; }
.multi-pop .mq { margin-bottom: 6px; }
.multi { display:flex; flex-direction:column; gap:2px; max-height:220px; overflow:auto; }
.multi .chk { font-weight:normal; display:flex; gap:4px; align-items:center; }

/* Roles solo de celular: sin menú lateral; los accesos ocupan una pantalla. */
.inicio-btn { display: none; }
.app.solo-cel { grid-template-columns: 1fr; } .app.solo-cel .side, .app.solo-cel .menu-btn, .app.solo-cel .buscador { display: none !important; }
.app.solo-cel .inicio-btn { display: inline-flex; } .app.solo-cel .top .titulo { flex: 1; }
.accesos-cel { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); grid-auto-rows: 1fr; gap: 10px; height: calc(100dvh - 130px); min-height: 280px; max-height: 640px; }
.accesos-cel a { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; padding: 10px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 17px; box-shadow: var(--shadow); text-decoration: none; min-height: 0; }
.accesos-cel a small { color: var(--muted); font-weight: 400; font-size: 12px; }
.accesos-cel a .g { color: var(--brand); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.accesos-cel a:active { background: var(--brand); color: #fff; }
@media (max-width: 699px) { .accesos-cel { grid-template-columns: repeat(2, 1fr); max-height: none; } .accesos-cel.n1, .accesos-cel.n2, .accesos-cel.n3 { grid-template-columns: 1fr; } }
.top .titulo:empty { display: none; }
/* Chat de pedidos a compras */
.chat-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; min-height: 200px; overflow-y: auto; padding: 8px; background: var(--bg); border-radius: 8px; margin: 8px 0; }
.chat .msg { max-width: 80%; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); word-wrap: break-word; }
.chat .msg.mio { align-self: flex-end; background: #dcf8c6; }
.chat .msg.otro { align-self: flex-start; }
.chat .msg.sis { align-self: center; max-width: 95%; background: transparent; border-style: dashed; font-size: 0.9em; color: var(--muted); }
.chat-in { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 6px; } .chat-in textarea { flex: 1; }
/* Pantalla de planta (proyeccion) */
.proy { position: fixed; inset: 0; z-index: 10000; background: #fff; display: flex; flex-direction: column; }
.proy-toque { align-items: center; justify-content: center; background: rgba(15, 23, 42, .85); }
.proy-toque .btn { font-size: 26px; padding: 22px 34px; }
.proy-c { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 24px 6px; }
.proy-tit { font-size: 30px; font-weight: 700; color: var(--brand); margin-bottom: 10px; }
.proy-gwrap { flex: 1; min-height: 0; overflow: hidden; }
.proy-g .gantt { overflow: visible; border: 0; }
.proy-g .gantt .bar { cursor: default; }
.proy-txt { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-size: clamp(24px, 4vw, 64px); line-height: 1.3; padding: 0 5vw; }
.proy-txt h1 { font-size: 1.4em; color: var(--brand); margin: 0 0 .4em; }
.proy-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.proy-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 18px; font-size: 15px; color: var(--muted); }
.proy-hora { text-transform: capitalize; margin-left: auto; }
.proy-x { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; opacity: .4; } .proy-x:hover { opacity: 1; }
.proy-bar { height: 5px; background: #e2e8f0; } .proy-bar div { height: 100%; width: 0; background: var(--brand); }

/* Impresion en etiquetadora (18/11): una etiqueta por hoja; 100 x 150 mm, bolsa de PT 100 x 70 mm. */
.etq-imp .etq-page { display: block; }
.etq-imp .etq { width: 100mm; height: 150mm; padding: 7mm 6mm; gap: 5mm; justify-content: center; overflow: hidden; break-after: page; page-break-after: always; box-sizing: border-box; }
.etq-imp .etq:last-child { break-after: auto; page-break-after: auto; }
.etq-imp .etq svg { height: 40mm; }
.etq-imp .etq .tx { font-size: 14pt; line-height: 1.3; text-align: center; }
.etq-imp .etq .tx b { font-size: 20pt; margin-bottom: 3mm; }
.etq-imp .etq.f-rec { width: 100mm; height: 150mm; padding: 8mm 6mm; gap: 7mm; }
.etq-imp .etq.f-rec svg { height: 45mm; }
.etq-imp .etq.f-rec .e-prov { font-size: 26pt; }
.etq-imp .etq.f-rec .e-kg { font-size: 40pt; }
.etq-imp .etq.f-mz .e-partida { font-size: 40pt; }
.etq-imp .etq.f-mz .e-sku { font-size: 16pt; }
.etq-imp .etq.f-mat .e-fam { font-size: 26pt; }
.etq-imp .etq.f-mat .e-col { font-size: 18pt; }
.etq-imp .etq.f-mat .e-prov2 { font-size: 15pt; }
.etq-imp .etq.f-pt { page: pt; width: 100mm; height: 70mm; padding: 3mm 4mm; gap: 1.5mm; justify-content: flex-start; }
.etq-imp .etq.f-pt svg { height: 14mm; }
.etq-imp .etq.f-pt .e-cab { font-size: 10pt; }
.etq-imp .etq.f-pt .e-cab img { height: 11mm; }
.etq-imp .etq.f-pt .e-cab b { font-size: 13pt; }
.etq-imp .etq.f-pt .e-datos span { font-size: 8pt; }
.etq-imp .etq.f-pt .e-datos b { font-size: 14pt; }
