:root { --bg: #0d0e10; --surface: #161719; --surface-2: #1d1e20; --surface-3: #252628; --border: #2a2b2d; --border-strong: #3a3b3c; --accent: #38bdf8; --accent-rgb: 56, 189, 248; --accent-soft: #16313e; --accent-hover: #50c5f9; --accent-ink: #1a0f06; }
/* ══════════════════════════════════════════════════════════════════════
   Estilos compartidos (cliente, admin, empleado y rider)
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* --bg, --surface*, --border*, --accent* y --accent-ink: salen de los colores de la marca (shared/theme.js) */
  --text: #edeef0;
  --muted: #9aa0a8;
  --faint: #878e97; /* contraste 4.5:1 sobre las tarjetas */


  --ok: #4caf6d;
  --ok-soft: #173420;
  --warn: #e0b341;
  --warn-soft: #392d0e;
  --danger: #ee6d62;
  --danger-strong: #c73d31; /* fondo sólido con texto blanco */
  --danger-soft: #3a1512;
  --info: #5b9bd5;
  --info-soft: #152a3a;
  --teal: #4fb8b0;
  --teal-soft: #13302e;

  /* Esquinas casi rectas en todo (botones, campos, tarjetas): aspecto técnico, de hardware. */
  --radius: 2px;
  --radius-lg: 2px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font); /* una sola familia: la jerarquía sale del peso y el tamaño */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
