@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-co { display: flex; align-items: center; gap: 8px; margin: -12px 0 22px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: .92rem; }
.login-co svg { width: 18px; height: 18px; flex: none; }
.login-co a { margin-left: auto; font-weight: 600; }
.login-co[hidden] { display: none; }
.login-co.with-logo { flex-direction: column; gap: 10px; padding: 16px 12px; text-align: center; }
.login-co img { max-width: 100%; max-height: 90px; object-fit: contain; }
.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; }
/* Menú lateral que se oculta y se muestra (computador) */
.side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.side-top .logo { min-width: 0; }
.side-hide { color: var(--side-text); opacity: .7; margin-top: 2px; }
.side-hide:hover { opacity: 1; color: #fff; background: var(--side-2); }
@media (min-width: 901px) {
  .menu-btn { display: grid; margin-left: -10px; }
  .app.nav-hidden { grid-template-columns: 1fr; background: var(--bg); }
  .app.nav-hidden .sidebar { display: none; }
  .app.nav-hidden #view { max-width: 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, .user-pop a { 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, .user-pop a svg { width: 18px; height: 18px; }
.user-pop button:hover, .user-pop a: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; }
/* Logo pequeño de SMAR junto al de la empresa cliente. */
.smar-mark { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid #c5ccd4; }
.rdoc-head .smar-mark img, .print-head .smar-mark img { width: 22px; height: 22px; object-fit: contain; }
.smar-mark em { font-style: normal; font-weight: 800; font-size: 8px; letter-spacing: .12em; color: #1f2d38; line-height: 1; }
.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-intro { font-size: 13px; margin: 8px 0; color: #222; line-height: 1.5; }
.rdoc-sub { margin: 14px 0 6px; font-size: 13px; color: #1f2d38; }
.rdoc-table tr.bold td { font-weight: 700; }
.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; }
.plan-req { margin-bottom: 14px; padding: 14px 18px; }
.plan-req-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plan-req-head b { display: inline-flex; align-items: center; gap: 8px; }
.plan-req-head svg { width: 18px; height: 18px; color: var(--primary); }
.plan-req-item { display: grid; gap: 4px; padding: 12px 0 2px; margin-top: 10px; border-top: 1px solid var(--border); }
.plan-req-item.off { opacity: .7; }
.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; }
.pos-turno { display: inline-flex; align-items: center; gap: 6px; background: #14532d; color: #bbf7d0; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pos-turno.off { background: #7f1d1d; color: #fecaca; }
.pos-turno:empty { display: none; }
.pos-turno 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-banks { margin: 6px 0 10px; }
.pos-banks > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pos-banks .pos-bills button { flex: 1 1 45%; font-size: 14px; text-align: left; line-height: 1.25; }
.pos-banks .pos-bills button small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.pos-banks .pos-bills button.on { border: 2px solid var(--primary); background: var(--surface); box-shadow: var(--shadow); }
.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.warn { background: var(--warn-bg); color: var(--warn); }
.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-denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.pos-denoms label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.pos-denoms span { flex: 1; font-weight: 600; white-space: nowrap; }
.pos-denoms input { width: 64px; text-align: right; font-size: 16px; }
.pos-done.warn > svg { background: #d97706; }
.pos-z { width: 100%; max-width: 420px; border-collapse: collapse; text-align: left; }
.pos-z td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.pos-z td.num { text-align: right; white-space: nowrap; }
.pos-z tr.b td { font-weight: 700; }
.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); }
.txt-bad { color: var(--bad); }
.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; } }

/* Usuario generado y datos de ingreso para entregar */
.uname-box { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.cred-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0; padding: 14px 16px; border-radius: 12px; background: var(--primary-50); border: 1px solid var(--border); }
.cred-box span { color: var(--muted); font-size: 13px; align-self: center; }
.cred-box b { font-size: 17px; letter-spacing: .3px; word-break: break-all; }
.adm-list .list-row { gap: 10px; }
.force-pw { max-width: 440px; }

/* Propietario: módulos y submódulos por empresa */
.sm-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.sm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sm-legend .i { width: 15px; height: 15px; }
.sm-mod { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.sm-mod.on { border-color: #b9dcf1; }
.sm-mod.off { background: var(--surface-2); }
.sm-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; }
.sm-head .ttl { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; flex-wrap: wrap; }
.sm-head .ttl .i { width: 20px; height: 20px; color: var(--primary); }
.sm-mod.off .sm-head .ttl, .sm-mod.off .sm-head .ttl .i { color: var(--muted); }
.sm-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex: none; }
.sm-mod.open .sm-chev { transform: rotate(90deg); }
.sm-count { font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 150px; text-align: right; }
.sm-count b { color: var(--text); }
.sm-bar { height: 6px; width: 90px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; flex: none; }
.sm-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.sm-body { border-top: 1px solid var(--border); padding: 6px 18px 14px; }
.sm-tools { display: flex; gap: 8px; align-items: center; padding: 10px 0 6px; flex-wrap: wrap; }
.sm-tools .grow { flex: 1; color: var(--muted); font-size: 13px; }
.sm-sub { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.sm-sub:nth-child(even) { background: var(--surface-2); }
.sm-sub .nm { flex: 1; min-width: 0; }
.sm-sub .nm b { display: block; font-weight: 600; }
.sm-sub .nm span { color: var(--muted); font-size: 12.5px; }
.sm-sub.off .nm b { color: var(--muted); }
.sm-tc, .sm-act { font: 600 11px ui-monospace, Menlo, monospace; padding: 3px 7px; border-radius: 6px; min-width: 46px; text-align: center; flex: none; }
.sm-tc { background: var(--primary-50); color: var(--primary-600); }
.sm-act { background: #f1eefc; color: #5b3fc4; }
.sm-sub.off .sm-tc, tr.lk .sm-tc { background: var(--gray-bg); color: var(--muted); }
.sm-state { font-size: 12px; font-weight: 600; width: 92px; text-align: right; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.sm-state .i { width: 14px; height: 14px; }
.sm-state.on { color: var(--ok); } .sm-state.off { color: var(--muted); }
.sm-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; letter-spacing: .2px; }
.sm-tag.es { background: var(--ok-bg); color: var(--ok); }
.sm-tag.op { background: #f1eefc; color: #5b3fc4; }
/* Administrador: permisos por submódulo y acción */
.pm-wrap { display: grid; grid-template-columns: 240px 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 340px; margin-top: 4px; }
.pm-wrap.all { opacity: .6; pointer-events: none; }
.pm-nav { background: var(--surface-2); border-right: 1px solid var(--border); padding: 8px; }
.pm-nav button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.pm-nav button .i { width: 17px; height: 17px; color: var(--muted); flex: none; }
.pm-nav button span { flex: 1; font-weight: 550; }
.pm-nav button small { font-weight: 700; font-size: 11.5px; color: var(--muted); background: var(--gray-bg); padding: 1px 7px; border-radius: 99px; }
.pm-nav button.sel { background: var(--surface); box-shadow: var(--shadow); }
.pm-nav button.sel .i { color: var(--primary); }
.pm-nav button.sel small { background: var(--primary-50); color: var(--primary-600); }
.pm-nav button.lockd { color: var(--muted); }
.pm-nav .sep { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .5px; padding: 10px 10px 4px; text-transform: uppercase; }
.pm-pane { padding: 14px 18px; min-width: 0; overflow-x: auto; }
.pm-pane h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; flex: 1; }
.pm-mtx { width: 100%; border-collapse: collapse; margin-top: 10px; }
.pm-mtx th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.pm-mtx th:first-child, .pm-mtx td:first-child { text-align: left; }
.pm-mtx td { padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.pm-mtx td .row1 { display: flex; align-items: center; gap: 9px; }
.pm-mtx input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.pm-mtx .na { color: #c3c8d4; }
.pm-mtx tr.lk td { background: repeating-linear-gradient(135deg, #f7f8fc, #f7f8fc 8px, #f1f3f8 8px, #f1f3f8 16px); color: var(--muted); }
.pm-lk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #8a5a12; background: var(--warn-bg); padding: 3px 9px; border-radius: 99px; }
.pm-lk .i { width: 13px; height: 13px; }
@media (max-width: 760px) {
  .sm-head { padding: 12px 14px; flex-wrap: wrap; }
  .sm-head .ttl { flex: 1 1 calc(100% - 40px); row-gap: 4px; }
  .sm-count { flex: 1; min-width: 0; text-align: left; padding-left: 30px; }
  .sm-bar, .sm-state, .sm-tools .grow, .sm-sub .nm span { display: none; }
  .sm-body { padding: 4px 10px 12px; }
  .sm-sub { padding: 9px 6px; gap: 9px; }
  .pm-wrap { grid-template-columns: 1fr; }
  .pm-nav { border-right: 0; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; gap: 4px; }
  .pm-nav .sep { display: none; }
  .pm-nav button { width: auto; white-space: nowrap; flex: none; }
  .pm-pane { padding: 10px; }
  .pm-mtx th { font-size: 10px; letter-spacing: 0; padding: 6px 3px; }
}

/* ---------- Logo de certificación (ISO, ente certificador) ---------- */
.cert-mark { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.rdoc-head .cert-mark img, .print-head .cert-mark img { width: auto; height: 46px; max-width: 120px; object-fit: contain; }
.cert-mark em { font-style: normal; font-size: 9.5px; color: #555; max-width: 160px; text-align: center; line-height: 1.2; }
.rdoc-head small + .cert-mark { margin-left: 4px; }
.rdoc-head .cert-mark + .cert-mark { margin-left: -2px; }
.rdoc-certfoot, .print-cert.on { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.rdoc-certfoot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #ccd3da; break-inside: avoid; }
.rdoc-certfoot > div, .print-cert > div { display: flex; gap: 10px; align-items: flex-end; }
.rdoc-certfoot > div:nth-child(2), .print-cert > div:nth-child(2) { justify-content: center; }
.rdoc-certfoot > div:nth-child(3), .print-cert > div:nth-child(3) { justify-content: flex-end; }
.rdoc-certfoot .cert-mark img { height: 40px; max-width: 130px; object-fit: contain; }
.print-cert { display: none; }
@media print {
  .print-head > .cert-mark { flex: none; }
  .print-cert.on { position: fixed; left: 0; right: 0; bottom: 0; }
  .print-cert .cert-mark img { height: 36px; max-width: 120px; object-fit: contain; }
}
.emp-cert { margin-bottom: 22px; }
.cert-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 12px 0; }
.cert-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cert-item-head b { margin-right: auto; }
.emp-cert h3 .chip { font-weight: 600; }
.cert-grid { display: grid; grid-template-columns: 260px 300px 1fr; gap: 22px; align-items: start; }
.cert-box { height: 110px; }
.cert-box img { max-height: 88px; }
.cert-grid .lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.cert-sheet { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 64px 1fr 64px; gap: 6px; aspect-ratio: 8.5 / 11; max-height: 340px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 10px rgba(20,30,50,.08); }
.cert-sheet .cz { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px dashed #c6cedb; border-radius: 6px; font-size: 10.5px; color: var(--muted); cursor: pointer; text-align: center; padding: 3px; line-height: 1.15; transition: border-color .15s, background .15s; }
.cert-sheet .cz:hover { border-color: var(--primary); }
.cert-sheet .cz input { position: absolute; opacity: 0; pointer-events: none; }
.cert-sheet .cz.on { border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 9%, #fff); color: var(--primary); font-weight: 700; }
.cert-sheet .cz img { max-height: 30px; max-width: 90%; object-fit: contain; }
.cert-sheet .cz svg { width: 20px; height: 20px; }
.cert-sheet .cz-header_left { grid-column: 1 / 2; }
.cert-sheet .cz-header_right { grid-column: 3 / 4; }
.cert-sheet .cs-body { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 9px; padding: 8px 4px; }
.cert-sheet .cs-body i { height: 7px; border-radius: 4px; background: #e8ecf2; }
.cert-sheet .cs-body i:nth-child(1) { background: #c9d3df; height: 10px; }
.cert-sheet .cs-body i:nth-child(odd) { width: 92%; }
.cert-docs { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
.cert-docs label.check { align-items: flex-start; font-size: 13.5px; }
.cert-docs input { margin-top: 2px; }
@media (max-width: 1100px) { .cert-grid { grid-template-columns: 1fr 1fr; } .cert-grid > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .cert-grid { grid-template-columns: 1fr; } .cert-sheet { max-width: 260px; margin: 0 auto; } }

/* ---------- Cartera ---------- */
.crt-bar { margin-bottom: 16px; flex-wrap: wrap; }
.btn.danger-o { color: var(--bad); border-color: #f2c4c4; }
.btn.danger-o:hover { background: var(--bad-bg); }
.crt-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.crt-body { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.age-bar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--gray-bg); margin: 6px 0 16px; }
.age-bar i { display: block; height: 100%; }
.age-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.age-legend div { display: grid; gap: 2px; }
.age-legend span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.age-legend small { color: var(--muted); font-size: 12px; }
.age-legend b { font-size: 15px; }
.crt-fu { display: grid; gap: 8px; }
.crt-fu .fu { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; border-left: 4px solid var(--primary); }
.crt-fu .fu.late { border-left-color: var(--bad); background: #fffafa; }
.crt-fu .fu.today { border-left-color: var(--warn); background: #fffcf5; }
.crt-fu .when { width: 92px; flex: none; display: grid; }
.crt-fu .when small { color: var(--muted); font-size: 11.5px; }
.crt-fu .fu.late .when b { color: var(--bad); }
.crt-fu .fu.today .when b { color: var(--warn); }
.crt-fu .what { flex: 1; min-width: 0; display: grid; }
.crt-fu .what a { color: var(--text); text-decoration: none; }
.crt-head { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.crt-head h2 { margin: 0 0 4px; }
.crt-contact { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.crt-contact > * { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.crt-contact svg.i { width: 15px; height: 15px; }
.crt-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.crt-nums.big { grid-template-columns: repeat(2, minmax(150px, 1fr)); align-content: center; gap: 14px 28px; }
.crt-nums small { display: block; color: var(--muted); font-size: 12px; }
.crt-nums b { font-size: 15px; }
.crt-nums.big b { font-size: 22px; }
.crt-cuotas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.crt-cuotas .cuota { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 3px; background: var(--surface-2); }
.crt-cuotas .cuota small { color: var(--muted); font-size: 12px; }
.crt-cuotas .cuota b { font-size: 16px; }
.crt-cuotas .cuota span:not(.chip) { font-size: 12.5px; }
.crt-cuotas .cuota .chip { justify-self: start; }
.crt-cuotas .cuota.pagada { background: var(--ok-bg); border-color: #bfe5cb; }
.crt-cuotas .cuota.vencida { background: var(--bad-bg); border-color: #f2c4c4; }
.crt-timeline { display: grid; gap: 14px; max-height: 620px; overflow: auto; padding-right: 4px; }
.crt-timeline .tl { display: flex; gap: 10px; }
.crt-timeline .dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.crt-timeline .dot svg { width: 15px; height: 15px; }
.crt-timeline .tl.promesa .dot, .crt-timeline .tl.acuerdo .dot { background: var(--warn-bg); color: var(--warn); }
.crt-timeline .tl.suspension .dot, .crt-timeline .tl.cancelacion .dot { background: var(--bad-bg); color: var(--bad); }
.crt-timeline .tl.reactivacion .dot { background: var(--ok-bg); color: var(--ok); }
.crt-timeline .tl > div:last-child { display: grid; gap: 3px; min-width: 0; }
.crt-prog { height: 7px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; margin-bottom: 4px; min-width: 120px; }
.crt-prog i { display: block; height: 100%; background: var(--ok); }
.crt-card .btn-row { flex-wrap: wrap; }
.crt-top > *, .crt-body > * { min-width: 0; }
@media (max-width: 1100px) { .crt-top, .crt-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .age-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crt-nums.big { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .crt-nums.big b { font-size: 18px; }
  .crt-fu .when { width: 70px; }
}
/* ---------- Factura electrónica de venta (vista previa e impresión) ---------- */
.rdoc-head div em { font-style: normal; font-size: 11.5px; color: #333; line-height: 1.35; }
.fac-box { flex: 0 0 auto !important; min-width: 210px; border: 1.5px solid #1f2d38; border-radius: 8px; padding: 8px 12px; text-align: center; align-items: center; gap: 1px; }
.fac-box b { font-size: 11.5px !important; letter-spacing: .3px; }
.fac-box strong { font-size: 20px; color: #1b7ec2; }
.fac-box small { font-size: 11px; color: #444; text-align: center !important; }
.fac-box i { font-style: normal; font-weight: 700; font-size: 11px; color: #b45309; margin-top: 3px; }
.fac-box i.ok { color: #1d7a46; }
.fac-res { font-size: 10.5px; color: #555; margin: 0 0 8px; }
.fac-sum { margin: 10px 0 0 auto; min-width: 280px; border-collapse: collapse; font-size: 12.5px; }
.fac-sum td { padding: 3px 8px; }
.fac-sum td:last-child { text-align: right; white-space: nowrap; }
.fac-sum tr.strong td { background: #1f2d38; color: #fff; font-weight: 700; font-size: 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fac-cufe { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px dashed #9aa5b1; break-inside: avoid; }
.fac-cufe img, .fac-qr { width: 96px; height: 96px; flex: 0 0 96px; }
.fac-qr { border: 1.5px dashed #9aa5b1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: #777; }
.fac-cufe p { margin: 2px 0; font-size: 12px; }
.fac-cufe code { font-size: 10.5px; word-break: break-all; }
.fac-pend { color: #b45309; font-style: italic; }
@media (max-width: 700px) { .rdoc-invoice .rdoc-head { flex-wrap: wrap; } .fac-box { width: 100%; } .fac-sum { min-width: 0; width: 100%; } }

.pos-bill { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; border-radius: 10px; padding: 8px 10px; margin: -4px 0 10px; line-height: 1.35; }
.pos-bill svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.pos-bill.ok { background: rgba(29, 122, 70, .12); color: #1d7a46; }
.pos-bill.warn { background: rgba(180, 83, 9, .12); color: #b45309; }
.pos-bill.bad { background: rgba(185, 28, 28, .12); color: #b91c1c; }

.nit-row { display: flex; align-items: center; gap: 6px; }
.nit-row input:first-child { flex: 1; min-width: 0; }
.nit-row input:last-child { width: 48px; text-align: center; }
.chk-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 4px; }
#vt > .notice { margin-bottom: 16px; }
/* Precios de planes (PLAN): se ven los valores; al tocar un plan se modifica */
.plan-card { margin-bottom: 16px; padding-bottom: 8px; }
.plan-card h3 { margin-bottom: 6px; }
.plan-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.plan-row:first-of-type { border-top-color: transparent; }
.plan-row:hover, .plan-row:focus-visible { background: var(--surface-2); outline: none; }
.plan-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.plan-val b { font-size: 16px; }
.plan-ed { color: var(--muted); display: flex; }
.plan-ed svg { width: 18px; height: 18px; }
.money-in { position: relative; width: 100%; }
.money-in span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-in input { padding-left: 26px; text-align: right; font-weight: 600; font-size: 18px; width: 100%; }
@media (max-width: 640px) {
  .plan-row { gap: 10px; }
  .plan-info .small { display: none; }
}

/* Nuestros planes (administrador) */
.plan-strip { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; text-decoration: none; color: inherit; padding: 14px 18px; }
.plan-strip .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.plan-strip b { font-size: 15px; }
.plan-strip-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 600; font-size: 13px; white-space: nowrap; }
.plan-strip-cta svg.i { width: 16px; height: 16px; }
.plan-current { border: 2px solid var(--primary); }
.plan-current-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.plan-current-head h2 { margin: 10px 0 4px; font-size: 22px; }
.plan-current-head p { margin: 0; }
.plan-fee { display: flex; flex-direction: column; align-items: flex-end; }
.plan-fee b { font-size: 26px; color: var(--primary-600); font-variant-numeric: tabular-nums; }
.plan-fee span { color: var(--muted); font-size: 12.5px; }
.plan-fee.sm { flex-direction: row; align-items: baseline; gap: 6px; margin: 6px 0 4px; }
.plan-fee.sm b { font-size: 20px; }
.plan-cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-list li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.plan-list li svg.i { width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
.plan-list li.plus svg.i { color: var(--primary); }
.plan-list.off li { color: var(--muted); }
.plan-list.off li svg.i { color: var(--muted); }
.plan-list.users li svg.i { color: var(--muted); }
.plan-list .grow { flex: 1; }
.np-cards { align-items: stretch; }
.np-card { position: relative; display: flex; flex-direction: column; gap: 4px; }
.np-card h3 { font-size: 16px; line-height: 1.3; }
.np-card p { margin: 0 0 8px; }
.np-card .plan-list { margin: 4px 0 12px; }
.np-card .btn { margin-top: auto; justify-content: center; }
.np-card.next { border: 2px solid var(--accent); }
.plan-badge { position: absolute; top: -11px; right: 14px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.plan-badge svg.i { width: 13px; height: 13px; }
.plan-loses { color: var(--warn); display: flex; gap: 6px; align-items: flex-start; margin: -4px 0 12px !important; }
.plan-loses svg.i { width: 16px; height: 16px; }
@media (max-width: 900px) { .np-cards.g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .np-cards.g3, .plan-cols.g2 { grid-template-columns: 1fr; }
  .plan-fee { align-items: flex-start; }
}
.plan-more { margin-top: 22px; }
.plan-more summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 6px 0 14px; }
.plan-more .np-cards { margin-top: 6px; }
.modal-actions.wrap { flex-wrap: wrap; }
/* ===== Financiera: envíos y resumen financiero ===== */
.crt-sendlist { display: grid; gap: 6px; margin-top: 14px; max-height: 320px; overflow: auto; }
.crt-sendlist > div { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; flex-wrap: wrap; }
.crt-sendlist > div > :first-child { flex: 1; min-width: 140px; font-weight: 600; color: var(--text); text-decoration: none; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.fin-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.fin-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fin-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fin-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 220px; align-items: end; padding-top: 10px; }
.fin-chart .fm { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; cursor: default; }
.fin-chart .bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; border-bottom: 1px solid var(--border); }
.fin-chart .bars i { width: min(14px, 40%); border-radius: 4px 4px 0 0; min-height: 0; }
.fin-chart .fm:hover .bars { background: var(--surface-2); border-radius: 6px; }
.fin-chart small { text-align: center; font-size: 11px; color: var(--muted); }

.fin-list { display: grid; }
.fin-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.fin-list > div:last-child { border-bottom: 0; }
.fin-list .tot { border-top: 2px solid var(--border); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.fin-list .tot b { font-size: 17px; }
.fin-cats { display: grid; gap: 10px; }
.fin-cats .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 3px; }

/* ===== Financiera › Informes ===== */
.fin-rep { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.fin-types { display: grid; gap: 4px; padding: 14px; }
.fin-types h3 { margin: 4px 6px 8px; }
.fin-types button { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text); font: inherit; }
.fin-types button:hover { background: var(--surface-2); }
.fin-types button.on { background: var(--primary-50); }
.fin-types button.on b { color: var(--primary); }
.fin-types .ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.fin-types button.on .ic { background: var(--primary); color: #fff; }
.fin-types .ic svg { width: 16px; height: 16px; }
.fin-types b { display: block; font-size: 14px; }
.fin-types small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.fin-more { display: flex; align-items: center; gap: 8px; margin: 8px 10px 2px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--primary); text-decoration: none; }
.fin-more svg { width: 15px; height: 15px; }
.fin-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-presets .chip { cursor: pointer; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12.5px; padding: 5px 11px; }
.fin-presets .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fin-params { gap: 0 14px; }
@media (max-width: 900px) { .fin-rep { grid-template-columns: minmax(0, 1fr); } .fin-types { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; } .fin-types small { display: none; } .fin-types button { padding: 7px 8px; align-items: center; } .fin-types b { font-size: 13px; } .fin-types h3, .fin-more { grid-column: 1 / -1; } }

/* Conteo de inventario desde el celular */
.count-m { max-width: 640px; margin: 0 auto; }
.count-m .card { margin-bottom: 14px; }
.cm-prog { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cm-prog .bar { height: 10px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; }
.cm-prog .bar span { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.cm-mode { width: 100%; }
.cm-mode button { flex: 1; padding: 10px; font-size: 15px; }
.cm-scan { display: flex; gap: 8px; }
.cm-scan input { flex: 1; font-size: 18px; padding: 14px; min-width: 0; }
.cm-scan .btn { padding: 0 18px; }
.cm-item { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.cm-name { font-size: 17px; margin-bottom: 4px; }
.cm-qty { width: 100%; font-size: 30px; padding: 14px; margin: 12px 0; text-align: center; }
.cm-save { width: 100%; padding: 14px; font-size: 16px; justify-content: center; }
.cm-list { display: flex; flex-direction: column; gap: 6px; }
.cm-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; cursor: pointer; font: inherit; }

/* Entregas de una carga */
.stops { display: flex; flex-direction: column; gap: 8px; }
.stop { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stop.st-entregado { border-color: var(--ok); }
.stop.st-no_entregado { border-color: var(--bad); }
.stop-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gray-bg); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.stop-b { flex: 1; min-width: 0; }
.stop-proof { display: flex; gap: 8px; margin-top: 8px; }
.stop-proof img { height: 72px; max-width: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.sign-pad { width: 100%; height: 170px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; touch-action: none; display: block; }
.dlv-prev { display: block; max-height: 180px; max-width: 100%; margin-top: 8px; border-radius: 10px; }
@media (max-width: 560px) { .stop { flex-wrap: wrap; } .stop > .btn { width: 100%; justify-content: center; } }
.sub-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }

.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.recovery-codes code { font-size: 16px; padding: 8px; text-align: center; background: var(--gray-bg); border-radius: 8px; letter-spacing: 1px; }

.trial-bar { background: var(--warn-bg); color: var(--warn); padding: 8px 18px; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.trial-bar a { color: inherit; font-weight: 700; }

/* Nómina */
.nom-sec { margin: 14px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nom-check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; line-height: 1.45; cursor: pointer; }
.nom-check input { margin-top: 3px; width: auto; }
.nom-tot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px 28px; margin-top: 12px; font-size: 14px; }
.nom-net { color: var(--primary); }
.nom-big { background: #1f2d38; color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 16px; }
.nom-liq { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.nom-runhead h2 { font-size: 19px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 900px) { .nom-liq { grid-template-columns: 1fr; } }
.nom-cards { display: none; }
.nom-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.nom-card-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
@media (max-width: 700px) { .nom-desk { display: none; } .nom-cards { display: block; } }

/* Nómina: aprobación y pagos */
.nom-apr { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
@media (max-width: 1000px) { .nom-apr { grid-template-columns: 1fr; } }
.nom-docprev { overflow-x: auto; }
.nom-log { list-style: none; margin: 0; padding: 0; }
.nom-log li { position: relative; padding: 0 0 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.nom-log li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.nom-log li::after { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border, #e3e7ec); }
.nom-log li:last-child::after { display: none; }
.nom-log .nom-log-aprobar::before { background: #1f9d55; }
.nom-log .nom-log-devolver::before, .nom-log .nom-log-anular::before { background: #d64545; }
.nom-log .nom-log-enviar::before, .nom-log .nom-log-revisar::before { background: var(--primary); }
.nom-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nom-bank { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; border: 1px solid var(--border, #e3e7ec); border-radius: 10px; color: var(--muted); }
.nom-bank span { flex: 1; font-size: 13px; }
.nom-bank small { width: 100%; padding-left: 26px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.nom-bank.on { color: inherit; border-color: var(--primary); }
.nom-bank svg { width: 18px; height: 18px; flex: none; }

/* Accesos fijos del menú principal: planes de SMAR y WhatsApp */
.btn.wa { background: #1faa53; border-color: #1faa53; color: #fff; }
.btn.wa:hover { background: #178a43; border-color: #178a43; }
.side-cta { margin-top: auto; display: grid; gap: 6px; padding: 12px 0; }
.side-cta + .user-box { margin-top: 0; }
.side-cta a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14px; }
.side-cta a svg { width: 18px; height: 18px; flex: none; }
.side-cta-plan { background: rgba(29,132,200,.18); color: #cfe8f8; border: 1px solid rgba(29,132,200,.45); }
.side-cta-plan:hover { background: var(--primary); color: #fff; }
.side-cta-wa { background: #1faa53; color: #fff; }
.side-cta-wa:hover { background: #178a43; }
.login-cta { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.login-cta p { margin: 0 0 2px; font-weight: 600; text-align: center; color: var(--muted); }
.login-cta .btn { width: 100%; justify-content: center; }
.login-cta .link-btn { padding-top: 4px; text-decoration: none; }

/* Mesa de ayuda: botón fijo en la barra superior (computador y celular), menú lateral y caja */
.help-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #1faa53; background: #e9f8ef; color: #137a3b; font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.help-btn svg { width: 18px; height: 18px; }
.help-btn:hover { background: #1faa53; color: #fff; }
.side-cta button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 0; font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; width: 100%; }
.side-cta button svg { width: 18px; height: 18px; flex: none; }
.help-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.help-type { display: flex; align-items: center; gap: 8px; padding: 8px 10px; line-height: 1.25; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.help-type input { width: auto; margin: 0; }
.help-type:has(input:checked) { border-color: #1faa53; background: #e9f8ef; }
.modal h3 svg { width: 20px; height: 20px; vertical-align: -3px; color: #1faa53; }
@media (max-width: 900px) {
  .help-btn { width: 38px; padding: 0; justify-content: center; }
  .help-btn span { display: none; }
}

/* ---------- CRM ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.crm-home { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.crm-cols { align-items: start; }
.crm-tasks { display: grid; }
.crm-task { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.crm-task:last-child { border-bottom: 0; }
.crm-task.vencida .crm-task-body > b { color: var(--bad); }
.crm-task.hecha .crm-task-body > b { text-decoration: line-through; color: var(--muted); }
.crm-check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #b9c3d6; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; }
.crm-check:hover { border-color: var(--ok); background: var(--ok-bg); }
.crm-check svg { width: 15px; height: 15px; }
.crm-task.hecha .crm-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.crm-task-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.crm-task-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.crm-timeline { display: grid; gap: 0; position: relative; }
.crm-ev { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.crm-ev::before { content: ''; position: absolute; left: 15px; top: 40px; bottom: -6px; width: 2px; background: var(--border); }
.crm-ev:last-child::before { display: none; }
.crm-ev > div { min-width: 0; }
.crm-ev.sys b { color: var(--muted); font-weight: 600; }
.crm-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); position: relative; z-index: 1; }
.crm-dot svg { width: 16px; height: 16px; }
.crm-funnel { display: grid; gap: 8px; }
.crm-fbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; text-decoration: none; color: var(--text); font-size: 13.5px; }
.crm-fbar i { display: block; height: 14px; border-radius: 7px; min-width: 4px; }
.crm-fbar b { font-size: 13px; white-space: nowrap; }
.crm-mini { display: grid; }
.crm-mini > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); align-items: center; }
.crm-mini > div:last-child { border-bottom: 0; }
.crm-mini > div > span.muted { grid-column: 1; }
.crm-mini-act { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.crm-head { display: grid; gap: 14px; }
.crm-head-main { display: flex; gap: 16px; align-items: flex-start; }
.crm-head-main h2 { font-size: 21px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-head-main > div:last-child { display: grid; gap: 3px; min-width: 0; }
.crm-avatar { flex: none; width: 54px; height: 54px; border-radius: 16px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.crm-avatar svg { width: 26px; height: 26px; }
.crm-amount { font-size: 22px; font-weight: 700; margin-top: 4px; }
.crm-steps { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.crm-step { flex: 1; min-width: 110px; border: 0; padding: 9px 12px; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); background: var(--gray-bg); cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.crm-step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.crm-step.done { background: color-mix(in srgb, var(--c) 18%, white); color: var(--c); }
.crm-step.on { background: var(--c); color: #fff; }
.crm-step:disabled { cursor: default; }
.crm-kpis { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.crm-kpis b { color: var(--text); }
.crm-board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.crm-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; min-height: 160px; display: flex; flex-direction: column; }
.crm-col.over { outline: 2px dashed var(--primary); outline-offset: -4px; }
.crm-col-head { padding: 11px 12px; border-top: 4px solid; border-radius: 12px 12px 0 0; display: grid; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--border); }
.crm-col-body { padding: 10px; display: grid; gap: 10px; }
.crm-col-empty { text-align: center; color: var(--muted); padding: 18px 0; }
.crm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; display: grid; gap: 4px; cursor: pointer; box-shadow: var(--shadow); }
.crm-card:hover { border-color: #b7c8e8; }
.crm-card.drag { opacity: .5; }
.crm-card svg { width: 13px; height: 13px; vertical-align: -2px; }
.crm-card-foot { display: flex; justify-content: space-between; gap: 4px 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.crm-card-foot span { white-space: nowrap; }
.crm-move { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.crm-kinds { margin-top: 4px; }
@media (max-width: 900px) {
  .crm-home { grid-template-columns: 1fr; }
  .crm-board { grid-template-columns: repeat(6, minmax(78vw, 1fr)); scroll-snap-type: x mandatory; }
  .crm-col { scroll-snap-align: start; }
  .crm-fbar { grid-template-columns: 100px 1fr auto; }
  .crm-head-act .btn { flex: 1 1 auto; justify-content: center; }
  .crm-step { min-width: 0; flex: 1 1 40%; font-size: 12px; padding: 8px; clip-path: none; border-radius: 8px; }
  .crm-task { flex-wrap: wrap; }
  .crm-task-act { width: 100%; justify-content: flex-start; padding-left: 38px; }
}

/* CRM: diseño más visual */
.crm-av { flex: none; border-radius: 50%; background: var(--av); color: #fff; display: inline-grid; place-items: center; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px #fff; }
.with-av-row { display: flex; gap: 10px; align-items: center; }
.crm-mini > div.with-av { grid-template-columns: auto 1fr auto; }
.crm-mini > div.with-av > .crm-av { grid-row: 1 / span 2; }
.crm-mini > div.with-av > span.muted { grid-column: 2; }
.crm-mini > div.with-av > .crm-mini-act { grid-column: 3; }
.crm-health { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--hc); background: color-mix(in srgb, var(--hc) 12%, white); white-space: nowrap; vertical-align: middle; }
.crm-health i { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--hc) calc(var(--p) * 1%), color-mix(in srgb, var(--hc) 22%, white) 0); }
.crm-health.nuevo { color: var(--muted); background: var(--gray-bg); padding-left: 10px; }
.crm-gauge { display: flex; gap: 18px; align-items: center; }
.crm-gauge-ring { flex: none; width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--surface) 76%, transparent 77%), conic-gradient(var(--hc) calc(var(--p) * 1%), var(--gray-bg) 0); }
.crm-gauge-ring b { font-size: 30px; line-height: 1; color: var(--hc); }
.crm-gauge-ring small { color: var(--muted); font-size: 11px; }
.crm-gauge-lbl { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.crm-why { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13.5px; }
.crm-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px; margin-bottom: 20px; color: #fff; background: linear-gradient(120deg, #1d4ed8 0%, #1d84c8 45%, #0ea5a4 100%); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; box-shadow: 0 14px 34px rgba(29, 99, 200, .25); }
.crm-hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.crm-hero-hi { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.crm-hero-sum { margin: 6px 0 16px; font-size: 15px; line-height: 1.5; opacity: .95; }
.crm-hero-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }
.crm-hero-act .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(4px); }
.crm-hero-act .btn:hover { background: rgba(255, 255, 255, .28); }
.crm-hero-seg { background: rgba(255, 255, 255, .16); }
.crm-hero-seg button { color: rgba(255, 255, 255, .85); }
.crm-hero-seg button.on { background: #fff; color: #1d4ed8; }
.crm-hero-kpis { display: grid; gap: 10px; position: relative; z-index: 1; }
.crm-hero-kpis > div { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 10px; }
.crm-hero-kpis > div.bad { background: rgba(220, 38, 38, .35); }
.crm-hero-kpis span { font-size: 12.5px; opacity: .9; }
.crm-hero-kpis b { font-size: 20px; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.crm-hero-kpis small { font-size: 12px; opacity: .8; }
.crm-sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 12px; }
.crm-sec-title h3 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.crm-steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 20px; }
.crm-step-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.crm-step-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 24, 40, .1); }
.crm-step-top { display: flex; align-items: center; gap: 8px; }
.crm-step-top .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.crm-step-top .ic svg { width: 16px; height: 16px; }
.crm-step-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); flex: 1; }
.crm-step-val { font-size: 14px; }
.crm-step-title { font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.35; }
.crm-step-title:hover { color: var(--primary); }
.crm-step-why { font-size: 13px; color: var(--muted); line-height: 1.45; }
.crm-step-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.crm-reorder { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.crm-reorder .card + .card { margin-top: 0; }
.crm-ro { display: grid; gap: 10px; align-content: start; }
.crm-ro-head { display: flex; gap: 12px; align-items: flex-start; }
.crm-ro-head > div { flex: 1; min-width: 0; }
.crm-ro-items { width: 100%; border-collapse: collapse; }
.crm-ro-items td { padding: 7px 4px; border-bottom: 1px dashed var(--border); vertical-align: middle; }
.crm-ro-items td.num { text-align: right; font-weight: 700; white-space: nowrap; }
.crm-ro-items td:last-child { text-align: right; }
.crm-ro-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.crm-ro-foot > b { font-size: 18px; color: var(--ok); }
.crm-stock { margin-top: 12px; border-radius: 10px; padding: 10px 12px; display: grid; gap: 5px; font-size: 13px; }
.crm-stock.ok { background: var(--ok-bg); }
.crm-stock.bad { background: var(--bad-bg); }
.crm-stock > b { display: flex; gap: 6px; align-items: center; }
.crm-stock > b svg { width: 16px; height: 16px; }
.crm-stock > div { display: flex; justify-content: space-between; gap: 10px; }
.crm-card { border-left: 4px solid var(--sc); }
.crm-card-top { display: flex; gap: 8px; align-items: flex-start; }
.crm-card-top > div { display: grid; gap: 1px; min-width: 0; }
.crm-prob { height: 5px; border-radius: 99px; background: var(--gray-bg); overflow: hidden; margin-top: 4px; }
.crm-prob i { display: block; height: 100%; background: var(--sc); border-radius: 99px; }
.crm-move { align-items: center; }
.crm-owner { margin-right: auto; }
@media (max-width: 900px) {
  .crm-hero { grid-template-columns: 1fr; padding: 20px; border-radius: 14px; }
  .crm-hero-hi { font-size: 22px; }
  .crm-steps-grid { grid-template-columns: 1fr; }
  .crm-reorder { grid-template-columns: 1fr; }
  .crm-gauge-ring { width: 86px; height: 86px; }
  .crm-gauge-ring b { font-size: 24px; }
}

/* Promoción de un plan: precio normal tachado + precio de promoción */
.fee-old { color: var(--muted); font-size: 13px; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.plan-fee.sm .fee-old { font-size: 14px; }
.promo-tag { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; background: #fff1e6; color: #c2410c; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.promo-tag svg.i { width: 12px; height: 12px; }
.plan-val .promo-tag { align-self: flex-end; }
.promo-until { display: block; color: #c2410c; font-size: 12px; font-weight: 600; }
.promo-box { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.promo-box h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .promo-tag { background: #3b2414; color: #fdba74; } :root:not([data-theme="light"]) .promo-until { color: #fdba74; } }
:root[data-theme="dark"] .promo-tag { background: #3b2414; color: #fdba74; }
:root[data-theme="dark"] .promo-until { color: #fdba74; }

/* Arme su plan: módulos para marcar y precio calculado (Nuestros planes, EMPR y PLAN) */
.pb { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pb.compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pb-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.pb-mod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); user-select: none; }
.pb-mod input { position: absolute; opacity: 0; pointer-events: none; }
.pb-box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; }
.pb-box svg.i { width: 14px; height: 14px; color: #fff; opacity: 0; }
.pb-mod:has(input:checked), .pb-mod.base { border-color: var(--primary); background: var(--surface-2); }
.pb-mod:has(input:checked) .pb-box, .pb-mod.base .pb-box { background: var(--primary); border-color: var(--primary); }
.pb-mod:has(input:checked) .pb-box svg.i, .pb-mod.base .pb-box svg.i { opacity: 1; }
.pb-mod:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pb-mod.base { cursor: default; }
.pb-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pb-txt small { color: var(--muted); font-size: 12px; }
.pb-sum { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; transition: opacity .15s; }
.pb-sum.loading { opacity: .55; }
.pb-name { font-weight: 700; }
.pb-match { display: flex; gap: 8px; align-items: flex-start; }
.pb-match svg.i { width: 18px; height: 18px; color: var(--accent, var(--primary)); flex: none; margin-top: 1px; }
.pb-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.pb-lines li { display: flex; justify-content: space-between; gap: 10px; }
.pb-lines b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pb-lines .pb-disc { color: var(--ok); }
.pb-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.pb-total b { font-size: 22px; color: var(--primary-600); font-variant-numeric: tabular-nums; }
.pb-total .fee-old { font-size: 14px; }
.pb-same { margin: 0; display: flex; align-items: center; gap: 6px; }
.pb-apply { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13.5px; }
.pb-apply input { margin-top: 3px; }
.pb-try { margin: 6px 0 14px; }
.pb-try summary { cursor: pointer; font-weight: 600; color: var(--primary-600); }
.money-in.pct span { left: auto; right: 12px; }
.money-in.pct input { padding-left: 12px; padding-right: 30px; }
@media (max-width: 760px) { .pb, .pb.compact { grid-template-columns: 1fr; } .pb-mods { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .pb-mods { grid-template-columns: 1fr; } }

/* ---------- Presupuesto público ---------- */
.pp-ok { background: var(--ok-bg, #e7f6ee); color: var(--ok, #1d7a46); }
.pp-bad { background: var(--bad-bg, #fde8e8); color: var(--bad, #b42318); }
.pp-warn { background: var(--warn-bg, #fff4e0); color: var(--warn, #b45309); }
.pp-val { font-size: 19px; }
.pp-bar { height: 8px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.pp-bar span { display: block; height: 100%; background: var(--primary); }
.pp-grp { margin-bottom: 12px; font-size: 14px; }
.pp-grp small { color: var(--muted); font-size: 12px; }
.pp-meta { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 14px 0; }
.pp-meta > div { display: grid; gap: 2px; min-width: 120px; }
.pp-meta span { font-size: 12px; color: var(--muted); }
.pp-meta small { font-size: 12px; color: var(--muted); }
.pp-lines td, .pp-lines th { vertical-align: middle; }
.pp-lines .pp-rub { width: 100%; min-width: 260px; }
.pp-amt { width: 140px; text-align: right; }
.pp-rets { display: grid; gap: 6px; }
.pp-rets .check-row { display: flex; align-items: center; gap: 8px; }
.pp-rets .check-row span { flex: 1; }
.pp-net { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }
.pp-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; }
tr.bold td { font-weight: 700; }
.pp-cols { margin: 0 0 10px 18px; line-height: 1.6; font-size: 14px; }
.pp-inf { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.pp-inf-list { display: grid; gap: 4px; padding: 10px; }
.pp-inf-btn { display: flex; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.pp-inf-btn:hover { background: var(--surface-2); }
.pp-inf-btn.on { background: var(--primary); color: #fff; }
@media (max-width: 760px) { .pp-inf { grid-template-columns: 1fr; } .pp-amt { width: 110px; } .pp-lines .pp-rub { min-width: 180px; } }

/* Presupuesto: tablero y validador */
.pp-al { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.pp-al:first-of-type { border-top: 0; }
.pp-al > div:nth-child(2) { flex: 1; min-width: 0; }
.pp-al .chip { flex: none; margin-top: 1px; }
.pp-al-act { display: flex; gap: 6px; flex: none; }
.pp-al-list { margin: 6px 0 0; padding-left: 18px; }
.pp-al-list li { margin: 2px 0; }
.pp-chart { width: 100%; height: auto; display: block; margin: 4px 0 8px; }
.pp-chart .pp-ax { font-size: 11px; fill: var(--muted); }
.pp-chart .pp-grid { stroke: var(--border); stroke-dasharray: 3 3; }
.pp-chart .pp-base { stroke: var(--muted); stroke-opacity: .5; }
.pp-chart rect:hover { fill: rgba(29, 132, 200, .06); }
.pp-leg { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.pp-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pp-bar-mark { position: relative; overflow: visible; }
.pp-bar-mark span { border-radius: 6px; }
.pp-bar-mark i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); border-radius: 1px; }
.pp-vl { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.pp-ck { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.pp-ck svg { width: 14px; height: 14px; }
.pp-ck.ok { background: var(--ok-bg); color: var(--ok); }
.pp-ck.warn { background: var(--warn-bg); color: var(--warn); }
.pp-ck.bad { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 640px) { .pp-al { flex-wrap: wrap; } .pp-al-act { width: 100%; justify-content: flex-end; } }

/* Tipo de empresa (Propietario) */
.sector-box { margin-bottom: 14px; }
.sector-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.sector-opt { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; }
.sector-opt.on { border-color: var(--primary); background: var(--primary-50); }
.sector-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sector-opt .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sector-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Terceros del presupuesto */
.pp-sub { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pp-flags { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; }
.req-mark { color: var(--bad, #b42318); }

/* Enlaces legales bajo el formulario de ingreso y aviso de cookies */
.login-legal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.login-legal a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.login-legal a:hover { color: var(--primary, #1f80c8); text-decoration: underline; }
.login-legal svg { width: 13px; height: 13px; }
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: 13.5px; }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar .btn { white-space: nowrap; }

/* Comercial de servicios públicos */
.com-kpi { text-decoration: none; color: inherit; }
.com-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.com-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.com-step:hover { background: var(--surface-2); }
.com-step > b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-bg); color: var(--muted); font-size: 13px; }
.com-step > b svg { width: 15px; height: 15px; }
.com-step.ok > b { background: var(--ok-bg); color: var(--ok); }
.com-step small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.com-serv { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.com-serv-opt { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.com-serv-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.af-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.af-prog { flex: 1 1 240px; max-width: 420px; }
.af-filters { margin-top: 12px; }
.af-card { margin-top: 10px; padding: 14px; border-left: 4px solid var(--border); }
.af-card.done { border-left-color: var(--ok, #1d7a46); }
.af-top { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.af-debt { margin-top: 8px; padding: 8px 10px; font-size: 13.5px; }
.af-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.af-ant { display: grid; gap: 1px; min-width: 70px; }
.af-ant span { font-size: 11.5px; color: var(--muted); }
.af-in { width: 130px; font-size: 18px; font-weight: 700; }
.af-row select { width: auto; max-width: 220px; }
.af-res { margin-top: 6px; font-size: 13.5px; }
@media (max-width: 900px) { .com-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .com-steps { grid-template-columns: 1fr; }
  .af-row { display: grid; grid-template-columns: 1fr 1fr; }
  .af-in { width: 100%; grid-column: 1 / -1; font-size: 22px; padding: 12px; }
  .af-row select { max-width: none; width: 100%; }
  .af-row .btn { grid-column: 2; justify-content: center; }
}
.result-list:empty { display: none; }

/* Comercial: valores sin partir */
#view td.num { white-space: nowrap; }

/* Comercial: cierre del mes */
.com-mini { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.com-mini b { font-size: 18px; font-variant-numeric: tabular-nums; }
.com-sug { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 4px 0; min-width: 260px; }
.com-sug + .com-sug { border-top: 1px dashed var(--border); }
