/* ==========================================================================
   Pizzería Diego — estilos
   Cada tema es un sabor de pizza. Todo el color sale de las variables.
   ========================================================================== */

:root,
[data-theme='margherita'] {
  --bg: #fff8ec;
  --bg-2: #fdf0da;
  --card: #ffffff;
  --ink: #2b1d14;
  --ink-soft: #7a6452;
  --line: #efdcc2;
  --primary: #d7263d;      /* tomate */
  --primary-2: #a61b2e;
  --primary-ink: #ffffff;
  --primary-soft: #fde4e6;
  --accent: #ffd166;       /* muzzarella */
  --accent-ink: #5b4300;
  --leaf: #2d6a4f;         /* albahaca */
  --crust: #c8813a;
  --ok: #2d6a4f;
  --warn: #e9a23b;
  --err: #c1121f;
  --shadow: 0 10px 30px -12px rgba(120, 60, 20, 0.28);
  --sidebar: #2b1d14;
  --sidebar-ink: #fbe9d0;
  --sidebar-active: #d7263d;
  --p1: #d7263d; --p2: #2d6a4f; --p3: #ffd166;
}

[data-theme='pepperoni'] {
  --bg: #fff4ee; --bg-2: #fde5da; --card: #fff; --ink: #2a1210; --ink-soft: #825047; --line: #f3d2c6;
  --primary: #b3261e; --primary-2: #7a1712; --primary-ink: #fff; --primary-soft: #fbe0dc;
  --accent: #ff8c42; --accent-ink: #5a2600; --leaf: #6a994e; --crust: #b86b2b;
  --sidebar: #3a0f0c; --sidebar-ink: #ffe3d6; --sidebar-active: #ff8c42;
  --p1: #b3261e; --p2: #ff8c42; --p3: #f9c74f;
}

[data-theme='fugazzeta'] {
  --bg: #fffaf0; --bg-2: #fbefd6; --card: #fff; --ink: #2e2210; --ink-soft: #7d6843; --line: #f0e0bd;
  --primary: #c98a1b; --primary-2: #8c5d0f; --primary-ink: #fff; --primary-soft: #fbedd0;
  --accent: #f6e7b4; --accent-ink: #5a4200; --leaf: #7a8b3a; --crust: #a8692b;
  --sidebar: #3b2a10; --sidebar-ink: #fdf1d8; --sidebar-active: #c98a1b;
  --p1: #c98a1b; --p2: #e9d8a6; --p3: #7a8b3a;
}

[data-theme='cuatroquesos'] {
  --bg: #fffdf3; --bg-2: #fbf4d6; --card: #fff; --ink: #29261a; --ink-soft: #6f6a4d; --line: #eee6bf;
  --primary: #d9a300; --primary-2: #9c7500; --primary-ink: #231c00; --primary-soft: #fcf1c6;
  --accent: #6c8ebf; --accent-ink: #fff; --leaf: #6c8ebf; --crust: #c69a4a;
  --sidebar: #1f2a3d; --sidebar-ink: #fff6d6; --sidebar-active: #d9a300;
  --p1: #ffd166; --p2: #6c8ebf; --p3: #f4a259;
}

[data-theme='rucula'] {
  --bg: #f7fbf2; --bg-2: #e9f3dd; --card: #fff; --ink: #18261a; --ink-soft: #5b6e57; --line: #d8e8c8;
  --primary: #3f7d20; --primary-2: #2a5615; --primary-ink: #fff; --primary-soft: #e0f0d4;
  --accent: #e56b6f; --accent-ink: #fff; --leaf: #3f7d20; --crust: #b07d48;
  --sidebar: #16301b; --sidebar-ink: #e9f5df; --sidebar-active: #e56b6f;
  --p1: #3f7d20; --p2: #e56b6f; --p3: #f1e3b3;
}

[data-theme='napolitana'] {
  --bg: #fff7f5; --bg-2: #fde8e3; --card: #fff; --ink: #1d1b2b; --ink-soft: #6b6480; --line: #f2d9d3;
  --primary: #e63946; --primary-2: #b0212d; --primary-ink: #fff; --primary-soft: #fde0e2;
  --accent: #f1faee; --accent-ink: #1d3557; --leaf: #457b9d; --crust: #c47f3c;
  --sidebar: #1d3557; --sidebar-ink: #f1faee; --sidebar-active: #e63946;
  --p1: #e63946; --p2: #f1faee; --p3: #457b9d;
}

