:root {
  --brand: #E20A16;
  --brand-dark: #B60812;
  --brand-deep: #8e040c;
  --gold: #FFC72C;
  --gold-dark: #e6ad00;
  --ink: #0f1220;
  --ink-2: #22263a;
  --muted: #7a7f95;
  --bg: #f4f5fa;
  --bg-2: #ecedf4;
  --panel: #ffffff;
  --line: #e6e8f0;
  --wa: #25D366;
  --shadow-sm: 0 4px 14px rgba(15,18,32,.08);
  --shadow-md: 0 10px 28px rgba(15,18,32,.14);
  --shadow-lg: 0 24px 60px rgba(15,18,32,.22);
  --radius: 16px;
  --radius-sm: 10px;
  --font-h: 'Poppins', system-ui, sans-serif;
  --font-b: 'Roboto', system-ui, sans-serif;

  --c-pend: #f59e0b;
  --c-pend-bg: #fff6e5;
  --c-prep: #6366f1;
  --c-prep-bg: #eef0ff;
  --c-listo: #10b981;
  --c-listo-bg: #e5fbf3;
  --c-ent: #64748b;
  --c-ent-bg: #eef1f5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body.admin {
  font-family: var(--font-b);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(226,10,22,.08), transparent 60%),
    radial-gradient(1000px 500px at 110% -10%, rgba(255,199,44,.14), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
input, select {
  font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(226,10,22,.12); }

/* ============ GATE (LOGIN) ============ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(1000px 500px at 20% 10%, rgba(255,199,44,.18), transparent 50%),
    radial-gradient(800px 500px at 80% 90%, rgba(226,10,22,.18), transparent 50%),
    linear-gradient(135deg, #1a1d2c 0%, #0f1220 100%);
  padding: 20px;
}
.gate-card {
  background: #fff; border-radius: 24px; padding: 34px 30px;
  width: min(400px, 100%); box-shadow: var(--shadow-lg);
  text-align: center;
}
.gate-logo {
  width: 74px; height: 74px; margin: 0 auto 8px;
  border-radius: 50%; padding: 4px; border: 3px solid var(--gold);
  object-fit: contain;
}
.gate h1 {
  font-family: var(--font-h); font-weight: 800; font-size: 22px;
  margin-top: 6px; color: var(--ink);
}
.gate-sub { color: var(--muted); font-size: 14px; margin-top: 4px; margin-bottom: 22px; }
.gate-field { text-align: left; margin-bottom: 16px; }
.gate-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.gate-field input { width: 100%; padding: 12px 14px; font-size: 15px; }
.gate-hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.gate-hint code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; font-weight: 700; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 14px;
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-red { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(226,10,22,.32); }
.btn-red:hover { background: var(--brand-dark); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 18px rgba(255,199,44,.42); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-2); }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.18);
  transition: background .15s, transform .12s;
}
.chip-btn:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.chip-btn.danger { background: rgba(0,0,0,.18); }
.chip-btn.danger:hover { background: rgba(0,0,0,.42); border-color: rgba(0,0,0,.35); }

/* ============ TOPBAR ============ */
.admin-top {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand) 55%, var(--brand-dark));
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 18px rgba(142, 4, 12, .45);
}
.admin-top-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.admin-logo {
  width: 46px; height: 46px; border-radius: 50%; padding: 3px;
  border: 2px solid var(--gold); background: #fff; object-fit: contain;
}
.admin-brand strong {
  font-family: var(--font-h); font-weight: 900; font-size: 17px;
  letter-spacing: .5px; display: block;
}
.admin-brand strong span { color: var(--gold); }
.admin-brand small {
  display: block; font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,.6);
}
.admin-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.live-dot {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(16,185,129,.15); color: #6ee7b7;
  font-weight: 700; font-size: 12px; letter-spacing: .5px;
}
.live-dot .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.65);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.65); }
  70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============ STATS ============ */