/* En el celular: sin la espera del doble toque para hacer zoom, y un toque que se nota sin el recuadro azul. */
a, button, input, select, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: rgba(var(--accent-rgb), .12); }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Montos, cantidades y códigos: cifras del mismo ancho para que se alineen. */
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.loss { color: var(--danger); }
.small { font-size: 13.5px; }
.tiny { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ─── Layout ───────────────────────────────────────────────────────── */

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 8px); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap, 12px); grid-template-columns: repeat(auto-fill, minmax(var(--min, 220px), 1fr)); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.hide-mobile { display: none !important; }
@media (min-width: 760px) {
  .hide-mobile { display: revert !important; }
  .btn.hide-mobile { display: inline-flex !important; }
  td.hide-mobile, th.hide-mobile { display: table-cell !important; }
  .only-mobile { display: none !important; }
}
.scroll-x { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Botones ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 2px solid transparent; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s, box-shadow .2s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* Segunda acción junto a la principal: solo el borde en el color de la marca. */
.btn-outline { background: transparent; border-color: var(--accent); color: var(--text); font-weight: 700; }
.btn-outline:hover { background: var(--accent-soft); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: var(--accent); }
.btn-danger { background: var(--danger-soft); border-color: rgba(226, 87, 76, .4); color: var(--danger); }
.btn-danger:hover { background: var(--danger-strong); color: #fff; }
.btn-ok { background: var(--ok-soft); border-color: rgba(76, 175, 109, .45); color: var(--ok); }
.btn-ok:hover { background: var(--ok); color: #fff; }
.btn-wa { background: #1a7d44; color: #fff; font-weight: 600; }
.btn-wa:hover { background: #25a35a; }
.btn-sm { min-height: 34px; padding: 5px 14px; font-size: 13px; border-radius: var(--radius); }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; padding: 0;
  border: none; border-radius: var(--radius); background: var(--surface-2); color: var(--muted);
  cursor: pointer; position: relative; transition: color .15s, background .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: var(--radius); }

.counter {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger-strong); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.counter.accent { background: var(--accent); color: var(--accent-ink); }

/* ─── Formularios ──────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.field .error { font-size: 12px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select option { background: var(--surface-2); color: var(--text); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + span { background: var(--ok-soft); border-color: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--ok); }

/* ─── Chips, badges, tabs ──────────────────────────────────────────── */

.chips { display: flex; gap: 8px; padding-bottom: 4px; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius); border: none;
  background: var(--surface-2); color: var(--muted); font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); font-weight: 600; }
.chip .counter { position: static; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative; padding: 12px 14px; background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .counter { position: static; }

/* ─── Tarjetas y estadísticas ──────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.card.flat { border-radius: var(--radius); }
.card-title { font-size: 15px; font-weight: 600; font-family: var(--font-display); }

.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); min-width: 0; }
.stat .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat .value.mono { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .sub { font-size: 13px; color: var(--faint); margin-top: 2px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: none; }

.empty { padding: 36px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { color: var(--faint); }

.thumb { width: 48px; height: 48px; border-radius: var(--radius); object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.thumb.lg { width: 64px; height: 64px; }
.thumb-fallback { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; }

.price-old { color: var(--faint); text-decoration: line-through; font-variant-numeric: tabular-nums; font-size: 13px; }
.price { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.price.offer { color: var(--danger); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; }

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(226, 87, 76, .35); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(76, 175, 109, .4); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(224, 179, 65, .35); }
.alert.info { background: var(--info-soft); color: var(--info); border: 1px solid rgba(91, 155, 213, .35); }

/* ─── Ventanas flotantes ───────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 6, 8, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  overflow-y: auto; overscroll-behavior: contain; animation: fade-in .18s ease;
}
.modal {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02);
  animation: pop-in .28s var(--ease);
}
.modal.wide { max-width: 680px; }
.modal.xl { max-width: 1100px; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { position: sticky; bottom: 0; padding: 14px 18px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 559px) {
  .modal-backdrop.sheet { align-items: flex-end; padding: 0; }
  .modal-backdrop.sheet .modal { max-height: 92dvh; border-radius: var(--radius) var(--radius) 0 0; animation: sheet-in .3s var(--ease); }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ─── Avisos (toasts) ──────────────────────────────────────────────── */

.toasts { position: fixed; z-index: 200; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 14px; animation: pop-in .28s var(--ease); }
.toast.ok { border-color: rgba(76, 175, 109, .55); }
.toast.ok svg { color: var(--ok); }
.toast.danger { border-color: rgba(226, 87, 76, .55); }
.toast.danger svg { color: var(--danger); }
.toast.info svg { color: var(--accent); }
.toast svg { flex-shrink: 0; margin-top: 2px; }

/* ─── Barras superiores ────────────────────────────────────────────── */

.topbar { position: sticky; top: 0; z-index: 40; background: var(--bg); }
.topbar-inner { display: flex; align-items: center; gap: 10px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.logo-mark { width: 22px; height: 22px; background: var(--accent); clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%); }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; }
.logo-img { height: 28px; width: auto; max-width: 140px; object-fit: contain; flex-shrink: 0; }
.logo-img.pequeño { height: 20px; max-width: 100px; }
.logo-img.grande { height: 40px; max-width: 180px; }
.logo-tag { font-size: 13px; color: var(--muted); }

/* ─── Fondo de circuitos ───────────────────────────────────────────── */

.circuit-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5; }
.circuit-bg canvas { width: 100%; height: 100%; display: block; }
.above-bg { position: relative; z-index: 1; }

/* ─── Portal de acceso ─────────────────────────────────────────────── */

.portal { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.portal-card { width: 100%; max-width: 400px; padding: 28px 24px; border-radius: var(--radius); background: var(--surface); }
.portal-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-align: center; }
.portal-role { display: inline-flex; margin: 0 auto; }

/* ─── Barras de progreso / pasos ───────────────────────────────────── */

.steps { display: flex; gap: 6px; }
.steps > i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps > i.done { background: var(--accent); }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-chart .bar { width: 100%; max-width: 44px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent); min-height: 3px; transition: height .5s var(--ease); }
.bar-chart .bar { opacity: .55; }
.bar-chart .bar.today { opacity: 1; }
.bar-chart .bar-label { font-size: 12.5px; color: var(--faint); text-transform: capitalize; }
.bar-chart .bar-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.meter { height: 8px; border-radius: var(--radius); background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: var(--radius); background: var(--accent); }

/* ─── Subida de imágenes ───────────────────────────────────────────── */