[data-theme='horno'] {
  --bg: #17110e; --bg-2: #211813; --card: #2a1f19; --ink: #fbeee2; --ink-soft: #c2a992; --line: #3f2f25;
  --primary: #ff6b35; --primary-2: #e24e1b; --primary-ink: #1a0d06; --primary-soft: #43251a;
  --accent: #ffb347; --accent-ink: #2a1500; --leaf: #7fb069; --crust: #ff6b35;
  --ok: #7fb069; --warn: #ffb347; --err: #ff5d5d;
  --shadow: 0 12px 34px -10px rgba(0, 0, 0, 0.6);
  --sidebar: #0f0a08; --sidebar-ink: #fbeee2; --sidebar-active: #ff6b35;
  --p1: #ff6b35; --p2: #ffb347; --p3: #e24e1b;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}
h1, h2, h3, h4, .display { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; letter-spacing: 0.01em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
::selection { background: var(--accent); color: var(--accent-ink); }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 11px 18px; cursor: pointer;
  font-weight: 800; background: var(--bg-2); color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s;
  -webkit-tap-highlight-color: transparent; user-select: none; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px -6px var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--err); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.ghost.danger { background: transparent; color: var(--err); box-shadow: inset 0 0 0 2px var(--err); }
.btn.ghost.danger:hover {
  background: rgba(193, 18, 31, 0.12);
  background: color-mix(in srgb, var(--err) 12%, transparent);
}
.btn.sm { padding: 7px 12px; border-radius: 10px; font-size: 0.88em; }
.btn.lg { padding: 16px 22px; font-size: 1.1em; border-radius: 18px; }
.btn.block { width: 100%; }
.icon-btn {
  border: 0; background: transparent; width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 18px; color: inherit;
}
.icon-btn:hover { background: var(--bg-2); }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-weight: 700; font-size: 0.86em; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); outline: none; transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--primary); transform: scale(1.2); }
textarea { resize: vertical; min-height: 70px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; margin: 8px 0; font-weight: 600; cursor: pointer; }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 800; color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, transform 0.12s;
}
.seg button.on { background: var(--card); color: var(--primary); box-shadow: 0 2px 8px -2px rgba(0,0,0,.15); }
.seg button:active { transform: scale(0.95); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border-radius: 20px; padding: 18px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card h3 { font-size: 1.1em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cards { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi {
  background: var(--card); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--line);
  position: relative; overflow: hidden; animation: pop-in 0.5s both;
}
.kpi .k-label { color: var(--ink-soft); font-weight: 700; font-size: 0.85em; }
.kpi .k-value { font-family: 'Fredoka', sans-serif; font-size: 1.75em; font-weight: 700; margin-top: 4px; }
.kpi .k-sub { font-size: 0.82em; color: var(--ink-soft); margin-top: 2px; }
.kpi .k-ico { position: absolute; right: -6px; top: -8px; font-size: 54px; opacity: 0.14; transform: rotate(12deg); }
.kpi:nth-child(2) { animation-delay: 0.06s; } .kpi:nth-child(3) { animation-delay: 0.12s; } .kpi:nth-child(4) { animation-delay: 0.18s; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 800; background: var(--bg-2); color: var(--ink-soft); white-space: nowrap;
}
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.badge.err { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); }
.badge.pri { background: var(--primary-soft); color: var(--primary); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: 16px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 0.8em; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl tr.voided td { opacity: 0.5; text-decoration: line-through; }
.empty { text-align: center; padding: 40px 10px; color: var(--ink-soft); }
.empty .e-ico { font-size: 52px; display: block; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 45%),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 50%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 28px; padding: 30px 26px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); position: relative; z-index: 2; animation: rise 0.7s cubic-bezier(.2,.9,.3,1.2) both;
  border: 1px solid var(--line);
}
.login-logo { display: grid; place-items: center; margin: -80px auto 8px; width: 120px; height: 120px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }
.login-logo svg { animation: spin 18s linear infinite; }
.login h1 { text-align: center; font-size: 1.9em; color: var(--primary); }
.login .tag { text-align: center; color: var(--ink-soft); margin: 4px 0 20px; }
.login .err-msg { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); border-radius: 12px; padding: 10px 12px; font-weight: 700; margin-bottom: 12px; animation: shake 0.4s; }
.login .demo-hint { margin-top: 16px; font-size: 0.83em; color: var(--ink-soft); background: var(--bg-2); border-radius: 12px; padding: 10px 12px; }
.login .demo-hint code { background: var(--card); padding: 1px 6px; border-radius: 6px; font-weight: 800; color: var(--primary); cursor: pointer; }
.flavor-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.flavor-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--card); cursor: pointer; box-shadow: 0 0 0 2px var(--line);
  transition: transform 0.2s;
}
.flavor-dot:hover { transform: scale(1.15) rotate(20deg); }
.flavor-dot.on { box-shadow: 0 0 0 3px var(--primary); }

