:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7385;
  --line: #e3e6ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --good: #15803d;
  --good-bg: #e7f6ec;
  --bad: #b91c1c;
  --warn-bg: #fff7e0;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
.ok { color: var(--good); margin-left: 8px; }
h1, h2 { margin: 0 0 12px; }
h2 { font-size: 1.15rem; }
code { background: #eef0f4; padding: 1px 5px; border-radius: 4px; }

/* botones / inputs */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.btn:hover { background: #f0f2f6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: default; }
input, select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfd3fb; border-color: var(--primary); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }

/* layout */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  background: #1d2330; color: #fff; position: sticky; top: 0; z-index: 5;
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #c9cfdb; text-decoration: none; padding: 7px 12px; border-radius: 8px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.banner { background: var(--warn-bg); padding: 8px 24px; font-size: 14px; border-bottom: 1px solid #f0e2b0; }
.view { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 760px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }

/* productos */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; min-width: 150px; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; }
.filters #q { flex: 1 1 280px; font-size: 15px; }
.table-card { padding: 0; overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #fafbff; }
.c-img { width: 72px; }
.c-pres { width: 170px; }
.c-price { width: 170px; text-align: right !important; }
.c-act { width: 130px; text-align: right; }
.thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #eef1f6; display: grid;
  place-items: center; font-weight: 700; color: #8a93a6; font-size: 15px; border: 1px solid var(--line);
}
.pname { font-weight: 600; }
.pbrand { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: #eef1f6; color: #4b5468; margin-left: 4px; vertical-align: middle; }
.badge.multi { background: #e8effd; color: var(--primary-dark); }
.badge.off { background: #fde8e8; color: var(--bad); }
.price { font-weight: 700; font-size: 1.1rem; text-align: right; white-space: nowrap; }
.price small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; }

/* importar */
.import-form { display: flex; flex-direction: column; gap: 12px; }
.drop {
  border: 2px dashed #c4ccda; border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 15px; background: #fafbfc;
}
.drop.over { border-color: var(--primary); background: #f0f5ff; }
.drop input { display: none; }
.import-form .row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.result { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--good-bg); }
.result.err { background: #fde8e8; color: var(--bad); }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.simple th, .simple td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.simple th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }

/* settings */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.example { background: #f6f8fb; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
pre { background: #1d2330; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.5; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20, 25, 35, .55); display: grid; place-items: start center;
  overflow-y: auto; padding: 32px 12px; z-index: 20; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 980px; padding: 24px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.detail { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.detail .img-box { display: flex; flex-direction: column; gap: 8px; }
.detail .big-img { width: 240px; height: 240px; border-radius: 12px; object-fit: contain; background: #f3f5f9;
  border: 1px solid var(--line); display: grid; place-items: center; color: #9aa3b5; font-size: 40px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.pricebox { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.pricebox > div { flex: 1 1 150px; background: #f6f8fb; border-radius: 10px; padding: 10px 14px; }
.pricebox b { display: block; font-size: 1.25rem; }
.pricebox .pub { background: #e8effd; }
.pricebox span { color: var(--muted); font-size: 13px; }
.offers td.best { color: var(--good); font-weight: 700; }
.offers tr.inactive td { color: #a0a7b5; text-decoration: line-through; }
.tag-best { background: var(--good-bg); color: var(--good); padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.merge-results { margin-top: 8px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.merge-results div { padding: 7px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.merge-results div:last-child { border-bottom: 0; }
.section-title { margin: 22px 0 8px; font-size: 1rem; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff;
  padding: 10px 18px; border-radius: 8px; z-index: 30; }

/* pestañas de proveedores */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 8px 14px; cursor: pointer;
  border-radius: 8px 8px 0 0; font: inherit; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tab.active { background: #fff; border-color: var(--line); color: var(--text); font-weight: 600; margin-bottom: -1px; }
.tab.tab-off { text-decoration: line-through; }
.tab-panel { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 14px; }
.offer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tier-cards { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.tier-cards > div { flex: 1 1 120px; background: #f6f8fb; border-radius: 10px; padding: 10px 14px; }
.tier-cards > div.sug { background: #fff7e0; }
.tier-cards span { color: var(--muted); font-size: 13px; }
.tier-cards b { display: block; font-size: 1.2rem; }
.sub-title { margin: 14px 0 6px; font-size: .95rem; }
.chart { width: 100%; max-width: 560px; height: auto; display: block; margin-bottom: 8px; }
.chart .axis { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart .dot { fill: var(--primary); }
.chart .lbl { fill: var(--muted); font-size: 11px; }
.up { color: var(--bad); font-weight: 600; }
.down { color: var(--good); font-weight: 600; }
/* duplicados */
.nav-badge { background: #f59e0b; color: #1d2330; border-radius: 99px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-left: 4px; }
.dup { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.dup-new { border-right: 1px solid var(--line); padding-right: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dup-cands { display: flex; flex-direction: column; gap: 8px; }
.cand-row { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.dup-actions { display: flex; gap: 8px; }
.btn.ghost-dark { background: transparent; }
.suggest-box { background: #fff7e0; border: 1px solid #f0e2b0; border-radius: 10px; padding: 12px 14px; margin-top: 16px; }
.suggest-box .cand-row { background: #fff; }
.suggest-box > .btn { margin-top: 8px; }
.result.pending { background: #eef3fd; }
.warn-line { margin-top: 6px; font-weight: 600; }
.ai-status { font-size: 14px; background: #f6f8fb; padding: 8px 12px; border-radius: 8px; }

@media (max-width: 760px) {
  .dup { grid-template-columns: 1fr; }
  .dup-new { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
  .offer-head { flex-direction: column; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; justify-content: space-between; }
  .topbar nav { order: 3; flex: 1 1 100%; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; }
  .view { padding: 14px 16px 60px; }
  .stat { min-width: 0; flex: 1 1 40%; }
  .filters select { flex: 1 1 45%; }
  /* la grilla pasa a tarjetas */
  .grid thead { display: none; }
  .grid tbody tr { display: grid; grid-template-columns: 64px 1fr auto; column-gap: 12px; row-gap: 2px;
    grid-template-areas: "img name name" "img pres price" "img act act"; padding: 10px 12px;
    border-bottom: 1px solid var(--line); }
  .grid td { padding: 0; border: 0; }
  .grid td:nth-child(1) { grid-area: img; }
  .grid td:nth-child(2) { grid-area: name; }
  .grid td:nth-child(3) { grid-area: pres; color: var(--muted); font-size: 13px; align-self: center; }
  .grid td:nth-child(4) { grid-area: price; }
  .grid td:nth-child(5) { grid-area: act; text-align: left; margin-top: 6px; }
  .detail { grid-template-columns: 1fr; }
  .detail .big-img { width: 100%; height: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .offers-wrap { overflow-x: auto; }
}

/* ---------- ventana emergente chica ---------- */
.popup-box { max-width: 620px; }
.popup-wizard { max-width: 720px; }
.btn.big { padding: 11px 20px; font-size: 15px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- stock ---------- */
.scan-card { max-width: 760px; }
.scan-form { display: flex; gap: 10px; }
.scan-form input { flex: 1; font-size: 1.4rem; padding: 12px 14px; letter-spacing: .04em; }
.stock-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 12px; }
.thumb.big { width: 84px; height: 84px; font-size: 22px; }
.stock-now { background: #f6f8fb; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.stock-now b { font-size: 1.5rem; margin: 0 4px; }
.stock-form { display: flex; flex-direction: column; gap: 10px; }
.stock-form #stock-qty { font-size: 1.4rem; width: 140px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.seg-btn { border: 0; background: #fff; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-btn.active[data-mode="1"] { background: var(--good-bg); color: var(--good); }
.seg-btn.active[data-mode="-1"] { background: #fde8e8; color: var(--bad); }
.stock-preview { font-size: 14px; }
.pick-list { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.nf-new { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stock-mini { font-size: 12px; color: var(--good); margin-top: 2px; }
.stock-mini.zero { color: var(--muted); }
.sm-filters { padding: 0 0 12px; }
.sm-filters #sm-q { flex: 1 1 260px; }
.table-wrap { overflow-x: auto; }
.stockbox { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* ---------- etiquetas de tiendas ---------- */
.ch-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-left: 4px;
  vertical-align: middle; background: var(--c); color: #1d2330; border: 1px solid rgba(0,0,0,.12); }
.ch-badge.paused { opacity: .5; }
.ch-badge.err { background: #fff; color: var(--bad); border: 1px dashed var(--bad); }
.ch-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ch-card { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; }
.ch-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-title a { margin-left: auto; font-size: 13px; }
.ch-price b { font-size: 1.1rem; }
.ch-error { background: #fde8e8; color: var(--bad); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ch-actions { display: flex; justify-content: flex-end; }

/* ---------- integraciones ---------- */
.int-tabs { margin-top: 4px; }
.int-tabs .tab { text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
#int-panel { background: #fff; margin-bottom: 16px; }
.int-empty { text-align: center; padding: 30px 10px; max-width: 560px; margin: 0 auto; }
.ch-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--c); display: grid; place-items: center;
  font-weight: 800; color: #1d2330; margin: 0 auto 10px; border: 1px solid rgba(0,0,0,.1); }
.int-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.int-head .ch-logo { margin: 0; }
.int-stats { margin: 14px 0 0; }
.stat-err b { color: var(--bad); }
.int-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.int-actions a.btn { text-decoration: none; }
.narrow-form { max-width: 640px; }
.narrow-form input[type=color] { padding: 2px; height: 38px; width: 80px; }

/* ---------- wizard ---------- */
.wz-head { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.wz-progress { display: flex; gap: 6px; margin: 10px 0 4px; }
.wz-progress span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  font-weight: 700; background: #eef1f6; color: var(--muted); }
.wz-progress span.now { background: var(--primary); color: #fff; }
.wz-progress span.done { background: var(--good-bg); color: var(--good); }
.wz-nav { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.steps-list { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.copy-field { display: flex; gap: 6px; margin-top: 6px; }
.copy-field input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #f6f8fb; }

@media (max-width: 760px) {
  .scan-form { flex-direction: column; }
  .int-head .btn { width: 100%; }
}

/* usuarios y roles */
.user-box { display: flex; gap: 6px; align-items: center; }
#me-btn { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #f6f8fb; color: var(--muted); }
.usr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.table-scroll { overflow-x: auto; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
.perm-chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef1f6;
  color: #4b5468; margin: 2px 4px 2px 0; }
.perm-chip.all { background: var(--good-bg); color: var(--good); font-weight: 600; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-item { flex-direction: row !important; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; color: var(--text) !important; }
.perm-item:has(input:checked) { border-color: var(--primary); background: #f0f5ff; }
.perm-item input { margin-top: 3px; }
.perm-item span { display: flex; flex-direction: column; gap: 2px; }
.perm-item small { font-size: 12px; line-height: 1.3; }
@media (max-width: 640px) { .perm-list { grid-template-columns: 1fr; } }
.small-link { font-size: 13px; color: var(--primary); text-decoration: none; text-align: center; }
.small-link:hover { text-decoration: underline; }
.form-error { color: var(--bad); background: #fde8e8; border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 14px; }
.pw-mode { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pw-mode label.check { align-items: flex-start; }
.pw-mode .hint { font-size: 12px; color: var(--muted); margin: -4px 0 0 24px; }
.pw-row { display: flex; gap: 6px; }
.pw-row input { flex: 1; font-family: ui-monospace, monospace; }
.field-hint { font-size: 12px; color: var(--muted); }
#forgot-form .no-mail-only { display: none; margin: 0; }
#forgot-form.no-mail .no-mail-only { display: block; }
#forgot-form.no-mail .mail-only { display: none; }

/* pedidos */
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f8fb; }
.ord-head { padding-bottom: 14px; }
.ord-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ord-title h2 { margin: 0; }
.ord-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ord-card { border: 1px solid var(--line); border-left: 4px solid var(--c, var(--primary)); border-radius: 10px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.ord-card.total { background: #f0f5ff; border-left-color: var(--primary); }
.ord-card b { font-size: 1.3rem; }
.ord-card span { color: var(--muted); font-size: 13px; }
.ord-card-title { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.ord-card-title .ch-dot { width: 10px; height: 10px; }
.o-sync-info { font-size: 12px; flex: 1 1 100%; }
.ord-ch { margin-left: 2px; }
table.orders td { vertical-align: top; }
.o-items div { font-size: 13px; }
.st-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap;
  background: #eef1f6; color: #4b5468; }
.st-pendiente { background: #fff4d6; color: #8a5a00; }
.st-pagado { background: #e8effd; color: var(--primary-dark); }
.st-preparando { background: #f1e8fd; color: #6b21a8; }
.st-enviado { background: #e0f2fe; color: #0369a1; }
.st-entregado { background: var(--good-bg); color: var(--good); }
.st-cancelado { background: #fde8e8; color: var(--bad); }
.o-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; padding-right: 30px; }
.o-head h2 { margin-bottom: 4px; }
.o-head-right { display: flex; gap: 8px; align-items: center; }
.o-lines tfoot td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; }
.o-total td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--line); }
.o-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.st-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.st-opt { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.st-opt.active { border-color: currentColor; box-shadow: 0 0 0 1px currentColor; font-weight: 600; }
.st-opt:not(.active) { background: #fff; color: var(--muted); }
#o-st-note { width: 100%; }
.o-events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.o-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.o-info .full { grid-column: 1 / -1; }
.o-field { font-size: 14px; }
.o-field span { display: block; color: var(--muted); font-size: 12px; }
.o-danger { margin-top: 16px; text-align: right; }
.no-search { position: relative; margin-bottom: 8px; }
.no-search input { width: 100%; }
.no-lines input { padding: 5px 7px; }
.no-lines .qty { width: 64px; text-align: right; }
.no-lines .money-in { width: 110px; text-align: right; }
.no-lines td:first-child input { width: 100%; }
.no-totals { display: flex; gap: 12px; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.no-totals input { width: 120px; }
.no-total { font-size: 15px; padding-bottom: 8px; }
.no-total b { font-size: 1.3rem; margin-left: 6px; }
@media (max-width: 760px) {
  .o-cols { grid-template-columns: 1fr; }
  /* pedidos como tarjetas: número y estado / cliente y total / fecha */
  .grid.orders tbody tr { grid-template-columns: 1fr auto; grid-template-areas: "num st" "cust total" "date date"; }
  .grid.orders td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 12px; }
  .grid.orders td:nth-child(2) { grid-area: num; }
  .grid.orders td:nth-child(3) { grid-area: cust; }
  .grid.orders td:nth-child(4) { display: none; }
  .grid.orders td:nth-child(5) { grid-area: total; }
  .grid.orders td:nth-child(6) { grid-area: st; text-align: right; }
  .no-lines .money-in { width: 80px; }
}
.nav-busy { margin-left: 2px; }
.result.pending { background: #eef3fd; color: var(--text); }
.result + .result { margin-top: 8px; }

/* tienda real / de prueba */
.env-bar { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; margin-bottom: 12px; }
.env-bar > span { align-self: center; }
.env-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; cursor: pointer;
  font: inherit; text-align: left; display: flex; flex-direction: column; gap: 1px; }
.env-btn span { font-size: 12px; color: var(--muted); }
.env-btn.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: #f0f5ff; }
.env-btn.test.active { border-color: #d97706; box-shadow: 0 0 0 1px #d97706; background: #fff7e0; }
.env-warn { background: #fff7e0; border: 1px solid #f5d48a; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 14px; }
.ch-badge.test { outline: 2px dashed #d97706; outline-offset: 1px; }
.env-prod { background: #f0f5ff; border: 1px solid #c9d8f8; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 14px; }

/* envíos */
.dims-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dims-title { font-weight: 600; font-size: 14px; color: var(--text); }
.dims-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dims-grid input { width: 100%; }
.o-ship { background: #f6f8fb; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.o-ship a { margin-left: 6px; }
.o-ship-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.o-ship-actions:empty { display: none; }
@media (max-width: 760px) { .dims-grid { grid-template-columns: 1fr 1fr; } }

.login-business { margin: -4px 0 4px; font-weight: 700; font-size: 18px; color: #0F6B4F; }