.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, color .15s; }
.upload-box:hover { border-color: var(--accent); color: var(--text); }
.receipt-preview { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #fff; }
.receipt-preview img { width: 100%; max-height: 300px; object-fit: contain; }
.receipt-preview .btn { position: absolute; right: 8px; bottom: 8px; background: color-mix(in srgb, var(--bg) 85%, transparent); }
.done-mark { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 0 8px rgba(76, 175, 109, .08); animation: pop-in .4s var(--ease); }

/* ─── Punto de venta ───────────────────────────────────────────────── */

.pos > * { min-width: 0; }
.pos { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; padding-bottom: 80px; }
@media (min-width: 760px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; padding-bottom: 0; }
  .pos-cart { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; display: block !important; }
}
.pos-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, transform .1s; min-width: 0; }
.pos-tile:hover { border-color: var(--border-strong); }
.pos-tile:active { transform: scale(.98); }
.pos-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pos-tile:disabled { opacity: .45; cursor: not-allowed; }
.pos-tile .counter { top: 6px; right: 6px; z-index: 1; }
.pos-tile-img { width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: var(--radius); object-fit: cover; background: var(--surface-2); }
.pos-tile-img.thumb-fallback { font-size: 22px; }
.pos-tile-name { font-size: 13px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.pos-totals { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.pos-pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pos-pay .btn { flex-direction: column; gap: 4px; padding: 10px 6px; font-size: 13.5px; }
.pos-due { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.pos-due strong { font-size: 28px; }
.pos-cart-bar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + var(--bottom-nav, 0px)); display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border: none; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 10px 30px -8px rgba(var(--accent-rgb), .6); cursor: pointer; }

/* ─── Estructura de los paneles ────────────────────────────────────── */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell-nav { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.nav-item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; background: none; border: none; border-radius: var(--radius); color: var(--faint); font-size: 11.5px; font-weight: 500; cursor: pointer; text-decoration: none; min-width: 0; }
.nav-item .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { color: var(--accent); }
.nav-item .counter { top: 0; right: calc(50% - 22px); }
.nav-item.extra { display: none; }
.shell-main { flex: 1; min-width: 0; padding: 18px 0 96px; --bottom-nav: 66px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
@media (min-width: 960px) {
  .shell { flex-direction: row; }
  .shell-nav { position: sticky; top: 0; bottom: auto; right: auto; height: 100dvh; width: 230px; flex-shrink: 0; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 18px 12px; border-top: none; border-right: 1px solid var(--border); background: var(--surface); }
  .shell-nav .logo { padding: 4px 8px 18px; }
  .nav-item, .nav-item.extra { display: flex; flex: none; flex-direction: row; gap: 11px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.active { background: var(--surface-3); color: var(--text); }
  .nav-item .counter { position: static; margin-left: auto; }
  .nav-spacer { flex: 1; }
  .shell-main { padding: 26px 0 40px; --bottom-nav: 0px; }
  .shell-topbar { display: none; }
  .page-head h1 { font-size: 28px; }
}
@media (max-width: 959px) { .shell-nav .logo, .shell-nav .nav-spacer, .shell-nav .nav-desktop, .shell-nav .nav-actions { display: none; } }
.nav-actions { padding: 10px 4px 0; }
.nav-actions .btn { width: 100%; min-height: 42px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--faint); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.muted td { opacity: .5; }

/* ─── Tienda (cliente) ─────────────────────────────────────────────── */

.link { background: none; border: none; padding: 0; color: var(--muted); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.link:hover { color: var(--accent); }

.hero { position: relative; overflow: hidden; }
.hero-art { position: absolute; inset: 0; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; opacity: .5; animation: hero-drift 18s ease-in-out infinite alternate; }
.hero-glow { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 82%, transparent) 48%, color-mix(in srgb, var(--bg) 30%, transparent)), linear-gradient(0deg, var(--bg), transparent 45%); }
.hero-content { position: relative; padding-top: 56px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 22px; }
.hero-title { font-size: clamp(42px, 7.6vw, 104px); font-weight: 800; letter-spacing: -0.035em; line-height: .98; }
.hero-sub { color: var(--text); max-width: 46ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; }
.hero-perks { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14px; }
.hero-perks > * { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
/* Entrada de la portada: título, texto y acciones, uno tras otro. */
.hero-content > * { animation: rise .7s var(--ease) both; }
.hero-content > :nth-child(2) { animation-delay: 80ms; }
.hero-content > :nth-child(3) { animation-delay: 160ms; }
.hero-content > :nth-child(4) { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes hero-drift { from { transform: scale(1.04); } to { transform: scale(1.12) translateX(-2%); } }
@media (min-width: 760px) { .hero-content { padding-top: 120px; padding-bottom: 120px; } }

.section { padding: 48px 0 8px; }
.section-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.section-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); font-size: 16px; }
@media (min-width: 760px) { .section { padding-top: 88px; } .section-title { font-size: 44px; } }

.catalog-tools { display: flex; gap: 10px; }

.product-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: background .2s, transform .25s var(--ease); height: 100%; animation: rise .6s var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 60ms); }
.product-card:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-4px); }
/* La marca de la casa: un cuadrito del color principal en la esquina de cada tarjeta. */
.product-card::before { content: ""; position: absolute; z-index: 1; top: 0; left: 0; width: 12px; height: 12px; background: var(--accent); }
.product-card:active { transform: translateY(-1px) scale(.99); }
.product-card:hover .product-img { transform: scale(1.04); }
.product-img { transition: transform .5s var(--ease); }
.product-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.product-media .badge { position: absolute; left: 10px; bottom: 10px; font-size: 13px; }
.product-img { width: 100%; height: 100%; object-fit: cover; }
.product-img.thumb-fallback { font-size: 34px; }
.product-off { position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: var(--radius); background: var(--danger-strong); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.product-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.product-brand { font-size: 13px; color: var(--faint); }
.product-name { font-size: 17px; line-height: 1.25; }
.product-specs { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--accent); border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); }
.qty-stepper button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--accent); cursor: pointer; }
.qty-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper span { min-width: 26px; text-align: center; font-weight: 600; color: var(--accent); }
.qty-stepper.lg { width: 100%; justify-content: space-between; }
.qty-stepper.lg button { width: 50px; height: 48px; }