/* Ingredientes flotando en el fondo */
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.floaters i { position: absolute; bottom: -60px; border-radius: 50%; opacity: 0.55; animation: floatUp linear infinite; }
.floaters i.pep { background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--p1) 60%); }
.floaters i.basil { border-radius: 70% 0 70% 0; background: var(--leaf); }
.floaters i.olive { background: radial-gradient(circle, transparent 28%, #2b2b2b 30%); }
.floaters i.cheese { border-radius: 30% 60% 40% 70%; background: var(--accent); }
.floaters i.tomato { background: radial-gradient(circle at 50% 50%, #ffb3b3 18%, #e63946 20% 70%, #b0212d 72%); }

/* ==========================================================================
   SHELL
   ========================================================================== */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; transition: background 0.4s;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand svg { flex: none; transition: transform 0.6s; }
.brand:hover svg { transform: rotate(180deg); }
.brand b { font-family: 'Fredoka', sans-serif; font-size: 1.2em; line-height: 1.05; display: block; }
.brand small { opacity: 0.7; font-size: 0.78em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: inherit; text-decoration: none;
  font-weight: 700; opacity: 0.82; transition: background 0.2s, opacity 0.2s, transform 0.15s; position: relative; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); opacity: 1; transform: translateX(3px); }
.nav a.on { background: var(--sidebar-active); color: #fff; opacity: 1; box-shadow: 0 6px 16px -6px var(--sidebar-active); }
.nav a .n-ico { font-size: 20px; width: 26px; text-align: center; }
.nav a .n-count { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 0.75em; padding: 1px 8px; border-radius: 999px; font-weight: 900; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 0.85em; }

.main { min-width: 0; display: flex; flex-direction: column; }
.demo-trial-banner {
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
  border-bottom: 2px solid var(--accent);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  z-index: 25;
}
.demo-trial-banner.urgent {
  background: color-mix(in srgb, var(--err) 15%, var(--card));
  border-bottom-color: var(--err);
  color: var(--err);
}
.demo-trial-banner a {
  flex-shrink: 0;
}
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: 12px 22px 12px; border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 1.4em; display: flex; align-items: center; gap: 10px; }
.topbar .t-ico { display: inline-block; animation: wiggle 3.5s ease-in-out infinite; }
.topbar .spacer { flex: 1; }
.cash-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 0.82em; cursor: pointer; border: 0; }
.cash-chip.open { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.cash-chip.closed { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.cash-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.clock { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.user-pill { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 999px; padding: 4px 6px 4px 4px; cursor: pointer; border: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 900; }

/* Queso derritiéndose bajo la barra superior */
.drip { position: absolute; left: 0; width: 100%; bottom: -13px; height: 14px; pointer-events: none; overflow: visible; }
.drip path { fill: var(--accent); }
.drip .d { animation: drip 4.5s ease-in-out infinite; transform-origin: top; }
.drip .d:nth-child(2) { animation-delay: 0.8s; } .drip .d:nth-child(3) { animation-delay: 1.9s; } .drip .d:nth-child(4) { animation-delay: 2.6s; } .drip .d:nth-child(5) { animation-delay: 3.3s; }

.content { padding: 24px 22px 90px; max-width: 1400px; width: 100%; margin: 0 auto; animation: page-in 0.35s ease backwards; }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 14px; }
  .topbar h2 { font-size: 1.15em; }
  .clock { display: none; }
  .content { padding: 16px 12px 100px; }
  .bottom-nav {
    display: flex; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 30; background: var(--sidebar); color: var(--sidebar-ink);
    border-radius: 22px; padding: 6px; justify-content: space-around; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 16px; text-decoration: none;
    color: inherit; font-size: 0.68em; font-weight: 800; background: none; border: 0; cursor: pointer; opacity: 0.8; position: relative;
  }
  .bottom-nav a.on { background: var(--sidebar-active); color: #fff; opacity: 1; }
  .bottom-nav .b-ico { font-size: 21px; }
  .bottom-nav .n-count { position: absolute; top: 2px; right: 18%; background: var(--accent); color: var(--accent-ink); font-size: 0.9em; padding: 0 5px; border-radius: 999px; }
}
@media (max-width: 480px) {
  .user-pill .u-name { display: none; }
  .cash-chip .c-txt { display: none; }
}

.more-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-menu a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border-radius: 16px; background: var(--bg-2);
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: 0.9em;
}
.more-menu a span { font-size: 28px; }

/* ==========================================================================
   VENDER (punto de venta)
   ========================================================================== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: none; border: 0; cursor: pointer; background: var(--card); border-radius: 16px; padding: 10px 16px; font-weight: 800;
  display: flex; align-items: center; gap: 8px; box-shadow: inset 0 0 0 2px var(--line); transition: all 0.2s;
}
.cat-btn .c-ico { font-size: 20px; transition: transform 0.3s; }
.cat-btn.on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 18px -8px var(--primary); }
.cat-btn.on .c-ico { transform: rotate(-15deg) scale(1.2); }
.pos-search { margin-bottom: 12px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.prod {
  position: relative; border: 0; text-align: left; cursor: pointer; background: var(--card); border-radius: 20px; padding: 14px 14px 12px;
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform 0.18s cubic-bezier(.3,1.6,.5,1), box-shadow 0.2s;
  overflow: hidden; animation: pop-in 0.4s both; display: flex; flex-direction: column; gap: 4px; min-height: 128px;
}
.prod:hover { transform: translateY(-3px) rotate(-0.6deg); }
.prod:active { transform: scale(0.95); }
.prod .p-disc {
  width: 46px; height: 46px; border-radius: 50%; margin-bottom: 4px; position: relative; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--pc, var(--accent)) 58%, var(--crust) 60%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform 0.6s;
}
.prod:hover .p-disc { transform: rotate(160deg); }
.prod .p-disc::before, .prod .p-disc::after {
  content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); top: 12px; left: 12px; box-shadow: 14px 6px 0 var(--primary), 4px 16px 0 var(--leaf);
}
.prod .p-emoji { font-size: 36px; line-height: 1; margin-bottom: 4px; }
.prod .p-name { font-weight: 800; line-height: 1.15; }
.prod .p-desc { font-size: 0.76em; color: var(--ink-soft); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .p-price { margin-top: auto; font-weight: 900; color: var(--primary); font-family: 'Fredoka', sans-serif; font-size: 1.05em; }
.prod.flash::after { content: ''; position: absolute; inset: 0; background: var(--accent); opacity: 0; animation: flash 0.5s; }

.cart { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); padding: 0; overflow: hidden; }
.cart-head { padding: 14px 16px 10px; border-bottom: 1px dashed var(--line); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 12px; min-height: 120px; }
.cart-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; border-bottom: 1px dashed var(--line);
  animation: slide-in 0.3s both;
}
.cart-item .ci-name { font-weight: 800; line-height: 1.2; }
.cart-item .ci-sub { font-size: 0.8em; color: var(--ink-soft); }
.cart-item .ci-price { font-weight: 900; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border-radius: 10px; padding: 2px; }
.qty button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--card); cursor: pointer; font-weight: 900; }
.qty span { min-width: 22px; text-align: center; font-weight: 900; }
.cart-foot { padding: 12px 16px 16px; border-top: 2px dashed var(--line); background: var(--bg-2); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-family: 'Fredoka', sans-serif; font-size: 1.7em; font-weight: 700; margin: 6px 0 10px; }
.cart-total b { color: var(--primary); }
.cart-line { display: flex; justify-content: space-between; font-size: 0.9em; color: var(--ink-soft); }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 30px 10px; }
.cart-empty .pizza-spin { display: inline-block; animation: spin 10s linear infinite; }
.cart-fab { display: none; }
.close-cart { display: none !important; }
@media (max-width: 900px) { .close-cart { display: inline-grid !important; } }
.type-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.type-seg button {
  border: 0; border-radius: 12px; padding: 8px 2px; background: var(--card); cursor: pointer; font-weight: 800; font-size: 0.78em;
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 2px var(--line); transition: all 0.2s;
}
.type-seg button span { font-size: 20px; }
.type-seg button.on { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); }

@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .cart { position: fixed; inset: auto 0 0 0; top: 0; z-index: 40; border-radius: 0; max-height: none; transform: translateY(105%); transition: transform 0.35s cubic-bezier(.2,.9,.3,1); }
  .cart.open { transform: none; }
  .cart-fab {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 35; align-items: center; justify-content: space-between;
    background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 18px; padding: 14px 18px; font-weight: 900; font-size: 1.05em;
    box-shadow: 0 12px 26px -10px var(--primary); cursor: pointer; animation: rise 0.4s both;
  }
  .cart-fab .cf-count { background: var(--primary-ink); color: var(--primary); border-radius: 999px; padding: 0 9px; margin-right: 8px; }
}

/* Selector de variantes / mitades */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.opt {
  border: 0; border-radius: 14px; padding: 12px; background: var(--bg-2); cursor: pointer; text-align: left; font-weight: 800;
  box-shadow: inset 0 0 0 2px transparent; transition: all 0.15s;
}
.opt small { display: block; font-weight: 700; color: var(--ink-soft); }
.opt.on { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); }
.half-preview { display: flex; align-items: center; gap: 14px; background: var(--bg-2); padding: 12px; border-radius: 16px; margin: 10px 0; }
.half-pizza { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: flex; border: 5px solid var(--crust); flex: none; transition: transform 0.5s; }
.half-pizza div { flex: 1; transition: background 0.3s; }
.half-pizza div + div { border-left: 2px dashed rgba(0,0,0,.25); }
.opt-section { margin: 14px 0 8px; font-weight: 900; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

/* ---------- Cobro ---------- */
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-m {
  border: 0; border-radius: 16px; padding: 14px 6px; background: var(--bg-2); cursor: pointer; font-weight: 800; display: flex; flex-direction: column;
  align-items: center; gap: 4px; transition: all 0.18s; font-size: 0.9em;
}
.pay-m span { font-size: 28px; transition: transform 0.3s; }
.pay-m.on { background: var(--primary); color: var(--primary-ink); transform: translateY(-2px); box-shadow: 0 10px 20px -10px var(--primary); }
.pay-m.on span { transform: scale(1.15) rotate(-8deg); }
@media (max-width: 480px) { .pay-methods { grid-template-columns: repeat(2, 1fr); } }
.pay-total { text-align: center; margin: 4px 0 14px; }
.pay-total .pt-label { color: var(--ink-soft); font-weight: 800; }
.pay-total .pt-value { font-family: 'Fredoka', sans-serif; font-size: 2.6em; font-weight: 700; color: var(--primary); line-height: 1.1; }
.bills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.bills button { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--bg-2); cursor: pointer; font-weight: 800; }
.bills button:hover { background: var(--accent); color: var(--accent-ink); }
.change-box { text-align: center; border-radius: 18px; padding: 14px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); margin-top: 6px; }
.change-box.neg { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.change-box b { display: block; font-family: 'Fredoka', sans-serif; font-size: 2em; }
.bank-box { background: var(--bg-2); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.bank-box .bk-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bank-box .bk-row b { font-size: 1.05em; word-break: break-all; }
.qr-pay { display: grid; place-items: center; gap: 10px; text-align: center; }
.qr-pay .qr-frame { background: #fff; padding: 14px; border-radius: 20px; box-shadow: var(--shadow); position: relative; }
.qr-pay .qr-frame img, .qr-pay .qr-frame svg { width: 220px; height: 220px; display: block; object-fit: contain; }
.qr-pay .qr-frame::after { content: ''; position: absolute; left: 14px; right: 14px; height: 3px; background: var(--primary); top: 14px; border-radius: 3px; box-shadow: 0 0 12px var(--primary); animation: scan 2.2s ease-in-out infinite; }
.split-list .sp { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg-2); margin-bottom: 6px; font-weight: 700; }

/* ---------- Ticket (vista previa) ---------- */
.modal.ticket { max-width: 460px; }
.ticket-stage { background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 10px, var(--bg) 10px, var(--bg) 20px); border-radius: 16px; padding: 18px 0 26px; display: flex; justify-content: center; overflow-x: auto; }
.ticket-roll { filter: drop-shadow(0 12px 20px rgba(0,0,0,.25)); animation: print-out 0.9s cubic-bezier(.2,.8,.3,1) both; transform-origin: top; }
.ticket-roll .paper { position: relative; }
.ticket-roll .paper::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(-45deg, transparent 6px, #fff 0) 0 0 / 12px 8px, linear-gradient(45deg, transparent 6px, #fff 0) 0 0 / 12px 8px;
}

/* ==========================================================================
   PEDIDOS (tablero)
   ========================================================================== */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--bg-2); border-radius: 20px; padding: 12px; min-height: 200px; }