.stats {
  max-width: 1600px; margin: 0 auto;
  padding: 20px 20px 6px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(6, 1fr);
}
.stat {
  background: var(--panel); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat.card-hover { cursor: pointer; }
.stat.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d3d7e5; }
.stat.active { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(226,10,22,.1), var(--shadow-md); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, #fff2f3, #ffe8ea);
}
.stat[data-filter="pendiente"] .stat-icon { background: var(--c-pend-bg); }
.stat[data-filter="preparacion"] .stat-icon { background: var(--c-prep-bg); }
.stat[data-filter="listo"] .stat-icon { background: var(--c-listo-bg); }
.stat[data-filter="entregado"] .stat-icon { background: var(--c-ent-bg); }
.stat.stat-money .stat-icon { background: linear-gradient(135deg, #fff6d6, #ffe89e); }
.stat-body small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-body strong { display: block; font-family: var(--font-h); font-weight: 800; font-size: 22px; color: var(--ink); }

/* ============ TOOLBAR ============ */
.toolbar {
  max-width: 1600px; margin: 8px auto 0;
  padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tb-search {
  flex: 1 1 260px; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 10px; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.tb-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(226,10,22,.12); }
.tb-search .tb-ico { color: var(--muted); font-size: 15px; }
.tb-search input { border: none; padding: 8px 4px; width: 100%; background: transparent; }
.tb-search input:focus { box-shadow: none; }

.tb-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-seg {
  display: inline-flex; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; box-shadow: var(--shadow-sm);
}
.tb-seg button {
  padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--muted);
  border-radius: 8px; transition: background .15s, color .15s;
}
.tb-seg button:hover { color: var(--ink); }
.tb-seg button.active { background: var(--ink); color: #fff; }
.tb-clear {
  color: var(--muted); background: #fff; border: 1px solid var(--line);
}
.tb-clear:hover { background: #fff; color: #b91c1c; border-color: #fecaca; }

/* ============ BOARD (KANBAN) ============ */
.board {
  max-width: 1600px; margin: 0 auto;
  padding: 14px 20px 40px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 60vh;
}
.col {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.35));
  border-radius: 18px; border: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  backdrop-filter: blur(2px);
  min-height: 300px;
}
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-family: var(--font-h); font-weight: 800; font-size: 14px;
  color: var(--ink); letter-spacing: .3px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.col-head::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.col-head.col-pendiente::before { background: var(--c-pend); }
.col-head.col-preparacion::before { background: var(--c-prep); }
.col-head.col-listo::before { background: var(--c-listo); }
.col-head.col-entregado::before { background: var(--c-ent); }
.col-title { display: flex; align-items: center; gap: 8px; }
.col-emoji { font-size: 16px; }
.col-count {
  background: var(--ink); color: #fff;
  min-width: 26px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.col-head.col-pendiente .col-count { background: var(--c-pend); }
.col-head.col-preparacion .col-count { background: var(--c-prep); }
.col-head.col-listo .col-count { background: var(--c-listo); }
.col-head.col-entregado .col-count { background: var(--c-ent); }

.col-body {
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  min-height: 240px; flex: 1;
  transition: background .15s, box-shadow .15s;
}
.col-body.drag-over {
  background: rgba(226,10,22,.06);
  box-shadow: inset 0 0 0 2px rgba(226,10,22,.35);
}
.col-body.empty::after {
  content: 'Arrastra un pedido aquí';
  color: #b3b7c8; font-size: 12px; font-weight: 600;
  border: 2px dashed #d5d8e2; border-radius: 12px;
  padding: 22px 10px; text-align: center; margin-top: 4px;
}

/* ============ ORDER CARD ============ */
.card-order {
  background: #fff; border-radius: 14px;
  padding: 12px 12px 10px; border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(15,18,32,.06);
  cursor: grab; user-select: none;
  transition: transform .12s, box-shadow .15s, border-color .15s;
  touch-action: none;
  position: relative;
  overflow: hidden;
}
.card-order:hover {
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,18,32,.1);
  border-color: #d3d7e5;
}
.card-order::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c-pend);
}
.card-order.st-preparacion::before { background: var(--c-prep); }
.card-order.st-listo::before { background: var(--c-listo); }
.card-order.st-entregado::before { background: var(--c-ent); }
.card-order.dragging {
  opacity: 0.35; transform: scale(0.98);
}