.detail { display: grid; gap: 18px; }
@media (min-width: 640px) { .detail { grid-template-columns: 1fr 1fr; } }
.detail-media { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.detail-img { width: 100%; height: 100%; object-fit: cover; }
.detail-img.thumb-fallback { font-size: 48px; }
.specs { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }

.option { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; transition: border-color .15s, color .15s, background .15s; }
.option:hover { border-color: var(--border-strong); color: var(--text); }
.option.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.order-code { font-size: 30px; font-weight: 600; letter-spacing: .18em; padding: 8px 18px; border-radius: var(--radius); border: 1px dashed var(--accent); color: var(--accent); background: var(--accent-soft); }

.track { display: flex; justify-content: space-between; position: relative; padding: 4px 0; }
.track::before { content: ""; position: absolute; top: 20px; left: 12%; right: 12%; height: 2px; background: var(--surface-3); }
.track-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--faint); text-align: center; }
.track-dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-3); border: 2px solid var(--surface); }
.track-step.done { color: var(--text); }
.track-step.done .track-dot { background: var(--ok); color: #fff; }
.track-step.current .track-dot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .2); }

.floating-cart { max-width: 460px; margin: 0 auto; }
@media (min-width: 760px) { .floating-cart { left: auto; right: 24px; bottom: 24px; width: 340px; } }

.footer { margin-top: 96px; padding: 48px 0 calc(90px + env(safe-area-inset-bottom)); background: var(--surface); }
.footer-inner { display: grid; gap: 24px; grid-template-columns: 1fr; }
.footer-name { font-family: var(--font-display); font-size: clamp(56px, 13vw, 180px); font-weight: 700; letter-spacing: -0.04em; line-height: .9; color: var(--faint); margin-top: 40px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } .footer { padding-bottom: 40px; } }

/* ─── Rider ────────────────────────────────────────────────────────── */