.col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 900; margin-bottom: 10px; padding: 2px 4px; }
.col-head .ch-count { background: var(--card); border-radius: 999px; padding: 1px 10px; }
.ocard {
  background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); border-left: 5px solid var(--primary);
  animation: pop-in 0.35s both; position: relative;
}
.ocard.late { border-left-color: var(--err); animation: pop-in 0.35s both, late-glow 1.6s ease-in-out infinite; }
.ocard .oc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ocard .oc-num { font-family: 'Fredoka', sans-serif; font-size: 1.4em; font-weight: 700; }
.ocard .oc-items { font-size: 0.9em; margin: 6px 0; }
.ocard .oc-items div { padding: 2px 0; }
.ocard .oc-note { background: color-mix(in srgb, var(--warn) 18%, transparent); border-radius: 8px; padding: 4px 8px; font-size: 0.82em; font-weight: 700; margin: 4px 0; }
.ocard .oc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; }
.steam { position: absolute; right: 14px; top: -6px; display: flex; gap: 3px; }
.steam i { width: 4px; height: 14px; border-radius: 4px; background: var(--ink-soft); opacity: 0; animation: steam 2s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: 0.4s; } .steam i:nth-child(3) { animation-delay: 0.8s; }
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .board.tabs .col { display: none; }
  .board.tabs .col.show { display: block; }
}
.board-tabs { display: none; }
@media (max-width: 900px) { .board-tabs { display: flex; margin-bottom: 12px; overflow-x: auto; } }

