@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter.woff2") format("woff2");
}

:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e3e7f0;
  --text: #17203a;
  --muted: #66708a;
  --primary: #1d84c8;
  --primary-600: #166aa3;
  --primary-50: #e6f3fb;
  --side: #1f2d38;
  --accent: #6cc24a;
  --side-2: #2c3c49;
  --side-text: #b6c4cf;
  --side-sub: #2b3c4a;
  --side-sub-2: #374b5b;
  --side-sub-text: #d4dee6;
  --side-sub-text-2: #e6edf2;
  --ok: #15803d; --ok-bg: #e7f6ec;
  --warn: #b45309; --warn-bg: #fdf3e2;
  --bad: #c62828; --bad-bg: #fdecec;
  --info: #0e7490; --info-bg: #e3f5f8;
  --gray-bg: #eef0f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
a { color: var(--primary); }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(1100px 600px at 0% 0%, #2f4250 0%, #1f2d38 55%, #16212a 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .14em; font-size: 22px; }
.logo-mark { width: 52px; height: 52px; flex: none; }
.logo-mark img { width: 100%; height: 100%; display: block; }
.logo b { color: var(--accent); }
.login-brand h1 { font-size: 38px; line-height: 1.15; max-width: 460px; margin-top: 40px; }
.login-brand p { color: #c5d4de; max-width: 440px; font-size: 15px; line-height: 1.6; }
.feature-list { display: grid; gap: 14px; margin-top: 28px; max-width: 440px; }
.feature-list div { display: flex; gap: 12px; align-items: center; color: #e3e9ff; }
.feature-list svg { background: rgba(255,255,255,.12); border-radius: 9px; padding: 7px; width: 34px; height: 34px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 26px; margin-bottom: 6px; }
.login-form .muted { margin-bottom: 26px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }
.demo-users { margin-top: 24px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 248px, var(--bg) 248px); }
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
.sidebar .logo { color: #fff; padding: 4px 8px 22px; font-size: 19px; }
.sidebar .logo-mark { width: 42px; height: 42px; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--side-text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6e7ba6; padding: 16px 12px 6px; }
.user-box { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--side-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.user-box .who { flex: 1; min-width: 0; }
.user-box .who b { color: #fff; display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .who span { font-size: 12px; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 7px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.topbar .crumbs { font-weight: 600; font-size: 15.5px; flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar .crumbs .sep { color: #b0b7c9; }
.menu-btn { display: none; }
.period-chip { background: var(--primary-50); color: var(--primary-600); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
#view { padding: 28px; max-width: 1400px; width: 100%; }

/* ---------- Components ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.grid > .card, .grid > * + .card { margin-top: 0; }
td.nm { min-width: 200px; }
.card h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 18px; }
.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)); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 15px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg.i { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.req::after { content: " *"; color: var(--bad); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid #cfd5e3; border-radius: 9px; padding: 9px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,132,200,.18); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
.input-icon { position: relative; flex: 1; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.input-icon input { padding-left: 38px; }
.input-suffix { display: flex; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix span, .input-suffix button { border: 1px solid #cfd5e3; border-left: 0; background: var(--surface-2); padding: 0 14px; display: grid; place-items: center; border-radius: 0 9px 9px 0; color: var(--muted); font-weight: 600; cursor: default; }
.input-suffix button { cursor: pointer; color: var(--primary); }
.code-big { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--primary-600); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-bg); color: var(--muted); white-space: nowrap; }
.st-normal { background: var(--ok-bg); color: var(--ok); }
.st-proximo { background: var(--warn-bg); color: var(--warn); }
.st-agotado, .st-sin_stock { background: var(--bad-bg); color: var(--bad); }
.st-activo { background: var(--ok-bg); color: var(--ok); }
.st-prueba { background: var(--warn-bg); color: var(--warn); }
.st-suspendido { background: var(--bad-bg); color: var(--bad); }
tr.off td { opacity: .55; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-row img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 4px; }
.st-sin_consumo { background: var(--info-bg); color: var(--info); }
.t-ingreso, .t-apertura { background: var(--ok-bg); color: var(--ok); }
.t-salida { background: var(--primary-50); color: var(--primary-600); }
.t-baja { background: var(--bad-bg); color: var(--bad); }

.seg { display: inline-flex; background: var(--gray-bg); padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.tabs svg.i { width: 17px; height: 17px; }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; max-height: 70vh; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--primary-50); }
tr.voided td { color: #a0a7b8; text-decoration: line-through; }
tr.voided td.keep { text-decoration: none; }
td input.cell { width: 110px; padding: 5px 8px; text-align: right; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }

/* Home */
.hero { background: linear-gradient(120deg, #1f2d38 0%, #23506e 60%, #1d84c8 100%); color: #fff; border-radius: 16px; padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.hero h1 { font-size: 24px; }
.hero p { margin: 6px 0 0; color: #cfe3f1; }
.hero .clock { text-align: right; }
.hero .clock b { font-size: 26px; display: block; font-variant-numeric: tabular-nums; }
.kpi { display: flex; align-items: center; gap: 14px; }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.kpi .val { font-size: 24px; font-weight: 700; }
.kpi .lbl { color: var(--muted); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; display: flex; flex-direction: column; gap: 12px; }
.tile:hover { transform: translateY(-2px); border-color: #c6d2f5; box-shadow: 0 8px 24px rgba(29,132,200,.14); }
.tile .ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; }
.tile .ic svg { width: 24px; height: 24px; }
.tile b { font-size: 15.5px; }
.tile span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tile.locked { opacity: .55; pointer-events: none; }
.c-blue { background: #e6f3fb; color: #1d84c8; } .c-green { background: #e3f6ea; color: #15803d; } .c-indigo { background: #ece9ff; color: #5b3fd6; }
.c-red { background: #fde8e8; color: #c62828; } .c-amber { background: #fdf0dc; color: #b45309; } .c-teal { background: #dff4f6; color: #0e7490; }
.c-slate { background: #e9edf4; color: #475569; } .c-pink { background: #fce7f3; color: #be185d; }
.section-title { font-size: 15px; font-weight: 650; margin: 28px 0 14px; }

/* SKU picker & card */
.search-row { display: flex; gap: 10px; margin-top: 14px; }
.pk-results { margin-top: 12px; }
.pk-results:empty { display: none; }
.result-list { border: 1px solid var(--border); border-radius: 10px; max-height: 320px; overflow: auto; }
.result-list button { display: flex; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; padding: 10px 14px; gap: 12px; align-items: center; cursor: pointer; font: inherit; }
.result-list button:last-child { border-bottom: 0; }
.result-list button:hover { background: var(--primary-50); }
.result-list .code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--primary-600); width: 64px; }
.result-list .nm { flex: 1; }
.sku-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.sku-photo { width: 84px; height: 84px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: #9aa3b8; flex: none; }
.sku-photo img { width: 100%; height: 100%; object-fit: cover; }
.sku-photo svg { width: 34px; height: 34px; }
.sku-info { flex: 1; min-width: 220px; }
.sku-code { display: flex; gap: 10px; align-items: center; font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--primary-600); font-size: 15px; }
.sku-name { font-size: 18px; font-weight: 650; margin: 4px 0 6px; }
.sku-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.sku-stock { text-align: right; background: var(--surface-2); border-radius: 12px; padding: 12px 18px; }
.sku-stock .lbl { color: var(--muted); font-size: 12px; }
.sku-stock .val { font-size: 26px; font-weight: 750; }
.sku-stock small { font-size: 14px; color: var(--muted); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.metric { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.metric .lbl { color: var(--muted); font-size: 12px; }
.metric .val { font-size: 19px; font-weight: 700; margin-top: 2px; }
.photo-drop { border: 2px dashed #cfd5e3; border-radius: 12px; padding: 14px; display: flex; gap: 14px; align-items: center; cursor: pointer; }
.photo-drop:hover { border-color: var(--primary); }
.photo-drop .sku-photo { width: 72px; height: 72px; }

.action-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.action-card { padding: 28px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; transition: transform .12s, box-shadow .12s; }
.action-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29,132,200,.14); }
.action-card .ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; }
.action-card .ic svg { width: 28px; height: 28px; }
.action-card b { font-size: 18px; }
.action-card span { color: var(--muted); line-height: 1.5; }
.action-card.locked { opacity: .5; pointer-events: none; }

.notice { border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.notice.warn { background: var(--warn-bg); color: #7c3d06; }
.notice.bad { background: var(--bad-bg); color: #8e1b1b; }
.notice.ok { background: var(--ok-bg); color: #0f5c2c; }
.notice.info { background: var(--primary-50); color: #135a8a; }
.success-box { text-align: center; padding: 32px 20px; }
.success-box .ic { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.success-box .ic svg { width: 32px; height: 32px; stroke-width: 2.4; }
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: flex; gap: 14px; }
.step::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar select, .toolbar input { width: auto; }
.list-plain { display: grid; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; }
.list-row .grow { flex: 1; }
.list-row.off { opacity: .55; }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 27, 61, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 1100px; }
.modal h3 { font-size: 18px; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.scan-video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 60; }
.toast { background: #17203a; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 380px; display: flex; gap: 10px; align-items: flex-start; animation: tin .2s ease-out; }
.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px; }
  .login-brand h1 { font-size: 26px; margin-top: 20px; }
  .feature-list { display: none; }
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(15,27,61,.4); }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  #view { padding: 18px 16px; }
  .g2, .g3, .action-cards { grid-template-columns: 1fr; }
  .period-chip { display: none; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .search-row { flex-wrap: wrap; } }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .app { display: block; } }

.login-brand .logo-mark { width: 72px; height: 72px; }
.login-brand .logo { font-size: 26px; }
.login-brand h1 span { color: var(--accent); }

/* ---------- Menú por carpetas ---------- */
.nav { overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.folder-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; color: var(--side-text); font: inherit; font-weight: 600; border-radius: 9px; cursor: pointer; text-align: left; }
.folder-head span { flex: 1; }
.folder-head:hover { background: var(--side-2); color: #fff; }
.folder-head .chev { width: 16px; height: 16px; transition: transform .18s; opacity: .7; }
.folder.open > .folder-head .chev { transform: rotate(90deg); }
.folder.has-active > .folder-head { color: #fff; }
.folder-items { display: none; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--side-2); }
.folder.open > .folder-items { display: grid; gap: 1px; }
.nav .folder-items a { padding: 7px 10px; font-size: 13.5px; font-weight: 500; }
.nav .folder-items a.active { background: var(--primary); color: #fff; }
/* Submenús en un tono más claro que el menú principal (cada nivel un poco más claro) */
.nav .folder.lvl1.open > .folder-head { background: var(--side-sub); color: #fff; border-radius: 9px 9px 0 0; }
.nav .folder.lvl1 > .folder-items { margin: 0 0 6px; padding: 4px 6px 8px; border-left: 0; background: var(--side-sub); border-radius: 0 0 10px 10px; }
.nav .folder.lvl1 > .folder-items > a { padding-left: 40px; color: var(--side-sub-text); }
.nav .folder.lvl2 > .folder-head { padding: 8px 10px 8px 40px; font-size: 13.5px; font-weight: 600; color: var(--side-sub-text); }
.nav .folder.lvl2 > .folder-head .chev { width: 14px; height: 14px; }
.nav .folder.lvl2.open > .folder-head { color: #fff; }
.nav .folder.lvl2 > .folder-items { margin: 2px 0 4px 30px; padding: 4px; border-left: 0; background: var(--side-sub-2); border-radius: 8px; }
.nav .folder.lvl2 > .folder-items > a { padding: 6px 10px 6px 12px; font-size: 13px; color: var(--side-sub-text-2); }
.nav .folder-items a:hover, .nav .folder.lvl2 > .folder-head:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav .folder.lvl1 .folder-items a.active { background: var(--primary); color: #fff; }
.nav .fly-title { display: none; }
/* Computador: cada carpeta abre un recuadro hacia la derecha */
@media (min-width: 901px) {
  .nav .folder.lvl1.open > .folder-head { border-radius: 9px; }
  .nav .folder > .folder-head .chev, .nav .folder.open > .folder-head .chev { transform: none; }
  .nav .folder.lvl1 > .folder-items, .nav .folder.lvl2 > .folder-items { position: fixed; z-index: 60; width: 250px; margin: 0; padding: 8px; border-radius: 12px; box-shadow: 0 12px 32px rgba(10, 20, 30, .35); max-height: calc(100vh - 16px); overflow-y: auto; }
  .nav .folder.lvl1 > .folder-items { background: var(--side-sub); }
  .nav .folder.lvl2 > .folder-items { background: var(--side-sub-2); }
  .nav .fly-title { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
  .nav .fly-title svg { width: 16px; height: 16px; opacity: .8; }
  .nav .folder.lvl1 > .folder-items > a, .nav .folder.lvl2 > .folder-items > a { padding: 8px 10px; font-size: 13.5px; }
  .nav .folder.lvl2 > .folder-head { padding: 8px 10px; }
  .nav .folder.lvl2.open > .folder-head { background: rgba(255,255,255,.1); }
}

/* ---------- Buscador superior ---------- */
.topbar { gap: 16px; }
.gsearch { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; }
.gsearch > svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.gsearch input { padding: 9px 70px 9px 40px; background: var(--surface-2); border-color: var(--border); }
.gsearch input:focus { background: var(--surface); }
.gsearch kbd { position: absolute; right: 10px; font: 600 11px/1 ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; background: var(--surface); pointer-events: none; }
.gs-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.16); padding: 6px; z-index: 30; }
.gs-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.gs-item > svg:first-child { color: var(--primary); }
.gs-item span { flex: 1; display: flex; flex-direction: column; }
.gs-item small { color: var(--muted); font-size: 12px; }
.gs-item .gs-enter { width: 16px; height: 16px; color: var(--muted); visibility: hidden; }
.gs-item.sel, .gs-item:hover { background: var(--primary-50); }
.gs-item.sel .gs-enter { visibility: visible; }
.gs-empty { padding: 12px; color: var(--muted); }
.topbar .period-chip { margin-left: auto; }

/* ---------- Barra de acciones ---------- */
.actionbar { display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 62px; z-index: 4; }
.actionbar .crumbs { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionbar .crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.actionbar .crumbs .sep { color: #b0b7c9; }
.back-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 3px 10px rgba(29,132,200,.35); transition: transform .12s, box-shadow .12s; flex: none; }
.back-btn:hover { transform: translateX(-2px); box-shadow: 0 5px 14px rgba(29,132,200,.45); }
.back-btn svg { width: 20px; height: 20px; stroke-width: 2.6; }
.print-head { display: none; }

@media (max-width: 900px) {
  .actionbar { padding: 10px 16px; top: 62px; }
  .gsearch kbd { display: none; }
  .gsearch input { padding-right: 12px; }
}
@media (max-width: 560px) {
  .actionbar .btn span { display: none; }
  .actionbar .btn { padding: 8px; }
}
@media print {
  .actionbar, .no-print, .toast, #toasts, .seg, .tabs, .toolbar .input-icon, .search-row, .btn { display: none !important; }
  body, .app, .main { background: #fff !important; }
  #view { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .table-wrap { max-height: none; overflow: visible; }
  th { position: static; }
  .print-head { display: flex !important; align-items: center; gap: 12px; border-bottom: 2px solid #1f2d38; padding-bottom: 10px; margin-bottom: 16px; }
  .print-head img { width: 44px; height: 44px; object-fit: contain; }
  .print-head div { flex: 1; display: flex; flex-direction: column; }
  .print-head b { font-size: 18px; letter-spacing: .1em; }
  .print-head small { color: #555; }
}

/* ---------- Bodegas, módulos y documentos ---------- */
.wh-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wh-chips .chip { font-size: 12px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background .18s; }
.switch span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.module-card { border: 1px solid var(--border); transition: border-color .18s, box-shadow .18s; }
.module-card.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.sign-row { display: none; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 32px; margin-top: 56px; }
.sign-row div { border-top: 1px solid #333; padding-top: 6px; text-align: center; font-size: 12px; color: #444; }
.modal .print-head { display: none; }
@media print {
  .sign-row { display: grid; }
  body.print-modal > *:not(.print-target) { display: none !important; }
  body.print-modal .modal-bg.print-target { position: static; display: block; background: none; padding: 0; }
  body.print-modal .print-target .modal { max-width: none; max-height: none; overflow: visible; box-shadow: none; padding: 0; border-radius: 0; }
  body.print-modal .print-target .modal-actions, body.print-modal .print-target [data-close] { display: none !important; }
}

/* Código de transacción (4 letras) */
code.tc { font: 700 11px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--primary); background: var(--primary-50); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; flex: none; }
#crumbs code.tc { margin-right: 8px; }
.gs-item code.tc { min-width: 44px; text-align: center; }

/* Módulos no incluidos en el plan: visibles con candado */
.nav .lk { width: 14px; height: 14px; margin-left: auto; opacity: .75; flex: none; }
.nav .folder-items a.locked { display: flex; align-items: center; gap: 8px; opacity: .55; }
.folder-head.locked > span { opacity: .6; }
.folder-head .lk + .chev { margin-left: 4px; }
.tile.plan-locked { position: relative; filter: grayscale(1); opacity: .7; border-style: dashed; }
.tile.plan-locked:hover { opacity: .9; }
.lock-tag { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #8a5a00; background: #fff4dc; border-radius: 999px; padding: 4px 9px; }
.tile .lock-tag svg { width: 12px; height: 12px; }
.locked-page { max-width: 560px; margin: 30px auto; text-align: center; padding: 34px 28px; }
.locked-page h2 { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 21px; margin: 12px 0 6px; }
.lock-badge { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #fff4dc; color: #b7791f; }
.lock-badge svg { width: 30px; height: 30px; }

/* Menú de cuenta (arriba a la derecha) */
.user-menu { position: relative; flex: none; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font: 700 14px/1 inherit; cursor: pointer; box-shadow: 0 0 0 3px var(--primary-50); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.16); padding: 6px; z-index: 40; }
.up-who { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.up-who span { color: var(--muted); font-size: 12.5px; }
.user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.user-pop button svg { width: 18px; height: 18px; }
.user-pop button:hover { background: var(--primary-50); }
.user-pop button.danger { color: #c0392b; }
@media print { .user-menu { display: none !important; } }

/* Fondo oscuro detrás del menú en el celular: tocarlo cierra el menú */
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(15,27,61,.4); }
  .app.nav-open .sidebar { box-shadow: 0 0 30px rgba(0,0,0,.3); }
}

/* Recuperar contraseña y permisos */
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: 10px 0 0; text-align: center; width: 100%; }
.link-btn:hover { text-decoration: underline; }
.perm-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 4px; }
.perm-box fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 10px; margin: 0; }
.perm-box legend { font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.perm { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.perm input { margin-top: 2px; flex: none; }
.perm-box.all { opacity: .6; }
.perm-box.all .perm { cursor: default; }

/* ---------- Informes y documentos imprimibles ---------- */
.t-ajuste { background: #fff4dc; color: #8a5a00; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.col-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.col-pick label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; background: var(--surface); user-select: none; }
.col-pick label.on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.col-pick input { margin: 0; }
.rdoc { background: #fff; color: #111; }
.rdoc-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #1f2d38; padding-bottom: 10px; margin-bottom: 8px; }
.rdoc-head img { width: 46px; height: 46px; object-fit: contain; }
.rdoc-head div { flex: 1; display: flex; flex-direction: column; }
.rdoc-head b { font-size: 17px; color: #1f2d38; }
.rdoc-head div span { font-weight: 700; color: #1b7ec2; }
.rdoc-head small { color: #555; text-align: right; font-size: 11.5px; }
.rdoc-filters { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: #333; margin-bottom: 10px; }
.rdoc-wrap { overflow-x: auto; }
.rdoc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rdoc-table th { text-transform: none; letter-spacing: 0; white-space: normal; font-size: 12px; background: #1f2d38; color: #fff; padding: 6px; border: 1px solid #9aa5b1; text-align: center; font-weight: 600; position: static; }
.rdoc-table td { border: 1px solid #9aa5b1; padding: 4px 6px; vertical-align: top; }
.rdoc-table td.num { text-align: right; white-space: nowrap; }
.rdoc-table tbody tr:nth-child(even) td { background: #f3f6f9; }
.rdoc-table.tall td { height: 26px; }
.rdoc-table td.blank { min-width: 90px; background: #fff !important; }
.rdoc-table tfoot td { font-weight: 700; background: #e8eef3; }
.rdoc-foot { font-size: 12px; margin: 8px 0 0; color: #333; }
.rdoc-signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; margin-top: 54px; break-inside: avoid; }
.rdoc-signs div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.rdoc-signs i { display: block; border-top: 1px solid #333; margin-bottom: 2px; }
.rdoc-signs small { color: #555; font-size: 11px; }
#printDoc { display: none; }
@media print {
  body.print-doc > *:not(#printDoc) { display: none !important; }
  body.print-doc #printDoc { display: block; }
  body.print-doc .rdoc-wrap { overflow: visible; }
  body.print-doc .rdoc-table thead { display: table-header-group; }
  body.print-doc .rdoc-table tr { break-inside: avoid; }
  body.print-doc .rdoc-table th, body.print-doc .rdoc-table tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-doc .rdoc-table tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Inventario físico ---------- */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--primary-50); }
.choice input { margin-top: 3px; }
.choice div { display: flex; flex-direction: column; gap: 4px; }
.choice b { display: flex; align-items: center; gap: 8px; }
.choice span { color: var(--muted); font-size: 13px; }
.doc-list { display: grid; gap: 12px; }
.doc-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.doc-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-list > div > div:first-child { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.doc-list .btn-row { gap: 6px; }
.qentry { flex-wrap: wrap; align-items: center; }
.qentry .grow { flex: 1; min-width: 200px; }
td input.cell:disabled { opacity: .45; }
.install-steps { margin: 4px 0 12px; padding-left: 20px; line-height: 1.7; }
.login-install { margin-top: 14px; width: 100%; justify-content: center; }
.scan-box { position: relative; }
.scan-box .scan-video { display: block; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: scanmove 1.8s ease-in-out infinite alternate; pointer-events: none; }
@keyframes scanmove { from { transform: translateY(-60px); } to { transform: translateY(60px); } }

/* Acciones rápidas (celular / app instalada) */
.quick { display: none; margin-bottom: 18px; }
.quick .section-title { margin-top: 0; }
@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) {
  .quick { display: block; }
}
.qa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qa { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 96px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.qa:active { transform: scale(.98); }
.qa .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.qa .ic svg { width: 22px; height: 22px; }
.qa b { font-size: 16px; }
.qa-scan { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 72px; background: var(--primary); border-color: var(--primary); color: #fff; }
.qa-scan svg { width: 28px; height: 28px; flex: none; }
.qa-scan span { opacity: .85; font-size: 13px; margin-left: auto; }
.sess-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.totals td { padding: 5px 8px; border: 0; } .totals tr:last-child td { border-top: 2px solid var(--border); padding-top: 9px; }

/* Empresas cliente (EMPR): tabla en computador, tarjetas en celular */
.empr-cards { display: none; }
.empr-card { display: grid; gap: 8px; margin-bottom: 12px; }
.empr-card.off { opacity: .55; }
.empr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .empr-table { display: none; }
  .empr-cards { display: block; }
  .empr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .empr-kpis .kpi { gap: 10px; padding: 12px; }
  .empr-kpis .kpi .ic { width: 36px; height: 36px; }
  .empr-kpis .kpi .val { font-size: 18px; }
  .empr-kpis .kpi .lbl { font-size: 12px; }
}

/* Cupos de usuarios del plan */
.quota { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.quota-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px 14px; }
.quota-item svg { width: 18px; height: 18px; color: var(--primary); }
.quota-item b { display: block; font-size: 15px; }
.quota-item span { font-size: 12px; color: var(--muted); }
.quota-item.full { border-color: #f3c58a; background: var(--warn-bg); }
.quota-item.full svg { color: var(--warn); }
.quota-note { display: inline-flex; align-items: center; gap: 6px; }
.quota-note svg { width: 14px; height: 14px; }

.sec-title { font-size: 16px; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.sec-title svg { width: 18px; height: 18px; color: var(--primary); }
.lim-field label { display: flex; align-items: center; gap: 6px; }
.lim-field label svg { width: 16px; height: 16px; color: var(--primary); }
.lim-field.off { opacity: .5; }
.empr-link { color: inherit; text-decoration: none; }
.empr-link:hover b { color: var(--primary); text-decoration: underline; }

/* ================= Caja de ventas (POS) ================= */
body.pos-body { background: #0f1b24; }
.pos-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #24425a, #0f1b24 60%); }
.pos-login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.4); display: grid; gap: 4px; }
.pos-login-card h2 { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.pos-login-card h2 svg { color: var(--primary); }
.pos-login-logo .logo { color: var(--text); }
.pos-login-card .link-btn { text-align: center; margin-top: 8px; }
.btn.pos-big { padding: 13px 20px; font-size: 16px; justify-content: center; }
.pos-app { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.pos-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--side); color: #fff; }
.pos-brand { display: flex; align-items: center; gap: 12px; }
.pos-brand .logo { color: #fff; font-size: 0; padding: 0; }
.pos-brand .logo-mark { width: 36px; height: 36px; }
.pos-brand b { display: block; font-size: 16px; }
.pos-brand span { font-size: 12px; color: var(--side-text); }
.pos-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pos-clock { color: var(--side-text); font-size: 13px; }
.pos-user { display: inline-flex; align-items: center; gap: 6px; background: var(--side-2); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pos-user svg { width: 15px; height: 15px; }
.btn.pos-ghost { background: transparent; color: #fff; border-color: #3d5263; }
.btn.pos-ghost:hover { background: var(--side-2); }
.pos-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px; gap: 16px; padding: 16px; }
.pos-left { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pos-scan { position: relative; display: flex; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.pos-qty { width: 90px; flex: none; }
.pos-qty label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.pos-qty input { font-size: 20px; font-weight: 700; text-align: center; padding: 8px; }
.pos-code { flex: 1; position: relative; display: flex; align-items: flex-end; }
.pos-code svg { position: absolute; left: 14px; bottom: 15px; width: 22px; height: 22px; color: var(--muted); }
.pos-code input { font-size: 20px; padding: 14px 14px 14px 48px; border-width: 2px; border-color: var(--primary); }
.btn.pos-cam { align-self: flex-end; height: 56px; width: 56px; justify-content: center; }
.pos-results { position: absolute; z-index: 20; left: 114px; right: 14px; top: calc(100% - 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
.pos-results button, .pos-clist button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 10px 14px; font: inherit; cursor: pointer; }
.pos-results button:hover, .pos-clist button:hover { background: var(--primary-50); }
.pos-results span, .pos-clist span { display: block; font-size: 12px; color: var(--muted); }
.pos-clist { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.pos-lines { flex: 1; overflow: auto; }
.pos-table { width: 100%; }
.pos-table th { position: sticky; top: 0; }
.pos-table td { padding: 10px 12px; font-size: 15px; }
.pos-table tr.last td { background: #f0f8ff; }
.pos-step { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pos-step button { border: 0; background: var(--surface-2); width: 36px; height: 36px; font-size: 20px; cursor: pointer; }
.pos-step input { width: 56px; border: 0; border-radius: 0; text-align: center; font-weight: 700; padding: 6px; }
.pos-x { border: 0; background: none; color: var(--bad); cursor: pointer; padding: 6px; border-radius: 8px; }
.pos-x:hover { background: var(--bad-bg); }
.pos-x svg { width: 18px; height: 18px; }
.pos-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 40px; }
.pos-empty svg { width: 64px; height: 64px; opacity: .35; }
.pos-empty b { color: var(--text); font-size: 18px; }
.pos-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pos-customer, .pos-sum { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.pos-customer > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; }
.pos-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 15px; }
.pos-row b { color: var(--text); }
.pos-total { display: flex; flex-direction: column; gap: 2px; border-top: 2px dashed var(--border); margin-top: 8px; padding-top: 12px; }
.pos-total span { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.pos-total b { font-size: 40px; line-height: 1.1; color: var(--text); }
.btn.pos-pay { background: #16a34a; border-color: #16a34a; color: #fff; font-size: 22px; padding: 20px; justify-content: center; border-radius: 14px; position: relative; }
.btn.pos-pay:hover { background: #15803d; }
.btn.pos-pay:disabled { background: #9fbfa9; border-color: #9fbfa9; cursor: not-allowed; }
.btn.pos-pay small { position: absolute; right: 12px; top: 8px; font-size: 11px; opacity: .8; }
.btn.pos-pay svg { width: 24px; height: 24px; }
.btn.pos-cancel { justify-content: center; color: var(--bad); }
.pos-help { margin-top: auto; line-height: 1.5; }
.pos-paybox { display: grid; gap: 16px; }
.pos-paytop { display: flex; justify-content: space-between; align-items: baseline; background: var(--side); color: #fff; border-radius: 12px; padding: 14px 18px; }
.pos-paytop b { font-size: 34px; }
.pos-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pos-methods button { display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border: 2px solid var(--border); background: var(--surface); border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.pos-methods button svg { width: 30px; height: 30px; }
.pos-methods button.on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.pos-cash { font-size: 30px !important; font-weight: 700; text-align: right; padding: 12px 16px !important; }
.pos-bills { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-bills button { flex: 1 1 30%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 12px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.pos-bills button:hover { border-color: var(--primary); }
.pos-change { display: flex; justify-content: space-between; align-items: center; background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 14px 18px; font-weight: 700; }
.pos-change b { font-size: 30px; }
.pos-change.bad { background: var(--bad-bg); color: var(--bad); }
.pos-change.big b { font-size: 40px; }
.pos-seg { margin-bottom: 4px; }
.pos-dataf { display: flex; gap: 14px; align-items: center; background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 14px 18px; }
.pos-dataf svg { width: 40px; height: 40px; flex: none; }
.pos-dataf b { display: block; font-size: 18px; }
.pos-dataf span { font-size: 13px; }
.pos-qr { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.pos-qr img, .pos-qr-empty { width: 220px; height: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.pos-qr-empty { display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; border-style: dashed; border-width: 2px; }
.pos-qr-empty svg { width: 56px; height: 56px; opacity: .5; }
.pos-qr b { font-size: 16px; }
.pos-done { text-align: center; display: grid; gap: 12px; justify-items: center; }
.pos-done > svg { width: 64px; height: 64px; color: #fff; background: #16a34a; border-radius: 50%; padding: 12px; }
.pos-done h2 { margin: 0; }
.pos-done-total { font-size: 20px; color: var(--muted); }
.pos-done .pos-change { width: 100%; }
.pos-launch .pos-big { margin: 6px 0 12px; }
@media (max-width: 900px) {
  .pos-app { height: auto; min-height: 100vh; }
  .pos-main { grid-template-columns: 1fr; padding: 10px; }
  .pos-left { min-height: 50vh; }
  .pos-clock, .pos-top [data-full] { display: none; }
  .pos-qr { grid-template-columns: 1fr; justify-items: center; }
  .pos-total b { font-size: 32px; }
}

/* Ingreso: documento y factura electrónica */
.ing-doc { margin-bottom: 16px; }
.ing-doc .seg button { padding: 7px 12px; }
.fact-drop, .fact-qr { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 20px; }
.fact-drop { border: 2px dashed #b9c7d6; cursor: pointer; background: var(--surface-2); }
.fact-drop:hover, .fact-drop.over { border-color: var(--primary); background: var(--primary-50); }
.fact-drop > svg, .fact-qr > svg { width: 42px; height: 42px; color: var(--primary); }
.fact-drop b, .fact-qr b { font-size: 16px; }
.fact-drop span, .fact-qr span { color: var(--muted); max-width: 380px; line-height: 1.5; }
.fact-start { margin-bottom: 16px; }
.fact-start.compact .fact-drop, .fact-start.compact .fact-qr { padding: 14px; }
.fact-start.compact span { display: none; }
.fact-act { min-width: 240px; }
.fact-cc { margin-top: 6px; font-size: 13px; }
tr.warn-row td { background: var(--warn-bg); }
tr.off td { opacity: .5; }
.txt-warn { color: var(--warn); }
.fact-foot { margin: 14px 0 0; justify-content: space-between; }
.lim-field .input-suffix span { white-space: nowrap; font-size: 12.5px; }
.pos-customer b { flex: 1; }

/* Caja: buscar producto a mano */
.btn.pos-find { align-self: flex-end; height: 56px; position: relative; font-size: 15px; padding: 0 18px; }
.btn.pos-find svg { width: 20px; height: 20px; color: var(--primary); }
.btn.pos-find small { position: absolute; top: 3px; right: 6px; font-size: 10px; color: var(--muted); }
.pos-find-row { display: flex; gap: 10px; margin-bottom: 12px; }
.pos-find-list { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; min-height: 160px; }
.pos-find-list .pos-empty { padding: 30px; }
.pos-find-list .pos-empty svg { width: 36px; height: 36px; }
.pos-find-item { display: grid; grid-template-columns: auto 1fr auto auto 22px; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 12px 14px; font: inherit; cursor: pointer; }
.pos-find-item:hover, .pos-find-item.sel { background: var(--primary-50); }
.pos-find-item .nm small { display: block; color: var(--muted); font-size: 12px; }
.pos-find-item .stk { font-size: 12.5px; color: var(--ok); white-space: nowrap; }
.pos-find-item .stk.bad { color: var(--bad); }
.pos-find-item .pr { font-size: 16px; white-space: nowrap; }
.pos-find-item > svg { width: 20px; height: 20px; color: var(--primary); }
@media (max-width: 900px) { .btn.pos-find span, .btn.pos-find small { display: none; } .btn.pos-find { width: 56px; padding: 0; justify-content: center; } .pos-find-item { grid-template-columns: 1fr auto; } .pos-find-item code, .pos-find-item > svg { display: none; } }

/* Propietario: pantalla única de empresa */
.emp-steps { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin-bottom: 22px; align-items: start; }
.emp-steps h3, .sec-title { display: flex; align-items: center; gap: 10px; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.emp-logo-box { height: 140px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 12px; background: #fff; padding: 10px; }
.emp-logo-box img { max-width: 100%; max-height: 120px; object-fit: contain; }
.btn.disabled { opacity: .5; pointer-events: none; }
.emp-local { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin-bottom: 14px; padding: 14px 18px; }
.emp-local > svg { width: 26px; height: 26px; color: var(--primary); flex: none; }
.emp-local > div { flex: 1; display: grid; }
.emp-local:hover { border-color: var(--primary); }
@media (max-width: 900px) { .emp-steps { grid-template-columns: 1fr; } }