.rider-availability { display: flex; align-items: center; gap: 14px; border-color: var(--border); }
.rider-availability.on { border-color: rgba(76, 175, 109, .45); background: var(--ok-soft); }
.rider-order { display: flex; flex-direction: column; gap: 14px; }
.rider-order.new { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset, 0 0 30px -10px rgba(224, 179, 65, .5); }
.rider-address { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); text-decoration: none; font-size: 14px; }
.rider-address:hover { background: var(--surface-3); }
.rider-address > svg:first-child { color: var(--accent); flex-shrink: 0; }
.rider-money { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); }
.rider-timer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--info-soft); color: var(--info); }
.rider-timer .mono { font-size: 18px; font-weight: 600; }
.rider-timer.record { background: var(--warn-soft); color: var(--warn); }

/* ─── Panel admin ──────────────────────────────────────────────────── */

.desktop-only { display: none !important; }
@media (min-width: 960px) { .desktop-only { display: flex !important; } }

/* Pendientes: una lista sobria; el color solo en el punto que dice qué tan urgente es. */
.todo-list { padding: 4px 6px; margin-bottom: 20px; }
.todo-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; background: none; border: none; border-radius: var(--radius); color: var(--text); font-size: 14.5px; text-align: left; cursor: pointer; }
.todo-item:hover { background: var(--surface-2); }
.todo-item > svg { color: var(--faint); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.dot.warn { background: var(--warn); }
.dot.info { background: var(--info); }
.dot.danger { background: var(--danger); }

/* Cifras del día: texto sobre el fondo, sin tarjetas ni íconos. */
.kpis { display: grid; gap: 18px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpis .stat { padding: 0; background: none; }
.kpis .stat .value.mono { font-family: var(--font-display); font-size: 26px; }

.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
/* El gráfico ocupa el alto de su tarjeta, sin una franja vacía debajo. */
.dash-grid .bar-chart { flex: 1; height: auto; min-height: 140px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 3fr 2fr; } }
.bar-chart .bar-col { cursor: default; }
.bar-chart .bar-value { opacity: 0; transition: opacity .15s; }
.bar-chart .bar-value.always, .bar-chart .bar-col:hover .bar-value, .bar-chart .bar-col:focus .bar-value { opacity: 1; }
.bar-chart .bar-col:hover .bar:not(.today) { filter: brightness(1.15); }

.order-card { display: flex; flex-direction: column; gap: 14px; }
.order-card.unseen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 26px -10px rgba(var(--accent-rgb), .55); }
.order-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .order-grid { grid-template-columns: 1fr 1fr; } }
.order-grid > :last-child { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); align-self: start; }
.rider-line { padding: 8px 10px; border-radius: var(--radius); background: var(--teal-soft); color: var(--teal); }