/* Pedidos de la carta online */
.web-inbox { border: 3px solid color-mix(in srgb, var(--leaf) 55%, transparent); animation: pop-in 0.35s both; }
.web-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.ocard.web { border-left-color: var(--leaf); margin-bottom: 0; }
.ocard.web.late { border-left-color: var(--err); }

/* ==========================================================================
   CARTA ONLINE (panel de la sucursal)
   ========================================================================== */
.carta-admin { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.carta-admin .ca-preview { position: sticky; top: 12px; }
@media (max-width: 1100px) { .carta-admin { grid-template-columns: minmax(0, 1fr); } .carta-admin .ca-preview { display: none; } }
.phone-frame {
  width: 100%; max-width: 380px; aspect-ratio: 9 / 18.5; margin: 0 auto; border-radius: 38px; padding: 12px;
  background: #1d1b19; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .55), inset 0 0 0 2px #3a3633;
}
.phone-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 28px; background: #fff; display: block; }
.modal .phone-frame { max-width: 360px; }
.carta-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-2); border-radius: 14px; padding: 10px 12px; font-weight: 800; word-break: break-all; }
.carta-link a { color: var(--primary); }
.slug-row { display: flex; align-items: stretch; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); background: var(--card); }
.slug-row span { padding: 10px 8px 10px 12px; color: var(--ink-soft); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.slug-row input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; background: transparent; }
.req-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.req-list li { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.req-list li.no { color: var(--ink-soft); }
.big-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--bg-2); font-weight: 900; font-size: 1.05em; }
.big-switch.on { background: color-mix(in srgb, var(--leaf) 20%, var(--card)); }
.switch { position: relative; width: 58px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.switch input:checked + i { background: var(--leaf); }
.switch input:checked + i::after { transform: translateX(26px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips button { border: 0; border-radius: 12px; padding: 8px 11px; font-weight: 800; cursor: pointer; background: var(--bg-2); min-width: 46px; }
.day-chips button.on { background: var(--primary); color: var(--primary-ink); }
.color-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.color-row label { display: grid; gap: 4px; font-weight: 800; font-size: .88em; }
.color-row input[type=color] { width: 100%; height: 46px; padding: 4px; border-radius: 12px; }
.carta-theme { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.carta-theme button { border: 0; cursor: pointer; border-radius: 16px; padding: 10px; font-weight: 800; text-align: left; box-shadow: inset 0 0 0 2px var(--line); transition: transform .2s; }
.carta-theme button:hover { transform: translateY(-2px); }
.carta-theme button.on { box-shadow: inset 0 0 0 3px var(--primary), 0 6px 16px -8px var(--primary); }
.carta-theme .sw { display: flex; gap: 3px; margin-bottom: 6px; }
.carta-theme .sw i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .1); }
.img-slot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-slot .img-prev { width: 96px; height: 72px; border-radius: 14px; background: var(--bg-2) center / cover no-repeat; display: grid; place-items: center; font-size: 28px; flex: none; }
.img-slot .img-prev.round { width: 72px; border-radius: 50%; }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--bg-2); display: grid; place-items: center; font-size: 22px; flex: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.qr-box { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-box .qr-frame { background: #fff; padding: 10px; border-radius: 16px; width: 200px; }
.qr-box .qr-frame svg, .qr-salon-frame svg, .qr-wrap svg { width: 100% !important; height: auto !important; max-width: 100%; display: block; }

/* Cobro con QR de Mercado Pago */
.mp-qr { display: grid; justify-items: center; gap: 10px; text-align: center; }
.mp-qr .qr-frame { background: #fff; padding: 12px; border-radius: 20px; width: min(280px, 78vw); box-shadow: 0 0 0 4px #00b1ea; position: relative; }
.mp-qr .qr-frame svg { width: 100%; height: auto; display: block; }
.mp-qr .qr-frame.done::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; font-weight: 900; color: #fff; background: rgba(45, 106, 79, .88); border-radius: 20px; animation: pop-in .3s both; }
.mp-qr .mp-amount { font-family: 'Fredoka', sans-serif; font-size: 2.2em; font-weight: 700; }
.mp-qr .mp-state { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.mp-qr .mp-state i { width: 12px; height: 12px; border-radius: 50%; background: #00b1ea; animation: pulse 1.2s ease-in-out infinite; }
.mp-badge { display: inline-flex; align-items: center; gap: 6px; background: #00b1ea; color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 900; font-size: .85em; }
.mp-go { background: #00b1ea !important; color: #fff !important; }

/* ==========================================================================
   Gráficos
   ========================================================================== */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i {
  display: block; width: 100%; max-width: 38px; border-radius: 10px 10px 4px 4px; background: linear-gradient(to top, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent)));
  transform-origin: bottom; animation: grow 0.8s cubic-bezier(.2,.9,.3,1.1) both; position: relative; min-height: 2px;
}
.bars .bar i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 3px 7px; border-radius: 8px; font-size: 0.75em; white-space: nowrap; font-style: normal; margin-bottom: 4px; }
.bars .bar span { font-size: 0.7em; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.hbars .hb { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 0.9em; }
.hbars .hb .hb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .hb .hb-track { background: var(--bg-2); border-radius: 999px; height: 12px; overflow: hidden; }
.hbars .hb .hb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform-origin: left; animation: grow-x 0.9s cubic-bezier(.2,.9,.3,1.1) both; }
.hbars .hb .hb-val { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .hbars .hb { grid-template-columns: 100px 1fr auto; } }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; animation: spin-in 0.9s cubic-bezier(.2,.9,.3,1.1) both; flex: none; }
.donut::after { content: ''; position: absolute; inset: 26%; background: var(--card); border-radius: 50%; }
.legend-list div { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-weight: 700; font-size: 0.9em; }
.legend-list i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.hero {
  border-radius: 26px; padding: 22px 24px; color: var(--primary-ink); position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--primary), var(--primary-2)); box-shadow: 0 18px 40px -18px var(--primary); margin-bottom: 16px;
}
.hero h1 { font-size: 1.7em; }
.hero p { margin: 6px 0 14px; opacity: 0.9; }
.hero .hero-pizza { position: absolute; right: -40px; top: -40px; opacity: 0.25; animation: spin 40s linear infinite; }
.hero .btn { background: var(--primary-ink); color: var(--primary); }
.hero .btn.ghost { background: transparent; color: var(--primary-ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary-ink) 50%, transparent); }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); margin-bottom: 8px; font-weight: 700; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.list-row:last-child { border-bottom: 0; }