.co-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.co-id { font-family: var(--font-h); font-weight: 800; font-size: 13px; color: var(--ink); }
.co-time {
  font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .5px;
  white-space: nowrap;
}
.co-name {
  margin-top: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.co-name .co-mode {
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  background: var(--bg-2); color: var(--ink-2);
  padding: 2px 7px; border-radius: 999px;
}
.co-name .co-mode.delivery { background: #eaf2ff; color: #1e40af; }
.co-name .co-mode.retiro { background: #fff4e5; color: #92400e; }

.co-items {
  margin-top: 8px; font-size: 12.5px; color: #4b5164; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.co-items b { color: var(--brand); font-weight: 700; }

.co-foot {
  margin-top: 10px; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px dashed var(--line); padding-top: 8px;
}
.co-total { font-family: var(--font-h); font-weight: 800; font-size: 15px; color: var(--ink); }
.co-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted);
}
.co-pill.pay-Efectivo { background: #eafdf1; color: #047857; }
.co-pill.pay-Transferencia { background: #eef0ff; color: #4338ca; }
.co-pill.pay-Tarjeta { background: #fef3c7; color: #92400e; }

.co-new-tag {
  position: absolute; top: 8px; right: 10px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px;
  animation: newBadge 2s ease-out;
}
@keyframes newBadge {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Ghost element while dragging (follows pointer) */
.drag-ghost {
  position: fixed; z-index: 999; pointer-events: none;
  width: 260px; transform: rotate(-1.5deg);
  box-shadow: 0 26px 60px rgba(15,18,32,.35);
  border-radius: 14px;
}

/* ============ EMPTY STATE ============ */
.empty {
  max-width: 500px; margin: 40px auto; text-align: center; padding: 30px 20px;
}
.empty-icon { font-size: 60px; margin-bottom: 12px; }
.empty h3 { font-family: var(--font-h); font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

/* ============ DETAIL MODAL ============ */
.modal-back {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15,18,32,.55);
  display: grid; place-items: center;
  padding: 20px; backdrop-filter: blur(4px);
  animation: fadeIn .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  background: #fff; border-radius: 22px; width: min(560px, 100%);
  max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mp-head {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--line);
}
.mp-head h3 { font-family: var(--font-h); font-weight: 800; font-size: 18px; }
.mp-head small { color: var(--muted); font-size: 12px; }
.icon-x {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--bg-2); color: var(--ink-2); font-size: 16px;
  display: grid; place-items: center;
  transition: background .15s;
}
.icon-x:hover { background: #dee1ec; }

.mp-body { padding: 16px 20px; overflow-y: auto; }
.mp-block { margin-bottom: 16px; }
.mp-block h4 {
  font-family: var(--font-h); font-weight: 800; font-size: 13px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.mp-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.mp-kv > div { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.mp-kv small { font-size: 11px; color: var(--muted); display: block; }
.mp-kv b { font-size: 13.5px; color: var(--ink); }

.mp-line {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.mp-line:last-child { border-bottom: none; }
.mp-line-info { flex: 1; }
.mp-line-name { font-weight: 700; font-size: 14px; }
.mp-line-extras {
  margin-top: 3px; font-size: 12px; color: var(--muted);
}
.mp-line-extras .sin-tag {
  color: #b91c1c; font-weight: 700;
}
.mp-line-price { font-weight: 800; font-family: var(--font-h); }

.mp-totals {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; margin-top: 6px;
  border-top: 2px solid var(--ink);
  font-family: var(--font-h); font-weight: 800; font-size: 16px;
}

.mp-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: #fafbff;
}
.mp-status-row {
  display: grid; gap: 6px; grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px;
}
.mp-status-row button {
  padding: 10px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 800;
  background: #fff; border: 1.5px solid var(--line); color: var(--muted);
  transition: all .15s;
}
.mp-status-row button:hover { border-color: var(--ink-2); color: var(--ink); }
.mp-status-row button.on { color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.mp-status-row button.on[data-s="pendiente"]     { background: var(--c-pend); }
.mp-status-row button.on[data-s="preparacion"]  { background: var(--c-prep); }
.mp-status-row button.on[data-s="listo"]         { background: var(--c-listo); }
.mp-status-row button.on[data-s="entregado"]    { background: var(--c-ent); }
.mp-actions { display: flex; gap: 8px; }
.mp-actions .btn { flex: 1; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 200;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md);
  animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ============ VIEW NAV ============ */
.view-nav {
  display: inline-flex; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 4px;
}
.view-nav button {
  padding: 8px 14px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.7);
  border-radius: 8px; transition: background .15s, color .15s;
}
.view-nav button:hover { color: #fff; }
.view-nav button.active { background: var(--gold); color: var(--ink); }

/* ============ MENU EDITOR ============ */
.menu-editor {
  max-width: 1600px; margin: 20px auto 40px;
  padding: 0 20px;
  display: grid; grid-template-columns: 280px 1fr; gap: 18px;
}
.me-cats, .me-products {
  background: #fff; border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.me-cats-head, .me-prod-head {
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fafbff, #fff);
}
.me-cats-head h3, .me-prod-head h3 {
  font-family: var(--font-h); font-weight: 800; font-size: 15px; color: var(--ink);
}
.me-prod-head small { color: var(--muted); font-size: 12px; }
.me-add-cat {
  width: 34px; height: 34px; padding: 0; font-size: 18px; border-radius: 10px; line-height: 1;
}
.me-cats-list { padding: 8px; }
.me-cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  font-weight: 700; font-size: 14px; color: var(--ink-2);
  transition: background .15s, color .15s;
  position: relative;
}
.me-cat-item:hover { background: var(--bg); }
.me-cat-item.active {
  background: linear-gradient(90deg, rgba(226,10,22,.08), transparent);
  color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}
.me-cat-item .me-cat-count {
  margin-left: auto; background: var(--bg-2); color: var(--muted);
  min-width: 24px; height: 20px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 800;
}
.me-cat-item.active .me-cat-count { background: rgba(226,10,22,.14); color: var(--brand); }
.me-cat-edit {
  opacity: 0; transition: opacity .15s;
  font-size: 12px; color: var(--muted);
  padding: 4px 6px; border-radius: 6px;
}
.me-cat-item:hover .me-cat-edit { opacity: 1; }
.me-cat-edit:hover { background: var(--bg-2); color: var(--ink); }

.me-prod-head { flex-wrap: wrap; }
.me-prod-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-search { flex: 0 0 auto; min-width: 200px; padding: 4px 10px; }
.me-search input { padding: 6px 4px; font-size: 13px; }

.me-prod-grid {
  padding: 16px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.me-prod-card {
  background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .12s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; position: relative;
}
.me-prod-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d3d7e5;
}
.me-prod-img {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, #ffe9d6, #ffd9ce);
  display: flex; align-items: center; justify-content: center; font-size: 48px;
  position: relative; overflow: hidden;
}
.me-prod-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-prod-img .discount-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 999px;
}
.me-prod-body { padding: 12px 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.me-prod-name { font-weight: 800; font-size: 14px; color: var(--ink); line-height: 1.25; }
.me-prod-desc {
  font-size: 12px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 32px;
}
.me-prod-price-row {
  margin-top: 6px; display: flex; align-items: baseline; gap: 6px;
}
.me-prod-price { font-family: var(--font-h); font-weight: 800; font-size: 16px; color: var(--brand); }
.me-prod-price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.me-prod-actions-row {
  padding: 8px 10px 10px; display: flex; gap: 6px; border-top: 1px solid var(--line);
  background: #fafbff;
}
.me-prod-actions-row button {
  flex: 1; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.me-prod-actions-row button:hover { background: var(--bg-2); }
.me-prod-actions-row button.danger:hover { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }

.me-empty {
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.me-empty p { margin-bottom: 12px; }

/* ============ LIVE EDITOR (WYSIWYG) ============ */
.me-live {
  padding: 18px 20px 24px;
  display: flex; flex-direction: column; gap: 26px;
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(255,199,44,.08), transparent 60%),
    radial-gradient(600px 200px at 0% 100%, rgba(226,10,22,.05), transparent 60%),
    #fdfdfb;
}
.me-live-section {
  border-radius: 16px;
}
.me-live-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 4px 4px 8px;
  border-bottom: 2px solid var(--brand);
  flex-wrap: wrap;
}
.me-live-head h3 {
  font-family: var(--font-h); font-weight: 900; font-size: 20px;
  color: var(--ink); letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
}
.me-live-head h3::before {
  content: ''; width: 6px; height: 22px; background: var(--gold); border-radius: 3px;
}
.me-live-head-actions {
  display: flex; gap: 6px; align-items: center;
}
.me-live-head-actions button {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.me-live-head-actions button:hover { background: var(--bg-2); }
.me-live-head-actions button.primary {
  background: var(--brand); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(226,10,22,.28);
}
.me-live-head-actions button.primary:hover { background: var(--brand-dark); }
.me-live-head-actions button.danger:hover {
  background: #fee2e2; color: #b91c1c; border-color: #fecaca;
}

.me-live-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin-top: 14px;
}
.me-live-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .2s, border-color .15s;
  cursor: pointer; position: relative;
  box-shadow: 0 2px 8px rgba(15,18,32,.04);
}
.me-live-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15,18,32,.12);
  border-color: var(--brand);
}
.me-live-img {
  aspect-ratio: 4/3; background: linear-gradient(135deg, #ffe9d6, #ffd9ce);
  position: relative; display: flex; align-items: center; justify-content: center;
  font-size: 56px; overflow: hidden;
}
.me-live-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-live-oferta {
  position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(226,10,22,.3);
}
.me-live-overlay {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 4px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .18s, transform .18s;
}
.me-live-card:hover .me-live-overlay,
.me-live-card:focus-within .me-live-overlay { opacity: 1; transform: translateY(0); }
.me-live-overlay button {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(255,255,255,.96); color: var(--ink); font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); display: grid; place-items: center;
  transition: transform .12s, background .15s, color .15s;
}
.me-live-overlay button:hover { transform: scale(1.08); background: #fff; }
.me-live-overlay button.del:hover { background: var(--brand); color: #fff; }

.me-live-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.me-live-name {
  font-family: var(--font-h); font-weight: 800; font-size: 15px;
  color: var(--ink); line-height: 1.25;
}
.me-live-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 34px;
}
.me-live-price-row {
  margin-top: 8px; display: flex; align-items: baseline; gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--line);
}
.me-live-price {
  font-family: var(--font-h); font-weight: 800; font-size: 17px; color: var(--brand);
}
.me-live-price-old {
  font-size: 12.5px; color: var(--muted); text-decoration: line-through;
}

.me-live-empty {
  padding: 22px; text-align: center; color: var(--muted);
  background: #fff; border-radius: 12px;
  border: 2px dashed var(--line);
  font-size: 13px;
}

.me-add-section {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 24px; border: 2px dashed var(--line); border-radius: 16px;
  color: var(--muted); font-weight: 700; font-size: 14px;
  background: rgba(255,255,255,.5);
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  cursor: pointer;
}
.me-add-section:hover {
  background: rgba(226,10,22,.05);
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}
.me-live-no-results {
  padding: 60px 20px; text-align: center; color: var(--muted);
  background: #fff; border-radius: 14px; border: 1px dashed var(--line);
}
.me-live-no-results .big { font-size: 42px; margin-bottom: 8px; }

/* ============ PRODUCT EDITOR MODAL ============ */
.modal-panel.modal-lg { width: min(760px, 100%); }
.p-editor {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
}
.p-img-preview {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #ffe9d6, #ffd9ce);
  display: flex; align-items: center; justify-content: center; font-size: 60px;
  color: rgba(0,0,0,.35); font-weight: 700;
  border: 2px dashed rgba(0,0,0,.08);
}
.p-img-preview span { font-size: 13px; letter-spacing: .5px; text-transform: uppercase; }
.p-img-preview.has-img { border: none; padding: 0; }
.p-img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-img-actions { display: flex; gap: 6px; margin-top: 10px; }
.p-img-actions .btn { flex: 1; font-size: 12.5px; padding: 8px 10px; }
.p-form-side { display: flex; flex-direction: column; gap: 10px; }
.p-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.s-field textarea {
  width: 100%;
  border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 10px 12px; outline: none;
  font-family: inherit; font-size: 14px; color: var(--ink);
  resize: vertical; min-height: 80px;
  transition: border-color .15s, box-shadow .15s;
}
.s-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(226,10,22,.12); }

/* ============ SETTINGS ============ */
.settings-wrap {
  max-width: 900px; margin: 20px auto 40px;
  padding: 0 20px; display: flex; flex-direction: column; gap: 16px;
}
.s-card {
  background: #fff; border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.s-card.danger { border-color: #fecaca; }
.s-card.danger .s-head { background: linear-gradient(180deg, #fff1f1, #fff); }
.s-head { padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fafbff, #fff); }
.s-head h3 { font-family: var(--font-h); font-weight: 800; font-size: 16px; color: var(--ink); }
.s-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.s-head small code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; font-weight: 700; }
.s-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.s-field { display: flex; flex-direction: column; gap: 6px; }
.s-field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.s-field input, .s-field select { width: 100%; }
.s-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.s-actions-row { justify-content: flex-start; flex-wrap: wrap; }
.s-hint { font-size: 12px; color: var(--muted); }

.s-logo-row { display: flex; align-items: center; gap: 14px; }
.s-logo-preview {
  width: 74px; height: 74px; border-radius: 50%; padding: 3px;
  border: 3px solid var(--gold); background: #fff; object-fit: contain;
}
.s-logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1050px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .menu-editor { grid-template-columns: 1fr; }
  .p-editor { grid-template-columns: 1fr; }
  .p-img-preview { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; }
  .admin-top-inner { padding: 10px 14px; }
  .admin-brand small { display: none; }
  .stats, .toolbar, .board { padding-left: 14px; padding-right: 14px; }
  .mp-status-row { grid-template-columns: repeat(2, 1fr); }
  .mp-kv { grid-template-columns: 1fr; }
  .view-nav { order: 3; width: 100%; overflow-x: auto; }
  .view-nav button { padding: 8px 10px; font-size: 12px; }
  .menu-editor, .settings-wrap { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 480px) {
  .live-dot span:last-child, .chip-btn span:last-child { display: none; }
  .chip-btn { padding: 8px 10px; }
}

/* ================= Nuevos módulos: ubicación, horarios, feriados, editar pedido ================= */
.s-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.s-map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 10px;
  overflow: hidden;
}
.sched-grid {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.sched-row {
  display: grid;
  grid-template-columns: 200px 120px auto 120px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  background: #fafbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sched-row input[type="time"] {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.sched-day { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.chk-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.s-holiday-add {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 8px;
}
.s-holiday-add input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.s-holiday-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.hol-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: #fafbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hol-date { font-weight: 700; }
.hol-del {
  border: none; background: #fee2e2; color: #dc2626;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
}

/* Kanban card pencil */
.card-order .co-head { position: relative; }
.co-edit {
  position: absolute;
  top: -6px; right: -6px;
  width: 26px; height: 26px;
  border: none; background: var(--gold);
  color: #333;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.co-edit:hover { background: var(--gold-dark); }
.co-phone { font-weight: 500; font-size: 11px; color: var(--muted); margin-left: 4px; }
.mp-notes {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fffbe6;
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 13px;
}

/* Edit order modal items */
.eo-block { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.eo-block h4 { margin-bottom: 8px; font-family: var(--font-h); color: var(--ink-2); }
.eo-items { display: grid; gap: 8px; margin-bottom: 8px; }
.eo-item {
  display: grid;
  grid-template-columns: 2fr 60px 100px 2fr 32px;
  gap: 6px;
  align-items: center;
}
.eo-item input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.eo-i-del {
  border: none; background: #fee2e2; color: #dc2626;
  border-radius: 8px; cursor: pointer;
}
.eo-totals {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; padding: 10px 4px 0 4px;
  border-bottom: none;
}

@media (max-width: 720px) {
  .s-grid-2 { grid-template-columns: 1fr; }
  .sched-row { grid-template-columns: 1fr; }
  .s-holiday-add { grid-template-columns: 1fr; }
  .hol-row { grid-template-columns: 100px 1fr auto; }
  .eo-item { grid-template-columns: 1fr; }
}
