/* Merchant dashboard: desktop-first, sidebar becomes a scrollable bottom menu under 800px. */
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: 76px; }
  .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; } }

/* ---- Cerca de mí (components/nearby.js + shared/location.js) ---- */
.loc { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; display: grid; gap: 10px; }
.loc-state { display: flex; gap: 10px; align-items: flex-start; }
.loc-ico { font-size: 22px; line-height: 1.2; }
.loc-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.loc-sub { color: var(--ink-2); font-size: 14px; }
.loc-live { background: #e3f4e8; color: var(--ok); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.loc.granted { border-left: 4px solid var(--ok); } .loc.denied, .loc.unavailable { border-left: 4px solid var(--accent); }
.loc-note { margin: 0; color: var(--ink-2); font-size: 14px; }
.loc-btn { width: 100%; min-height: 48px; }
.btn.ghost { background: var(--paper); }
.from { margin: 0 0 12px; }
.radarcard { padding: 12px; } .radar { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.radar .ring { fill: none; stroke: var(--line); stroke-width: 1.2; } .radar .axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.radar .ringlbl { font-size: 10px; fill: var(--ink-2); } .radar .north { font-size: 11px; font-weight: 700; fill: var(--ink-2); }
.radar .shopdot circle { fill: var(--brand); stroke: #fff; stroke-width: 2; } .radar .shopdot text { fill: #fff; font-size: 11px; font-weight: 700; }
.radar .shopdot.first circle { fill: var(--accent); } .radar .shopdot.first text { fill: var(--ink); }
.radar .you { fill: var(--ink); } .radar .youhalo { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: .35; }
.radarnote { margin: 6px 4px 0; font-size: 13px; text-align: center; }
.sect { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 20px 0 10px; }
.shops { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.shop { display: flex; gap: 12px; margin: 0; align-items: flex-start; } .shop.dim { opacity: .75; }
.shop-rank { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.shops li:first-child .shop-rank { background: var(--accent); color: var(--ink); }
.shop-body { min-width: 0; flex: 1; } .shop-body p { margin: 4px 0 0; }
.shop-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; } .shop-head h3 { margin: 0; overflow-wrap: anywhere; }
.dist { font-size: 18px; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-kind { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.cap { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; } .cap i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.cap.medium i { background: var(--accent); } .cap.low i { background: var(--warn); } .cap.paused i { background: var(--ink-2); }

/* ---- Polanco Athletic Dept. demo (2026-10-06): demo tag, product + order photos, chips, switch, cross-border card, mobile cards ---- */
.demotag { display: inline-block; align-self: flex-start; margin: 0 10px 10px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #fff7e0; color: var(--warn); border: 1px solid #f2dca0; }
.thumb { object-fit: cover; } .thumb.big { width: 96px; height: 96px; }
.pcell { display: flex; gap: 10px; align-items: center; } .pcell .ophoto { flex: none; } .pcell .thumb { width: 48px; height: 48px; }
tr.soon { opacity: .8; } tr.soon td:first-child { border-left: 3px dashed var(--accent); }
.skus { word-break: break-all; margin-top: 4px; }
.chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chipb { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; color: var(--ink); }
.chipb.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.xbgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.xbcell { background: var(--bg); border-radius: 10px; padding: 12px; display: grid; gap: 4px; align-content: start; }
.xbcell small { color: var(--ink-2); font-size: 13px; } .xbcell b { font-size: 20px; }
label.switch { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; cursor: pointer; margin: 6px 0 12px; }
label.switch input { position: absolute; opacity: 0; width: 48px; height: 28px; margin: 0; cursor: pointer; }
label.switch .sw { flex: none; width: 48px; height: 28px; border-radius: 99px; background: #c8ccd1; position: relative; transition: background .15s; }
label.switch .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
label.switch input:checked + .sw { background: var(--brand); } label.switch input:checked + .sw::after { transform: translateX(20px); }
label.switch input:focus-visible + .sw { outline: 3px solid var(--accent); outline-offset: 2px; }
.scene { margin: 0; display: grid; gap: 6px; justify-items: start; }
.note a { font-weight: 600; }

@media (max-width: 800px) {
  .demotag { margin: 0; align-self: center; }
  .topbar { justify-content: space-between; align-items: center; gap: 8px; }
  .main { overflow-x: hidden; }
  /* every control reachable with a thumb */
  button, .btn, .btn.sm, input[type=text], input[type=email], input[type=file], select, .chipb { min-height: 44px; }
  .checks label { min-height: 44px; } input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .nav a { min-height: 56px; justify-content: center; } .nav { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .nav a { scroll-snap-align: center; }
  .row.between { gap: 8px; }
  .filters { display: grid; grid-template-columns: 1fr; } .filters label.f { width: 100%; } .filters select { width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0 12px; } .facts dt { margin-top: 8px; font-size: 13px; }
  .steps li { flex-wrap: wrap; } .steps .t { margin-left: 38px; width: 100%; }
  /* tables become cards: each row = one card, each cell = "label: value" */
  .card.tablewrap, .tablewrap.stack-m { overflow: visible; background: transparent; box-shadow: none; padding: 0; }
  .tablewrap > table.cards { border-spacing: 0; }
  table.cards, table.cards tbody, table.cards tr, table.cards td, table.cards caption { display: block; width: 100%; }
  table.cards thead { position: absolute; left: -9999px; }
  table.cards tr { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin: 0 0 12px; }
  table.cards td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  table.cards td::before { content: attr(data-label); font-weight: 600; font-size: 13px; color: var(--ink-2); text-align: left; flex: none; }
  table.cards td:not([data-label])::before { content: none; }
  table.cards td.ptitle { display: block; text-align: left; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  table.cards td.pthumb { float: left; width: auto; padding: 0 12px 0 0; border: 0; } table.cards td.pthumb .thumb { width: 72px; height: 72px; }
  table.cards tr.prow::after { content: ''; display: block; clear: both; }
  table.cards td.pcell { justify-content: flex-start; text-align: left; } table.cards td.pcell::before { display: none; }
  table.cards td.pact { justify-content: stretch; } table.cards td.pact .btn { width: 100%; }
  table.cards td.num { font-variant-numeric: tabular-nums; }
  table.cards select { max-width: 60%; }
  table.cards caption { text-align: left; }
  .xbgrid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .tile { padding: 12px; } .tile small { font-size: 12px; }
  .toast { bottom: 96px; }
  .row.wrap-m > * { flex: 1 1 100%; }
}
@media (max-width: 800px) { .side .demotag { display: none; } }
td.num { white-space: nowrap; }

.buyer { display: grid; gap: 2px; justify-items: start; }
@media (max-width: 800px) { td.num { white-space: normal; } table.cards td .buyer { justify-items: end; text-align: right; } table.cards td .pr { text-align: right; } table.cards td .pr .meta { display: block; } }