/* Config */
.tabs-nav { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.tabs-nav button { flex: none; border: 0; background: var(--card); border-radius: 12px; padding: 9px 14px; font-weight: 800; cursor: pointer; box-shadow: inset 0 0 0 2px var(--line); }
.tabs-nav button.on { background: var(--primary); color: var(--primary-ink); box-shadow: none; }

/* Salón y mesas */
.salon-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.salon-head .tabs-nav { margin-bottom:6px; }
.salon-stats { display:flex; flex-wrap:wrap; gap:6px; }
.salon-layout { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:18px; }
.salon-map { min-height:520px; position:relative; overflow:auto; border:2px dashed var(--line); border-radius:18px; background:linear-gradient(135deg, var(--card), var(--bg-2)); }
.dining-table { position:absolute; left:calc(var(--x) * 1%); top:calc(var(--y) * 1%); width:132px; min-height:112px; transform:translate(-50%,-50%); border:2px solid var(--line); border-radius:18px; background:var(--card); color:var(--ink); cursor:pointer; padding:9px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; box-shadow:0 4px 12px rgba(55,35,18,.08); font:inherit; text-align:center; transition:transform .15s, box-shadow .15s; }
.dining-table:hover { box-shadow:0 8px 20px rgba(55,35,18,.16); }
.dining-table.round { border-radius:50%; width:124px; height:124px; }
.dining-table.libre span { color:var(--ink-soft); }
.dining-table.ocupada { border-color:var(--accent); border-width:3px; background:color-mix(in srgb, var(--accent) 18%, var(--card)); }
.dining-table.cuenta { border-color:var(--err); border-width:3px; background:color-mix(in srgb, var(--err) 12%, var(--card)); }
.dining-table.cuenta span { color:var(--err); }
.dining-table.listo { border-color:var(--ok); border-width:3px; background:color-mix(in srgb, var(--ok) 16%, var(--card)); animation:table-ready 1.6s ease-in-out infinite; }
.dining-table.listo span { color:var(--ok); }
@keyframes table-ready { 50% { box-shadow:0 0 0 6px color-mix(in srgb, var(--ok) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dining-table.listo { animation:none; } }
.dining-table b { font-size:24px; line-height:1; }
.dining-table span { font-size:12px; font-weight:900; }
.dining-table small, .dining-table i { font-size:11px; font-style:normal; color:var(--ink-soft); }
.dining-table em { font-style:normal; font-weight:900; color:var(--primary); }
.salon-map.list { min-height:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; padding:12px; }
.salon-map.list .dining-table { position:static; transform:none; width:auto; height:auto; min-height:120px; border-radius:16px; }
.salon-help ol { padding-left:20px; margin:0 0 8px; }
.salon-help li { margin:0 0 10px; font-size:.9em; }
.table-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.table-summary div { padding:10px; border-radius:12px; background:var(--bg-2); min-width:0; }
.table-summary span, .table-summary b { display:block; }
.table-summary span { font-size:.78em; color:var(--ink-soft); }
.table-summary b { font-size:1.05em; }
.table-summary b.due { color:var(--primary); font-size:1.25em; }
.table-summary .icon-btn.sm { width:26px; height:26px; font-size:13px; display:inline-grid; vertical-align:middle; }
.table-orders { display:flex; flex-direction:column; gap:8px; }
.tanda { border:2px solid var(--line); border-radius:14px; padding:10px 12px; background:var(--card); }
.tanda.ready { border-color:var(--ok); background:color-mix(in srgb, var(--ok) 8%, var(--card)); }
.tanda-head { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.tanda-head .grow { flex:1; }
.tanda-items { margin:6px 0 2px; font-size:.92em; line-height:1.45; }
.tanda-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tbl-total { display:flex; justify-content:space-between; align-items:baseline; margin-top:12px; padding-top:10px; border-top:2px dashed var(--line); font-weight:800; }
.tbl-total b { font-size:1.3em; color:var(--primary); }
.tbl-foot { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; width:100%; }
.salon-order-builder { display:flex; flex-direction:column; gap:10px; }
.salon-order-builder .pos-search input { width:100%; }
.salon-cat-tabs { display:flex; gap:6px; overflow-x:auto; padding-bottom:4px; }
.salon-prod-grid { max-height:42vh; overflow:auto; padding:2px; }
.prod { position:relative; }
.prod .prod-count { position:absolute; top:6px; right:6px; }
.badge.accent { background:var(--accent); color:var(--accent-ink); }
.badge.muted { background:var(--bg-2); color:var(--ink-soft); }
.salon-batch-tray { padding:12px; }
.salon-batch-items { display:flex; flex-direction:column; gap:6px; margin:8px 0; max-height:24vh; overflow:auto; }
.tray-line { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--line); }
.tray-line .grow { flex:1; min-width:0; }
.tray-line small { display:block; }
.batch-total strong { font-size:1.2em; color:var(--primary); }
.guests-quick button { min-width:44px; }
@media (max-width: 900px) {
  .salon-layout { grid-template-columns:1fr; }
  .salon-help { display:none; }
}
@media (max-width: 640px) {
  .salon-head { flex-direction:column; }
  .salon-map { min-height:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; padding:10px; }
  .salon-map .dining-table { position:static; transform:none; width:auto; height:auto; min-height:118px; border-radius:16px; }
  .table-summary { grid-template-columns:repeat(2,1fr); }
  .tbl-foot .btn { flex:1 1 auto; }
}

/* Mitad y mitad: con qué pizzas combina (editor de producto) */
.half-opt-wrap { margin:4px 0 12px; }
.half-help { margin:6px 0; }
.half-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:6px; max-height:220px; overflow:auto; padding:8px; border:2px solid var(--line); border-radius:12px; background:var(--bg); }
.half-grid .check { margin:0; font-weight:600; font-size:.9em; }
.half-grid .check small { color:var(--err); font-weight:600; }

/* Ojito para ver la contraseña */
.pw-wrap { position:relative; display:block; width:100%; }
.pw-wrap > input { padding-right:46px; }
.pw-eye { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:36px; height:36px; border:0; border-radius:10px; background:transparent; color:var(--ink-soft); cursor:pointer; display:grid; place-items:center; }
.pw-eye:hover, .pw-eye:focus-visible { background:var(--bg-2); color:var(--ink); outline:none; }
.pw-eye svg { width:20px; height:20px; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-card { border: 0; cursor: pointer; border-radius: 18px; padding: 14px; text-align: left; font-weight: 800; box-shadow: inset 0 0 0 2px var(--line); background: var(--card); transition: transform 0.2s; }
.theme-card:hover { transform: translateY(-3px); }
.theme-card.on { box-shadow: inset 0 0 0 3px var(--primary); }
.theme-card .sw { display: flex; gap: 4px; margin-bottom: 8px; }
.theme-card .sw i { width: 26px; height: 26px; border-radius: 50%; display: block; border: 2px solid rgba(0,0,0,.08); }
.logo-preview { width: 90px; height: 90px; border-radius: 16px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; }

/* ==========================================================================
   Modal y toasts
   ========================================================================== */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 10, 5, 0.5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center;
  padding: 16px; opacity: 0; transition: opacity 0.2s;
}
.modal-back.show { opacity: 1; }
.modal {
  background: var(--card); border-radius: 26px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); transform: translateY(20px) scale(0.96); transition: transform 0.3s cubic-bezier(.2,.9,.3,1.25);
}
.modal-back.show .modal { transform: none; }
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.modal-head h3 { font-size: 1.3em; }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.confirm-msg { font-size: 1.05em; line-height: 1.45; margin: 0; }
@media (max-width: 600px) {
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 26px 26px 0 0; max-height: 94vh; transform: translateY(100%); }
  .modal-foot .btn { flex: 1; }
}

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 800;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); transform: translateY(-30px) scale(0.9); opacity: 0; transition: all 0.35s cubic-bezier(.2,.9,.3,1.4);
}
.toast.show { transform: none; opacity: 1; }
.toast-ico { font-size: 1.2em; display: inline-block; animation: spin 2s linear infinite; }
.toast-err { background: var(--err); color: #fff; }

/* Confeti */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.cf { position: absolute; top: -30px; width: 16px; height: 16px; border-radius: 50%; animation: fall linear forwards; }
.cf-pep { background: radial-gradient(circle at 35% 35%, #ff7b7b, #c1121f 65%); }
.cf-basil { background: #2d6a4f; border-radius: 70% 0 70% 0; width: 18px; height: 12px; }
.cf-olive { background: radial-gradient(circle, transparent 30%, #222 32%); }
.cf-cheese { background: #ffd166; border-radius: 30% 60% 40% 70%; width: 20px; height: 12px; }
.cf-tomato { background: radial-gradient(circle, #ffb3b3 20%, #e63946 22%); width: 20px; height: 20px; }

/* Loader de pizza */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 500; transition: opacity 0.4s; }
.boot svg { animation: spin 1.4s cubic-bezier(.6,.1,.4,.9) infinite; }

/* ==========================================================================
   Animaciones
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-in { from { transform: rotate(-120deg) scale(0.6); opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(0.95); } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(6deg); } }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.75); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes flash { 0% { opacity: 0.6; } 100% { opacity: 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes drip { 0%, 100% { transform: scaleY(0.6); } 50% { transform: scaleY(1.35); } }
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 0.55; }
  90% { opacity: 0.55; }
  100% { transform: translateY(-115vh) rotate(540deg); opacity: 0; }
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0.9; }
}
@keyframes steam { 0% { opacity: 0; transform: translateY(6px) scaleY(0.6); } 40% { opacity: 0.45; } 100% { opacity: 0; transform: translateY(-14px) scaleY(1.2); } }
@keyframes late-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--err) 30%, transparent); } }
@keyframes scan { 0%, 100% { top: 14px; } 50% { top: calc(100% - 17px); } }
@keyframes print-out { from { clip-path: inset(0 0 100% 0); transform: translateY(-20px); } to { clip-path: inset(0 0 -20px 0); transform: none; } }

[data-motion='off'] *, [data-motion='off'] *::before, [data-motion='off'] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Fotos de productos (link o archivo). Se recortan para llenar cada lugar
   (tarjeta, miniatura, encabezado). Sin foto, o si el link no carga,
   queda el ícono de siempre.
   ========================================================================== */
.pz-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pz-img + .pz-img-fb { display: none; }
.pz-img-fb { display: contents; }
/* tarjeta del punto de venta y del salón: la foto ocupa la parte de arriba */
.prod .p-photo { margin: -14px -14px 6px; height: 104px; overflow: hidden; background: var(--bg-2); flex: none; }
.prod .p-photo.pz-img-broken { margin: 0 0 4px; height: auto; background: none; overflow: visible; }
.prod.has-photo:hover .p-photo .pz-img { transform: scale(1.04); }
.prod .p-photo .pz-img { transition: transform .4s; }
.prod .prod-count { z-index: 1; }
/* miniatura en listas */
.p-thumb { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--bg-2); vertical-align: middle; }
.p-thumb.pz-img-broken { background: none; }
/* encabezado de la ventana del producto */
.pm-photo { margin: -4px 0 12px; height: 170px; border-radius: 16px; overflow: hidden; background: var(--bg-2); }
.pm-photo.pz-img-broken { display: none; }
/* carta del salón (vista previa e impresión) */
.carta-thumb { float: left; flex: none; width: 48px; height: 48px; margin: 0 10px 2px 0; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.carta-thumb.pz-img-broken { display: none; }
/* editor de la foto */
.photo-edit { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: start; }
.photo-edit .photo-prev { width: 132px; height: 99px; border-radius: 14px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; font-size: 34px; border: 2px dashed var(--line); }
.photo-edit .photo-prev.ok { border-style: solid; }
.photo-edit .photo-hint { display: block; margin-top: 6px; }
.photo-edit .photo-hint.err { color: var(--err); font-weight: 700; }
@media (max-width: 520px) { .photo-edit { grid-template-columns: 1fr; } .photo-edit .photo-prev { width: 100%; height: 160px; } }

/* Editor de comprobantes (Configuración → Ticket e impresora) */
.lay-kinds { margin-top: 10px; }
.lay-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 10px; }
.lay-preview { order: -1; min-width: 0; }
.lay-controls { min-width: 0; }
@media (min-width: 900px) {
  .lay-grid { grid-template-columns: minmax(280px, 1fr) minmax(330px, 390px); }
  .lay-preview { order: 0; position: sticky; top: 12px; align-self: start; }
}

/* Panel de avisos (campana de la barra superior) */
.bell-btn { position: relative; }
.bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--card);
}
.bell-count.hidden { display: none; }
.nt-cats { margin-bottom: 8px; }
.nt-day { font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #8a7f78); margin: 14px 2px 6px; }
.nt-item {
  display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; color: inherit; font: inherit;
}
.nt-item:hover { background: var(--bg-2); }
.nt-item.unread { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.nt-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.nt-title { font-size: .98em; }
.nt-time { font-size: .76em; color: var(--muted, #8a7f78); white-space: nowrap; }
.nt-body { font-size: .86em; margin-top: 3px; opacity: .85; }
.nt-chip { display: inline-block; margin-top: 6px; font-size: .72em; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); }
