/* Operations console: desktop-first, sidebar becomes a scrollable bottom menu under 800px; tables become stacked cards (table.stack + data-label). */
button { min-height: 40px; padding: 0 14px; }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--paper); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; }
.logo { font-weight: 800; font-size: 20px; color: var(--brand); padding: 4px 10px 2px; }
.who { font-size: 13px; color: var(--ink-2); padding: 0 10px 12px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: #e6f2ee; color: var(--brand); font-weight: 700; }
.nav .ico { font-size: 18px; width: 22px; text-align: center; }
.nav i { font-style: normal; margin-left: auto; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.main { padding: 24px 32px 48px; max-width: 1100px; width: 100%; }
h1 { font-size: 26px; margin: 0 0 4px; } h3 { margin: 0 0 8px; font-size: 16px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; font-weight: 600; text-decoration: none; background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; min-height: 40px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: #f0c9c5; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tile small { display: block; color: var(--ink-2); font-size: 13px; }
.tile b { font-size: 28px; display: block; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile.bad b { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.meta { color: var(--ink-2); font-size: 14px; }
.note { background: #fff7e0; border: 1px solid #f2dca0; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 14px; }
.note.info { background: #e8f1fb; border-color: #bcd4ee; }
.note.bad { background: #fde8e6; border-color: #f0c9c5; color: var(--bad); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eceef0; color: var(--ink-2); }
.pill.ok { background: #e3f4e8; color: var(--ok); } .pill.warn { background: #fff1d6; color: var(--warn); }
.pill.bad { background: #fde8e6; color: var(--bad); } .pill.info { background: #e1ecf8; color: #1d5a9c; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.link { cursor: pointer; } tr.link:hover { background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

label.f { display: grid; gap: 4px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=file], select { min-height: 40px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; background: #fff; max-width: 100%; }
input[type=file] { padding: 6px 10px; }
.hint { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.err { color: var(--bad); font-size: 13px; font-weight: 600; }
fieldset { border: 1.5px solid var(--line); border-radius: 10px; margin: 0 0 14px; padding: 10px 14px; }
legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.filters label.f { margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: center; }
.dot { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.done .dot { background: var(--brand); color: #fff; } .now .dot { background: var(--accent); color: var(--ink); }
.steps .t { color: var(--ink-2); font-size: 13px; margin-left: auto; }
.thumb { width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist a { color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.checklist a:hover { background: var(--bg); }
.checklist .done a { color: var(--ink-2); text-decoration: line-through; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; } .facts dt { color: var(--ink-2); } .facts dd { margin: 0; font-weight: 600; }
.up { max-width: 220px; max-height: 160px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; }
.vlist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.state { text-align: center; padding: 40px 16px; color: var(--ink-2); } .state .big { font-size: 44px; }
.spinner { width: 32px; height: 32px; margin: 0 auto 10px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 16px; border-radius: var(--radius); color: #fff; font-weight: 600; box-shadow: var(--shadow); z-index: 50; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--bad); }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (max-width: 800px) {
  .app { display: block; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .side { position: fixed; z-index: 20; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--line); }
  .logo, .who { display: none; }
  .nav { display: flex; overflow-x: auto; width: 100%; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; min-width: 76px; padding: 8px 6px; font-size: 12px; border-radius: 0; text-align: center; position: relative; }
  .nav a.on { box-shadow: inset 0 3px 0 var(--brand); }
  .nav i { position: absolute; top: 4px; right: 12px; margin: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: 12px 16px; font-weight: 800; }
  .main { padding: 16px 16px 32px; }
  h1 { font-size: 22px; }
  .toast { left: 16px; right: 16px; bottom: 88px; max-width: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 22px; }
  .stack-m td, .stack-m th { padding: 8px 6px; }
}
@media (min-width: 801px) { .topbar { display: none; } }

/* ---- admin additions ---- */
.main { max-width: 1280px; }
.tile.sev-ok b { color: var(--ok); } .tile.sev-warn { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); } .tile.sev-warn b { color: var(--warn); }
.tile.sev-bad { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); } .tile.sev-bad b { color: var(--bad); }
a.tile { display: block; color: inherit; text-decoration: none; } a.tile:hover { background: #fbfbfc; }
.tile .go { font-size: 12px; color: var(--brand); font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 4px 10px; min-width: 340px; }
.bar { font-size: 11px; color: var(--ink-2); } .bar i { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.bar i b { display: block; height: 100%; background: var(--brand); }
.bar.low i b { background: var(--warn); }
.rank { font-weight: 800; font-size: 18px; color: var(--brand); }
code.rc { background: #fde8e6; color: var(--bad); padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.audit li { border-left: 3px solid var(--brand); padding: 4px 10px; background: var(--bg); border-radius: 0 8px 8px 0; }
.audit .why { color: var(--ink); } .audit .m { color: var(--ink-2); font-size: 12px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--paper); border-radius: 16px; padding: 22px; width: 100%; max-width: 460px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 12px; font-size: 20px; }
textarea { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; min-height: 80px; width: 100%; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.weight { display: grid; grid-template-columns: 150px 1fr 64px; gap: 12px; align-items: center; margin-bottom: 10px; }
.weight input[type=range] { width: 100%; accent-color: var(--brand); min-height: 32px; }
.sum { font-size: 22px; font-weight: 800; } .sum.bad { color: var(--bad); } .sum.ok { color: var(--ok); }
.meter { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; min-width: 120px; } .meter b { display: block; height: 100%; background: var(--brand); } .meter.bad b { background: var(--bad); }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.sample { display: inline-block; background: #e8f1fb; color: #1d5a9c; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
@media (max-width: 800px) { .weight { grid-template-columns: 1fr 56px; } .weight label { grid-column: 1 / -1; } }

/* ---- Pendientes de verificación (components/partners.js) ---- */
.pending { margin-bottom: 28px; } .pending h2 { font-size: 20px; margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
.pendgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 12px; align-items: start; }
.card.pend { margin: 0; } .card.pend h3 { font-size: 17px; margin: 0; }
.pfacts { margin: 12px 0 14px; } .pfacts dt { font-size: 13px; } .pfacts dd { font-weight: 500; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; } .commit { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
@media (max-width: 800px) { .pendgrid { grid-template-columns: 1fr; } }
.card.pend .row.between > div:first-child { min-width: 0; flex: 1; } .card.pend .pill { flex: none; }

/* ---- staff login + account strip + Piloto en vivo (components/login.js, live.js) ---- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; width: 100%; max-width: 420px; }
.gate-card .logo { padding: 0 0 8px; } .gate-card h1 { font-size: 22px; } .gate-card input[type=email] { width: 100%; }
.acct { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px; flex-wrap: wrap; } .acct .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; font-size: 13px; }
.topbar { align-items: center; justify-content: space-between; gap: 8px; } .topbar .acct { padding: 0; flex-wrap: nowrap; } .topbar .acct .meta { color: #fff; opacity: .85; max-width: 120px; }
.topbar .btn.sm { min-height: 32px; font-size: 13px; padding: 0 10px; } .topbar .sample { background: #fff; }
@media (max-width: 800px) { .side .acct { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; min-height: 36px; }
.chip.bad { background: #fde8e6; border-color: #f0c9c5; color: var(--bad); } .chip:hover { background: #fff; }
.live-total { font-size: 15px; margin: 0 0 10px; } .live-total b { font-size: 28px; font-variant-numeric: tabular-nums; }
.live-stamp { margin: 0 0 12px; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; } .live-list .why { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.live-table td, .live-table th { white-space: nowrap; }
.tile.sev-bad small:first-child, .tile.sev-warn small:first-child { color: var(--ink); }
.tile small { overflow-wrap: anywhere; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } .modal { max-height: 92vh; overflow-y: auto; } }
.live .card, .live .tile, .live .chip, .gate-card { border-radius: 8px; }
.live .btn, .live .pill { border-radius: 8px; }

/* ---- demo story additions: product card, art tile, cross-border pill, status chip ---- */
.pill.xb { white-space: normal; margin: 4px 0 0; display: table; }
.pill.flag { display: table; margin-top: 4px; }
.filters label.grow { flex: 1 1 280px; } .filters label.grow input { width: 100%; }
.row.actions { margin-bottom: 16px; }
.prodrow { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.prodrow .photo img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #eef1ee; display: block; }
.phfb { aspect-ratio: 1 / 1; border-radius: 12px; background: #eef1ee; color: var(--ink-2); display: grid; place-items: center; text-align: center; padding: 12px; font-size: 14px; border: 1px dashed var(--line); }
.pinfo .facts { margin: 10px 0 0; }
.arttile { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; text-decoration: none; min-height: 64px; max-width: 420px; }
.arttile img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.arttile span { display: grid; gap: 2px; font-weight: 700; font-size: 14px; min-width: 0; } .arttile small { font-weight: 400; font-size: 12px; opacity: .8; overflow-wrap: anywhere; }
.arttile.dark { background: #15171a; color: #fff; }
.arttile.light { background: repeating-conic-gradient(#f1f2f3 0 25%, #fff 0 50%) 0 0 / 16px 16px; color: var(--ink); border: 1px solid var(--line); }
.cover .tiles { margin-bottom: 10px; }
.aid { font-size: 11px; color: var(--ink-2); background: var(--bg); padding: 0 4px; border-radius: 4px; }
.idv { overflow-wrap: anywhere; }
.facts dd { overflow-wrap: anywhere; }
table.plain td { border-bottom: 1px solid var(--line); }
.main { overflow-wrap: break-word; }
td.mtr { min-width: 160px; }

@media (max-width: 800px) {
  button, .btn, .btn.sm, .topbar .btn.sm { min-height: 44px; }
  .btn.sm { padding: 0 14px; font-size: 15px; }
  input[type=text], input[type=email], input[type=file], select { min-height: 44px; font-size: 16px; width: 100%; }
  textarea { font-size: 16px; }
  .weight input[type=range] { min-height: 44px; }
  .checks label, label.checks { min-height: 44px; }
  label.checks { display: flex; align-items: center; gap: 10px; }
  input[type=checkbox] { width: 22px; height: 22px; flex: none; }
  .chip { min-height: 44px; }
  .live-list a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav a { min-height: 56px; justify-content: center; }
  .nav { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .side { box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
  .main > p:first-child > a, .main > p > a[href^="#/"]:only-child { display: inline-flex; align-items: center; min-height: 44px; }
  .filters { align-items: stretch; } .filters label.f { flex: 1 1 100%; }
  .filters .btn { flex: 1 1 100%; }
  .row.between { gap: 10px; }
  .row.actions .btn { flex: 1 1 calc(50% - 10px); }
  .row .btn { flex: 1 1 auto; }
  .card { padding: 14px; } .card.tablewrap { padding: 8px 12px; }
  .main { padding-left: 16px; padding-right: 16px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; } .tile small { font-size: 12px; }
  .prodrow { grid-template-columns: 1fr; } .prodrow .photo { max-width: 360px; width: 100%; }
  .arttile { max-width: none; }
  .facts { grid-template-columns: 1fr; gap: 0; } .facts dt { font-size: 12px; margin-top: 8px; text-transform: uppercase; letter-spacing: .03em; } .facts dd { margin-bottom: 2px; }
  .bars { min-width: 0; grid-template-columns: repeat(2, 1fr); }
  .live-table td, .live-table th { white-space: normal; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92dvh; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal .row .btn { flex: 1 1 100%; }
  .tablewrap { overflow-x: visible; }
  .tablewrap.keep { overflow-x: auto; }
  .gate { align-items: start; }

  /* tables -> stacked cards. Every cell carries data-label (the column header). td.full = label above the content; td.act = buttons, no label. */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 0 0 12px; background: var(--paper); }
  table.stack tr.link:active { background: var(--bg); }
  table.stack td { position: relative; padding: 8px 0 8px 40%; min-height: 40px; border-bottom: 1px dashed var(--line); text-align: left; overflow-wrap: anywhere; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); position: absolute; left: 0; top: 10px; width: 36%; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
  table.stack td.num, table.stack th.num { text-align: left; }
  table.stack td.full { padding-left: 0; padding-top: 28px; } table.stack td.full::before { width: auto; top: 8px; }
  table.stack td.act { padding-left: 0; } table.stack td.act::before { content: none; } table.stack td.act:empty { display: none; }
  table.stack td a { display: inline-flex; align-items: center; min-height: 44px; }
  table.stack td .meta a, table.stack td .meta { overflow-wrap: anywhere; }
  table.stack td .row { flex-wrap: wrap; }
  table.stack td .btn { width: 100%; }
  table.stack td.mtr { min-width: 0; }
  .card.tablewrap, .card > table.stack { box-shadow: none; background: transparent; }
  .card.tablewrap { padding: 0; margin-bottom: 8px; }
}