.inquiry { display: flex; flex-direction: column; gap: 12px; }
.inquiry.done { opacity: .65; }
.inquiry.reporte:not(.done) { border-color: rgba(226, 87, 76, .5); }
.inquiry-icon { width: 38px; height: 38px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inquiry-icon.teal { background: var(--teal-soft); color: var(--teal); }
.inquiry-icon.info { background: var(--info-soft); color: var(--info); }
.inquiry-icon.danger { background: var(--danger-soft); color: var(--danger); }
.inquiry-message { margin-top: 4px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

.product-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.product-row.inactive { opacity: .55; }
.product-row-main { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: none; padding: 0; text-align: left; cursor: pointer; }
.product-row-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.photo-picker { display: flex; gap: 14px; align-items: flex-start; }
.photo-preview { width: 104px; height: 104px; flex-shrink: 0; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.bank-row { display: grid; gap: 10px; grid-template-columns: 1fr; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
@media (min-width: 720px) { .bank-row { grid-template-columns: 1fr 1fr 1fr auto; } }

/* ─── Reducción de movimiento ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ─── Hoja de garantía (solo al imprimir) ──────────────────────────── */

/* Hoja de garantía: en pantalla es la vista previa a escala; al imprimir, la página. */
.w-sheet {
  --sheet-color: #111;
  width: 8.5in; min-height: 11in; padding: 16mm 18mm; box-sizing: border-box; display: flex; flex-direction: column; gap: 11px;
  background: #fff; color: #111; font: 10pt/1.42 var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.w-sheet.pequeña { font-size: 9pt; }
.w-sheet.grande { font-size: 11pt; }
.w-sheet h1 { font-size: 1.43em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sheet-color); }
.w-sheet h2 { font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sheet-color); border-bottom: 1px solid color-mix(in srgb, var(--sheet-color) 35%, #fff); padding-bottom: 3px; margin-bottom: 6px; }
.w-sheet p { margin: 0; white-space: pre-wrap; }
.sheet-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.sheet-row > span:first-child { color: #555; }
.sheet-row > span:last-child { font-weight: 500; white-space: pre-wrap; }
.sheet-row + .sheet-row { margin-top: 3px; }
.sheet-gap { height: 0.6em; }
.w-sheet dl { display: grid; grid-template-columns: 130px 1fr; gap: 3px 12px; margin: 0; }
.w-sheet dt { color: #555; }
.w-sheet dd { margin: 0; font-weight: 500; }
.sheet-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--sheet-color); font-size: 0.9em; color: #333; }
.sheet-brand { display: flex; gap: 12px; align-items: flex-start; }
.sheet-brand .logo-mark { flex-shrink: 0; width: 34px; height: 34px; }
.sheet-brand .logo-mark.pequeño { width: 24px; height: 24px; }
.sheet-brand .logo-mark.grande { width: 50px; height: 50px; }
.sheet-logo-img { flex-shrink: 0; height: 56px; max-width: 200px; object-fit: contain; }
.sheet-logo-img.pequeño { height: 38px; max-width: 140px; }
.sheet-logo-img.grande { height: 84px; max-width: 260px; }
.sheet-logo { font: 700 1.6em var(--font-display); letter-spacing: 0.02em; color: #111; }
.sheet-title { text-align: right; }
.w-sheet.centro .sheet-head { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.w-sheet.centro .sheet-brand { flex-direction: column; align-items: center; gap: 6px; }
.w-sheet.centro .sheet-title { text-align: center; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th { text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #bbb; padding: 4px 6px; }
.sheet-table td { border-bottom: 1px solid #e3e3e3; padding: 5px 6px; vertical-align: top; }
.sheet-table th:first-child, .sheet-table td:first-child { width: 48px; text-align: center; }
.sheet-table th:nth-child(n + 3), .sheet-table td:nth-child(n + 3) { text-align: right; white-space: nowrap; }
.w-sheet dl.sheet-totals { grid-template-columns: auto 120px; justify-content: end; margin-top: 8px; text-align: right; }
.sheet-totals .strong { font-weight: 700; color: var(--sheet-color); font-size: 1.1em; }
.sheet-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: auto; padding-top: 44px; text-align: center; font-size: 0.9em; color: #444; }
.sheet-signatures div { border-top: 1px solid #111; padding-top: 4px; }
.sheet-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid #ccc; font-size: 0.81em; color: #666; text-align: center; }
.sheet-signatures + .sheet-foot { margin-top: 18px; }

.sheet-preview { overflow: hidden; border-radius: var(--radius); }
.sheet-preview .w-sheet { margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.sheet-preview .w-sheet:last-child { margin-bottom: 0; }

.designer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.designer-preview { position: sticky; top: 72px; }
.designer-controls h3 { margin-top: 6px; }
.designer-actions { position: sticky; bottom: -18px; padding: 12px 0; background: var(--surface); border-top: 1px solid var(--border); }
.designer-body { font-size: 13px; line-height: 1.5; }
.designer-logo { height: 44px; max-width: 140px; object-fit: contain; background: #fff; border-radius: var(--radius); padding: 4px; }
.chips.wrap { flex-wrap: wrap; }
.quote-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.quote-line.head { padding: 0 0 4px; }
.quote-qty { width: 70px; }
.quote-remove { width: 30px; flex-shrink: 0; }
.quote-price { width: 120px; }
@media (max-width: 559px) {
  .quote-line { flex-wrap: wrap; }
  .quote-line.head { display: none; }
  .quote-line > .grow { flex-basis: 100%; }
  .quote-price { flex: 1; }
}
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.swatch.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-input { width: 38px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer; }
@media (max-width: 899px) {
  .designer { grid-template-columns: minmax(0, 1fr); }
  .designer-preview { position: static; order: -1; }
}

#print-root { display: none; }

@page { size: letter; margin: 16mm 18mm; }

@media print {
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #111 !important; }
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .w-sheet { width: auto; min-height: calc(279mm - 32mm - 4mm); padding: 0; break-after: page; }
  #print-root .w-sheet:last-child { break-after: auto; }
}

/* ─── Marca en Ajustes ─────────────────────────────────────────────── */

.brand-logo-box { display: flex; align-items: center; justify-content: center; width: 72px; height: 48px; border-radius: var(--radius); background: var(--bg); }
.brand-logo-box img { max-width: 60px; max-height: 36px; object-fit: contain; }
.brand-hero-box { aspect-ratio: 16 / 7; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.brand-hero-box img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.brand-preview { padding: 14px; border-radius: var(--radius); background: var(--bg); }
.brand-preview-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); color: var(--text); }
.brand-preview-card .price { color: var(--accent); }

/* ─── WhatsApp ─────────────────────────────────────────────────────── */

.link-inline { color: var(--accent); text-decoration: underline; }
.wa-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.wa-qr img { background: #fff; padding: 8px; border-radius: var(--radius); }
.wa-qr p { flex: 1 1 200px; }
.wa-guide { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.wa-guide summary { cursor: pointer; font-weight: 700; }
.wa-guide ol { margin: 12px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; }

.wa-chat { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .wa-chat { grid-template-columns: 320px minmax(0, 1fr); } }
@media (min-width: 1200px) { .wa-chat.with-card { grid-template-columns: 300px minmax(0, 1fr) 320px; } }
@media (max-width: 899px) { .wa-chat.has-open .wa-side { display: none; } }
.wa-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wa-list { display: flex; flex-direction: column; gap: 2px; max-height: 66dvh; overflow-y: auto; }
.wa-chat-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: none; border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; min-width: 0; }
.wa-chat-item:hover { background: var(--surface-2); }
.wa-chat-item.active { background: var(--surface-3); }
.wa-conversation { display: flex; flex-direction: column; min-height: 60dvh; max-height: 75dvh; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.wa-conversation-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.wa-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.wa-bubble { max-width: min(80%, 520px); padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); align-self: flex-start; }
.wa-bubble.out { align-self: flex-end; background: var(--accent-soft); }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.wa-meta { margin-top: 2px; text-align: right; }
.wa-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--border); }
.wa-compose .textarea { min-height: 44px; }

/* Ficha del cliente: el nombre es lo único grande; lo demás, listas cortas. */
.wa-card-aside { max-height: 75dvh; overflow-y: auto; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.wa-card-name { width: 100%; resize: none; overflow: hidden; field-sizing: content; padding: 2px 0; border: none; border-bottom: 1px solid transparent; background: none; color: var(--text); font: inherit; font-size: 22px; font-weight: 700; line-height: 1.25; }
.wa-card-name::placeholder { color: var(--faint); }
.wa-card-name:hover { border-bottom-color: var(--border); }
.wa-card-name:focus { outline: none; border-bottom-color: var(--accent); }
.wa-card-section h3 { margin: 0 0 6px; font-size: 14px; }
.wa-card-section ul { margin: 0; padding: 0; list-style: none; }
.wa-card-section li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.wa-card-section li > .tiny { grid-column: 1; }
.wa-card-section li > .badge { grid-column: 2; grid-row: 1; justify-self: end; }
.wa-card-amount { grid-column: 2; grid-row: 2; justify-self: end; font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* Ajustes → Mensajes de WhatsApp */
.wa-msg-heading { margin: 0; font-size: 15px; }
.wa-msg-auto { display: grid; gap: 10px 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.wa-msg-editor { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .wa-msg-editor { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.wa-msg-editor .textarea { font-size: 14px; line-height: 1.5; }
.wa-msg-fields { display: flex; flex-direction: column; gap: 6px; }
.wa-msg-fields .chip { font-size: 12.5px; padding: 4px 10px; }
.wa-msg-preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); }
.wa-msg-bubble { max-width: 100%; align-self: stretch; }
