/* He-Me · estilos compartidos (tienda y portal admin) — misma línea visual que KioscoPOS / TicketMaster */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #0e1116; --surface: #161b22; --surface-2: #1d232c; --surface-3: #262d38; --border: #2b323d;
  --text: #eef1f4; --text-2: #b4bcc7; --muted: #7d8794;
  --accent: #3b82f6; --accent-2: #2563eb; --accent-soft: rgba(59,130,246,.16); --on-accent: #fff;
  --steel: linear-gradient(135deg, #f5f7fa, #aeb6c0 45%, #eef1f4 60%, #8a939e);
  --ok: #22c55e; --ok-soft: rgba(34,197,94,.14); --danger: #ef4444; --danger-soft: rgba(239,68,68,.14);
  --warn: #f59e0b; --warn-soft: rgba(245,158,11,.15); --info: #38bdf8; --info-soft: rgba(56,189,248,.14);
  --radius: 12px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f6f8fa; --surface-3: #eceff3; --border: #dde2e8;
  --text: #121820; --text-2: #3d4753; --muted: #6b7684;
  --accent: #2563c9; --accent-2: #1d4fa8; --accent-soft: rgba(37,99,201,.10);
  --ok: #16a34a; --ok-soft: rgba(22,163,74,.12); --danger: #dc2626; --danger-soft: rgba(220,38,38,.10);
  --warn: #d97706; --warn-soft: rgba(217,119,6,.12); --info: #0284c7; --info-soft: rgba(2,132,199,.10);
  --shadow: 0 10px 30px rgba(20,30,40,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.nowrap { white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card h3 .sp { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text); transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04130a; }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 12px; }
.btn.icon { padding: 7px; }
.btn.block { width: 100%; }

label.f { display: block; min-width: 0; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
label.f > small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 90px; }
select.input { cursor: pointer; }
.input.money { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.searchbox { position: relative; }
.searchbox svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox .input { padding-left: 38px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.click { cursor: pointer; }
table.t tr.nuevo td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.t tr.nuevo td { font-weight: 600; }
table.t td.actions { white-space: nowrap; text-align: right; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; display: block; margin: 0 auto 10px; opacity: .6; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: calc(100vw - 40px); }
.toast { background: var(--surface-3); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; max-width: 420px; animation: tin .2s ease; }
.toast.err { border-left-color: var(--danger); } .toast.ok { border-left-color: var(--ok); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 500; padding: 16px; animation: fin .15s ease; }
@keyframes fin { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; min-width: 0; }
.modal.wide { width: min(920px, 100%); }
.modal.xl { width: min(1200px, 100%); }
.modal > header { padding: 18px 20px 0; display: flex; align-items: center; gap: 10px; }
.modal > header h2 { margin: 0; font-size: 18px; flex: 1; }
.modal > .body { padding: 16px 20px; overflow: auto; }
.modal > footer { padding: 0 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.alert { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.bad { background: var(--danger-soft); color: var(--danger); } .alert.ok { background: var(--ok-soft); color: var(--ok); }

/* Visor de imágenes a pantalla completa con zoom */
.lightbox { position: fixed; inset: 0; background: rgba(5,7,10,.94); z-index: 900; display: flex; flex-direction: column; animation: fin .15s; }
.lightbox .lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.lightbox .lb-top .grow { font-size: 13px; opacity: .8; }
.lightbox .lb-top button, .lightbox .lb-top a { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.lightbox .lb-stage { flex: 1 1 0; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lightbox .lb-stage.zoom { cursor: grab; }
.lightbox .lb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: 0 0; }
.lightbox .lb-top, .lightbox .lb-thumbs { flex: none; position: relative; z-index: 3; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.lightbox .lb-nav.prev { left: 14px; } .lightbox .lb-nav.next { right: 14px; }
.lightbox .lb-thumbs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; justify-content: center; }
.lightbox .lb-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; opacity: .5; cursor: pointer; border: 2px solid transparent; }
.lightbox .lb-thumbs img.on { opacity: 1; border-color: var(--accent); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: gira .7s linear infinite; display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }

@media print { .no-print { display: none !important; } }

/* Botón "Instalar app": solo se ve cuando el navegador permite instalar */
html:not(.instalable) [data-instalar] { display: none !important; }
