/* =====================================================================
   ROSA COPAL · Panel de la empresa
   Paleta: Negro Ciruela #180818 · Rosa Copal #C07870 · Rosa Palo #D89890
           Gris Rosa Humo #806060 · Rosa Champagne #E0A098 · Dorado #D8A068
   ===================================================================== */
:root {
  --ciruela: #180818;
  --ciruela-2: #261226;
  --ciruela-3: #3a1f36;
  --copal: #c07870;
  --copal-d: #a9625b;
  --palo: #d89890;
  --humo: #806060;
  --champ: #e0a098;
  --dorado: #d8a068;
  --dorado-d: #b9874f;
  --tint: #fbefec;
  --tint-2: #f6e6e2;
  --line: #ecdcd7;
  --line-2: #e2cdc7;
  --bg: #f8f3f1;
  --card: #ffffff;
  --text: #2a1626;
  --muted: #8a7076;
  --ok: #2f6b3f;   --ok-bg: #e6f0e8;
  --warn: #9a6412; --warn-bg: #fbebd3;
  --bad: #a12a2a;  --bad-bg: #f7dada;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 8, 24, .04), 0 10px 30px -12px rgba(24, 8, 24, .12);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  /* Degradados del manual de marca */
  --g-letras: linear-gradient(180deg, #E0A097 0%, #D8988F 30%, #C17871 70%, #A85859 100%);
  --g-letras-h: linear-gradient(90deg, #A85859 0%, #C17871 35%, #D8988F 70%, #E0A097 100%);
  --g-humo: linear-gradient(90deg, #372028, #604149, #806061, #9F7870, #C19089, #D1A099, #E0B1A1);
  --g-fondo: linear-gradient(165deg, #200818 0%, #190818 40%, #11000F 75%, #1c0a17 100%);
  --g-lum: linear-gradient(135deg, #F1C890 0%, #E8B878 30%, #D89F67 65%, #C89061 100%);
  --spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.2 16.8 11.1 24 12 16.8 12.9 12.9 16.8 12 24 11.1 16.8 7.2 12.9 0 12 7.2 11.1 11.1 7.2 12 0Z'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--serif); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--copal-d); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ arranque */
.boot { height: 100vh; display: grid; place-items: center; background: var(--ciruela); }
.boot-mark { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--dorado); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .5; } }

/* ------------------------------------------------------------ login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 20% 10%, #3a1a33 0%, var(--ciruela) 55%, #0e040e 100%); color: var(--palo);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border: 1px solid rgba(216, 160, 104, .22); border-radius: 50%; }
.auth-art::before { width: 620px; height: 620px; right: -220px; bottom: -220px; }
.auth-art::after { width: 420px; height: 420px; right: -120px; bottom: -120px; border-color: rgba(216, 160, 104, .12); }
.auth-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand img { width: 52px; height: 52px; }
.wordmark { font-family: var(--display); color: var(--dorado); letter-spacing: .18em; font-weight: 600; }
.auth-hero { position: relative; z-index: 1; max-width: 460px; }
.auth-hero .logo-big { width: 132px; height: 132px; margin-bottom: 28px; }
.auth-hero h1 { font-family: var(--display); color: #f3dcd3; font-weight: 500; font-size: 40px; line-height: 1.12; margin: 0 0 14px; letter-spacing: .03em; }
.auth-hero p { margin: 0; font-style: italic; color: var(--palo); font-size: 16px; }
.auth-foot { position: relative; z-index: 1; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(216, 152, 144, .6); font-family: var(--display); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .eyebrow { font-family: var(--display); color: var(--copal); letter-spacing: .2em; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.auth-card h2 { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 6px 0 6px; color: var(--ciruela); letter-spacing: .02em; }
.auth-card .lead { color: var(--muted); margin: 0 0 28px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn { width: 100%; height: 50px; font-size: 15px; margin-top: 8px; }
.auth-err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.auth-mobile-brand { display: none; }

/* ------------------------------------------------------------ estructura */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--ciruela) 0%, #120612 100%); color: var(--palo); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 20px; border-bottom: 1px solid rgba(216, 160, 104, .16); text-decoration: none; }
.side-brand img { width: 46px; height: 46px; flex: none; }
.side-brand .wordmark { font-size: 17px; display: block; }
.side-brand .tag { font-size: 11.5px; font-style: italic; color: rgba(216, 152, 144, .8); }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-group { font-family: var(--display); font-size: 10.5px; letter-spacing: .2em; color: rgba(216, 160, 104, .62); text-transform: uppercase; margin: 18px 12px 8px; font-weight: 600; }
.nav-group:first-child { margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #e6c3bc; text-decoration: none; font-size: 14.5px; margin: 2px 0; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(192, 120, 112, .32), rgba(192, 120, 112, .12)); color: #fff; box-shadow: inset 2px 0 0 var(--dorado); }
.nav a .badge { margin-left: auto; background: var(--copal); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.side-user { border-top: 1px solid rgba(216, 160, 104, .16); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--copal); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; color: #f3dcd3; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 12px; color: rgba(216, 152, 144, .75); }
.icon-btn { background: transparent; border: 0; color: inherit; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.side .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: rgba(248, 243, 241, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 16px 32px; }
.top h1 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0; color: var(--ciruela); letter-spacing: .03em; }
.top .sub { color: var(--muted); font-size: 13px; font-style: italic; }
.top .grow { flex: 1; }
.burger { display: none; }
.content { padding: 28px 32px 60px; max-width: 1480px; width: 100%; }

/* ------------------------------------------------------------ componentes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-family: var(--display); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin: 0; color: var(--ciruela); font-weight: 600; }
.card-h .grow { flex: 1; }
.card-h .hint { color: var(--muted); font-size: 12.5px; font-style: italic; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 20px; }

.kpi { position: relative; overflow: hidden; padding: 20px 22px; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--copal); }
.kpi.gold::after { background: var(--dorado); }
.kpi.dark::after { background: var(--ciruela); }
.kpi.humo::after { background: var(--humo); }
.kpi-label { font-family: var(--display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--humo); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--ciruela); margin-top: 6px; letter-spacing: -.01em; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi-sub b { color: var(--copal-d); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--copal); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .06s, background .15s, box-shadow .15s; font-size: 14.5px; }
.btn:hover { background: var(--copal-d); box-shadow: 0 6px 16px -8px rgba(169, 98, 91, .8); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.dark { background: var(--ciruela); color: var(--dorado); }
.btn.dark:hover { background: var(--ciruela-3); }
.btn.ghost { background: #fff; color: var(--ciruela); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--tint); box-shadow: none; }
.btn.danger { background: #fff; color: var(--bad); border-color: #efc9c9; }
.btn.danger:hover { background: var(--bad-bg); box-shadow: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; padding: 0 24px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--copal-d); cursor: pointer; padding: 0; font-weight: 600; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { color: var(--humo); width: 32px; height: 32px; }
.row-actions .icon-btn:hover { background: var(--tint); color: var(--copal-d); }
.row-actions .icon-btn.del:hover { background: var(--bad-bg); color: var(--bad); }

.field label, .lbl { display: block; font-family: var(--display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--humo); margin-bottom: 6px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; font-style: italic; }
.input, select.input, textarea.input { width: 100%; height: 44px; border: 1px solid var(--line-2); background: #fff; border-radius: 11px; padding: 0 13px; outline: none; transition: border .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--copal); box-shadow: 0 0 0 4px rgba(192, 120, 112, .16); }
.input.in { background: var(--tint); }
.input[readonly] { background: #faf6f5; color: var(--muted); }
.input.sm { height: 36px; border-radius: 9px; padding: 0 10px; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: var(--tint-2); padding: 5px; border-radius: 14px; }
.seg button { border: 0; background: transparent; height: 38px; padding: 0 16px; border-radius: 10px; cursor: pointer; color: var(--humo); font-weight: 600; font-size: 14px; }
.seg button.on { background: #fff; color: var(--ciruela); box-shadow: 0 1px 3px rgba(24, 8, 24, .12); }
.seg.dark button.on { background: var(--ciruela); color: var(--dorado); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: #fff; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--humo); }
.chip.on { background: var(--ciruela); color: var(--dorado); border-color: var(--ciruela); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bajo { background: var(--warn-bg); color: var(--warn); }
.pill.agotado { background: var(--bad-bg); color: var(--bad); }
.pill.Insumo { background: #f6e3df; color: var(--copal-d); }
.pill.Empaque { background: #f7ebdd; color: #8a5a1e; }
.pill.Extra { background: #efe6e6; color: var(--humo); }
.pill.entrada { background: var(--ok-bg); color: var(--ok); }
.pill.salida { background: var(--bad-bg); color: var(--bad); }
.pill.produccion { background: #f7ebdd; color: #8a5a1e; }
.pill.uso_produccion { background: #efe6e6; color: var(--humo); }
.pill.venta { background: #f3e4f0; color: #6b3260; }
.pill.receta { background: var(--ok-bg); color: var(--ok); }
.pill.manual { background: #efe6e6; color: var(--humo); }
.pill.admin { background: var(--ciruela); color: var(--dorado); }
.pill.staff { background: var(--tint-2); color: var(--copal-d); }
.pill.postre { background: #f6e3df; color: var(--copal-d); }
.pill.bebida { background: #e9e3f0; color: #5b4a7a; }

.table-wrap { overflow-x: auto; margin: 0 -22px -22px; border-top: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { font-family: var(--display); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--humo); font-weight: 600; text-align: left;
  padding: 12px 14px; background: #fcf8f7; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 12px 14px; border-bottom: 1px solid #f3e8e5; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fdf8f7; }
table.t th:first-child, table.t td:first-child { padding-left: 22px; }
table.t th:last-child, table.t td:last-child { padding-right: 22px; }
table.t .code { font-weight: 700; color: var(--ciruela); white-space: nowrap; }
table.t .sub { display: block; font-size: 12px; color: var(--muted); }
table.t tfoot td { background: var(--ciruela); color: var(--dorado); font-weight: 700; border: 0; }
.neg { color: var(--bad) !important; }
.pos { color: var(--ok); }
.bar { height: 6px; border-radius: 6px; background: var(--tint-2); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--champ), var(--copal)); border-radius: 6px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 50%; background: var(--tint); color: var(--copal); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h4 { font-family: var(--display); color: var(--ciruela); margin: 0 0 6px; font-weight: 600; letter-spacing: .04em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--tint); border: 1px solid #f1d9d3; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ciruela); }
.notice.warn { background: var(--warn-bg); border-color: #f0d9b5; color: #6e470c; }
.notice.bad { background: var(--bad-bg); border-color: #efc4c4; color: var(--bad); }
.notice svg { margin-top: 1px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f3e8e5; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-weight: 600; }

/* ------------------------------------------------------------ tablero */
.hello { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello h2 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 0; color: var(--ciruela); letter-spacing: .02em; }
.hello p { margin: 2px 0 0; color: var(--muted); font-style: italic; }
.hello .grow { flex: 1; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { margin: 10px 0 14px; }
.hbar .top-l { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; gap: 10px; }
.hbar .track { height: 10px; background: var(--tint-2); border-radius: 8px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--palo), var(--copal)); }
.corte { display: grid; gap: 12px; }
.corte .c { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--tint); border-radius: 12px; }
.corte .c .v { font-size: 20px; font-weight: 700; color: var(--ciruela); }
.corte .c .l { font-family: var(--display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--humo); font-weight: 600; }

/* ------------------------------------------------------------ nueva venta */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.sale .cart { position: sticky; top: 92px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tile { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; cursor: pointer; transition: border .15s, transform .08s, box-shadow .15s; position: relative; min-height: 112px; display: flex; flex-direction: column; }
.tile:hover { border-color: var(--palo); box-shadow: 0 8px 20px -14px rgba(192, 120, 112, .9); }
.tile:active { transform: scale(.98); }
.tile .tc { font-size: 11px; font-weight: 700; color: var(--copal); letter-spacing: .06em; }
.tile .tn { font-weight: 600; color: var(--ciruela); margin: 3px 0 auto; line-height: 1.25; }
.tile .tp { font-size: 18px; font-weight: 700; color: var(--ciruela); margin-top: 10px; }
.tile .tq { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--ciruela); color: var(--dorado); font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 7px; }
.tile.in { border-color: var(--copal); background: linear-gradient(180deg, #fff, var(--tint)); }
.cart-lines { margin: 4px -4px 0; }
.cl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 4px; border-bottom: 1px dashed var(--line-2); }
.cl .n { font-weight: 600; color: var(--ciruela); }
.cl .n small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cl .t { font-weight: 700; text-align: right; }
.cl .ctrls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper button { width: 32px; height: 32px; border: 0; background: #fff; cursor: pointer; color: var(--ciruela); font-size: 18px; }
.stepper button:hover { background: var(--tint); }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; }
.price-in { width: 98px; }
.sum { margin-top: 14px; display: grid; gap: 8px; }
.sum .r { display: flex; justify-content: space-between; font-size: 14px; }
.sum .r.total { font-size: 20px; font-weight: 700; color: var(--ciruela); padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.sum .r.profit { background: var(--ciruela); color: var(--dorado); padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 16px; }
.cart-title { display: flex; align-items: baseline; justify-content: space-between; }
.cart-title h3 { font-family: var(--display); font-size: 18px; margin: 0; color: var(--ciruela); letter-spacing: .04em; }

/* ------------------------------------------------------------ inventario / cremas */
.prep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.prep { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.prep .ph { padding: 18px 20px 12px; display: flex; gap: 10px; align-items: flex-start; }
.prep .ph .grow { flex: 1; min-width: 0; }
.prep .ph h4 { margin: 0; font-size: 16.5px; color: var(--ciruela); }
.prep .ph .code { font-size: 12px; color: var(--copal); font-weight: 700; }
.prep .pb { padding: 0 20px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prep .pb .lbl { margin: 0; font-size: 10px; }
.prep .pb .v { font-weight: 700; color: var(--ciruela); font-size: 17px; }
.prep .pf { margin-top: auto; border-top: 1px solid var(--line); display: flex; }
.prep .pf button { flex: 1; height: 44px; border: 0; background: #fff; cursor: pointer; color: var(--copal-d); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.prep .pf button + button { border-left: 1px solid var(--line); }
.prep .pf button:hover { background: var(--tint); }
.lines-table td { padding: 8px 6px !important; }
.lines-table .input { height: 38px; }
.lines-foot { display: flex; justify-content: flex-end; gap: 28px; padding: 14px 4px 0; flex-wrap: wrap; }
.lines-foot .k { font-family: var(--display); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--humo); font-weight: 600; }
.lines-foot .v { font-size: 20px; font-weight: 700; color: var(--ciruela); }
.preview { background: var(--tint); border-radius: 14px; padding: 16px 18px; display: grid; gap: 6px; font-size: 14px; }
.preview .big { font-size: 18px; font-weight: 700; color: var(--ciruela); }
.arrow { color: var(--dorado-d); font-weight: 700; padding: 0 6px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { flex: 1; min-width: 180px; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; transition: border .15s, background .15s; }
.tab .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--copal); flex: none; }
.tab b { display: block; color: var(--ciruela); font-size: 15px; }
.tab span { font-size: 12.5px; color: var(--muted); }
.tab.on { border-color: var(--ciruela); background: var(--ciruela); }
.tab.on b { color: var(--dorado); }
.tab.on span { color: var(--palo); }
.tab.on .ti { background: rgba(216, 160, 104, .16); color: var(--dorado); }
.app-card .big { font-size: 26px; font-weight: 700; color: var(--ciruela); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 42px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--copal); }
.switch input:checked + i::after { left: 21px; }

/* ------------------------------------------------------------ modal y avisos */
.modal-back { position: fixed; inset: 0; background: rgba(24, 8, 24, .45); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(24, 8, 24, .45); animation: rise .18s ease-out; }
.modal.wide { max-width: 920px; }
.modal-h { padding: 20px 24px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-family: var(--display); font-size: 18px; color: var(--ciruela); letter-spacing: .04em; flex: 1; }
.modal-b { padding: 20px 24px; overflow-y: auto; }
.modal-f { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-f .grow { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: grid; gap: 10px; }
.toast { background: var(--ciruela); color: #f3dcd3; padding: 13px 18px; border-radius: 14px; box-shadow: 0 16px 40px -14px rgba(24, 8, 24, .6); display: flex; gap: 10px; align-items: center; animation: rise .2s; max-width: 380px; border-left: 3px solid var(--dorado); }
.toast.err { border-left-color: #ff8f8f; }
.loading { padding: 60px; text-align: center; color: var(--muted); font-style: italic; }
.help-sec h3 { font-family: var(--display); color: var(--copal); font-size: 15px; letter-spacing: .08em; margin: 0 0 10px; }
.help-sec ol, .help-sec ul { margin: 0; padding-left: 20px; }
.help-sec li { margin: 6px 0; }
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.flow div { background: var(--ciruela); color: var(--palo); border-radius: 14px; padding: 14px; font-size: 13px; }
.flow b { display: block; font-family: var(--display); color: var(--dorado); letter-spacing: .1em; font-size: 12px; margin-bottom: 4px; }

/* ------------------------------------------------------------ móvil */
.scrim { display: none; }
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sale { grid-template-columns: 1fr; }
  .sale .cart { position: static; }
}
@media (max-width: 920px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; text-align: center; }
  .auth-mobile-brand img { width: 84px; height: 84px; }
  .auth-form { background: radial-gradient(120% 60% at 50% 0%, #fbeae6 0%, var(--bg) 60%); }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .22s ease; }
  body.nav-open .side { transform: none; box-shadow: 20px 0 60px -20px rgba(0, 0, 0, .5); }
  .toolbar .search { flex-basis: 100%; }
  .mbar.show { display: flex; }
  .sale .cart { scroll-margin-top: 70px; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(24, 8, 24, .4); z-index: 35; }
  .burger { display: grid; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 18px; }
  .top .sub { display: none; }
  .content { padding: 18px 14px 90px; }
  .g2, .g3, .g-21 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .form-grid > * { grid-column: span 12 !important; }
  .form-grid > .m6 { grid-column: span 6 !important; }
  .kpi-value { font-size: 22px; }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 22px 22px 0 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .hide-m { display: none !important; }
}
.chart text { font-family: var(--serif); font-size: 11px; fill: #8a7076; }
.toolbar .field { margin: 0; }

.mbar { display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; background: var(--ciruela); color: #f3dcd3; border-radius: 16px; padding: 10px 10px 10px 16px;
  align-items: center; gap: 12px; box-shadow: 0 18px 40px -14px rgba(24, 8, 24, .7); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.mbar b { color: var(--dorado); font-size: 18px; }
.mbar .grow { flex: 1; }
.mbar .btn { height: 42px; }
td.nowrap .sub, .nowrap .sub { white-space: nowrap; }

/* =====================================================================
   IDENTIDAD ROSA COPAL (logo, degradados, estrellas y luna)
   ===================================================================== */
.boot { background: var(--g-fondo); }
.boot-logo { width: 220px; max-width: 60vw; animation: pulse 1.6s ease-in-out infinite; }
.spark { display: inline-block; width: 12px; height: 12px; background: var(--g-lum); -webkit-mask: var(--spark) center / contain no-repeat; mask: var(--spark) center / contain no-repeat; flex: none; }

/* login */
.auth-art { background: radial-gradient(70% 55% at 50% 42%, rgba(128, 96, 97, .28) 0%, rgba(55, 32, 40, .18) 45%, transparent 75%), var(--g-fondo); align-items: center; text-align: center; justify-content: center; gap: 0; }
.auth-art::before, .auth-art::after { content: none; }
.auth-art .deco { position: absolute; inset: 0; pointer-events: none; }
.auth-art .deco .spark { position: absolute; opacity: .9; }
.auth-art .deco .moon { position: absolute; right: 13%; top: 11%; width: 46px; }
.auth-hero { max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.auth-hero .logo-hero { width: min(440px, 72%); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); margin-bottom: 26px; }
.auth-hero .kicker { font-family: var(--display); letter-spacing: .32em; color: var(--dorado); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 14px; }
.auth-hero .kicker::before, .auth-hero .kicker::after { content: ""; width: 38px; height: 1px; background: linear-gradient(90deg, transparent, #D89F67); }
.auth-hero .kicker::after { transform: scaleX(-1); }
.auth-hero p { margin-top: 12px; }
.auth-foot { position: absolute; bottom: 36px; left: 0; right: 0; }
.auth-card h2 { background: var(--g-letras-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card .btn.dark { background: var(--g-fondo); }
.auth-mobile-brand img { width: 230px; height: auto; }

/* menú lateral */
.side { background: radial-gradient(120% 40% at 50% 0%, rgba(128, 96, 97, .22), transparent 70%), var(--g-fondo); }
.side-brand { flex-direction: column; gap: 6px; padding: 22px 22px 18px; align-items: center; }
.side-brand img { width: 150px; height: auto; }
.side-brand .tag { font-family: var(--display); font-style: normal; font-size: 10.5px; letter-spacing: .26em; color: var(--dorado); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.side-brand .tag .spark { width: 8px; height: 8px; }
.nav a.active { background: linear-gradient(90deg, rgba(193, 120, 113, .34), rgba(193, 120, 113, .08)); box-shadow: inset 2px 0 0 #E8B878; }
.nav a .badge { background: var(--g-letras); }
.avatar { background: var(--g-letras); }

/* componentes */
.btn { background: linear-gradient(180deg, #C98079 0%, #A85859 100%); }
.btn:hover { background: linear-gradient(180deg, #C17871 0%, #964c4d 100%); }
.btn.dark { background: var(--g-fondo); color: #E8B878; }
.btn.dark:hover { background: linear-gradient(165deg, #372028, #190818); }
.btn.ghost, .btn.danger { background: #fff; }
.btn.ghost:hover { background: var(--tint); }
.kpi::after { background: var(--g-letras); width: 4px; }
.kpi.gold::after { background: var(--g-lum); }
.kpi.dark::after { background: var(--g-fondo); }
.kpi.humo::after { background: linear-gradient(180deg, #9F7870, #604149); }
.card-h h3 { display: inline-flex; align-items: center; gap: 9px; }
.card-h h3::before { content: ""; width: 11px; height: 11px; background: var(--g-lum); -webkit-mask: var(--spark) center / contain no-repeat; mask: var(--spark) center / contain no-repeat; }
.hello h2 { background: var(--g-letras-h); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.top h1 { display: flex; align-items: center; gap: 10px; }
.hbar .track i, .bar > i { background: var(--g-letras-h); }
.toast { background: var(--g-fondo); border-left: 3px solid #E8B878; }
.sum .r.profit, table.t tfoot td { background: var(--g-fondo); color: #E8B878; }
.tab.on, .chip.on, .seg.dark button.on { background: var(--g-fondo); }
.tab.on b, .chip.on, .seg.dark button.on { color: #E8B878; }
.tile .tq { background: var(--g-fondo); color: #E8B878; }
.tile.in { border-color: #C17871; }
.empty .ico { background: var(--tint); }
.corte .c { background: linear-gradient(135deg, #fbefec, #f6e3df); }
.flow div { background: var(--g-fondo); }
.flow b { color: #E8B878; }
.mbar { background: var(--g-fondo); }
.mbar b { color: #E8B878; }
@media (max-width: 920px) {
  .auth-form { background: radial-gradient(120% 55% at 50% 0%, #fbe9e4 0%, var(--bg) 62%); }
}

/* ------------------------------------------------------------ fotos y menú */
.thumb { display: inline-grid; place-items: center; border-radius: 11px; overflow: hidden; background: var(--g-fondo); flex: none; vertical-align: middle; box-shadow: 0 0 0 1px rgba(24, 8, 24, .06); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .spark { width: 38%; height: 38%; opacity: .8; }
.pcell { display: flex; align-items: center; gap: 12px; }
.rank { font-family: var(--display); font-size: 12px; color: var(--dorado-d); font-weight: 700; margin-right: 4px; }
.tile { padding: 0 0 14px; overflow: hidden; }
.tile .timg { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--g-fondo); margin-bottom: 10px; overflow: hidden; }
.tile .timg img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover .timg img { transform: scale(1.04); }
.tile .timg .spark { width: 26px; height: 26px; opacity: .75; }
.tile .tc, .tile .tn, .tile .tp { padding: 0 14px; }
.tile .tq { z-index: 2; top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.photo-pick { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ph-prev { width: 128px; height: 128px; border-radius: 18px; overflow: hidden; background: var(--g-fondo); display: grid; place-items: center; flex: none; box-shadow: var(--shadow); }
.ph-prev img { width: 100%; height: 100%; object-fit: cover; }
.ph-empty { color: var(--palo); display: grid; justify-items: center; gap: 8px; font-size: 12.5px; font-style: italic; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ph-actions .help { flex-basis: 100%; font-size: 12px; color: var(--muted); font-style: italic; }
.ph-actions label.btn { cursor: pointer; }
.menu-hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 250px; display: flex; align-items: center; padding: 36px 40px;
  background: linear-gradient(90deg, rgba(17, 0, 15, .95) 0%, rgba(25, 8, 24, .82) 38%, rgba(25, 8, 24, .15) 75%, rgba(25, 8, 24, 0) 100%), url("/menu/portada.jpg") right center / cover no-repeat; box-shadow: var(--shadow); }
.menu-hero .kicker { font-family: var(--display); letter-spacing: .3em; color: #E8B878; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.menu-hero h2 { font-family: var(--display); font-size: 54px; margin: 6px 0 0; line-height: 1; background: linear-gradient(180deg, #F3C9C0 0%, #E0A097 40%, #C17871 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu-hero p { margin: 6px 0 0; color: #F1C890; font-style: italic; font-size: 18px; letter-spacing: .06em; }
.menu-hero .chip { background: rgba(255, 255, 255, .08); border-color: rgba(232, 184, 120, .35); color: #f3dcd3; }
.menu-hero .chip.on { background: var(--g-lum); color: var(--ciruela); border-color: transparent; font-weight: 700; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.mcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(24, 8, 24, .45); }
.mimg { aspect-ratio: 1 / 1; background: var(--g-fondo); position: relative; display: grid; place-items: center; overflow: hidden; }
.mimg img { width: 100%; height: 100%; object-fit: cover; }
.mimg .pill { position: absolute; top: 12px; left: 12px; }
.mcard.off .mimg img { filter: grayscale(.55) brightness(.85); }
.mbody { padding: 14px 16px 12px; }
.mbody .tc { font-size: 11px; font-weight: 700; color: var(--copal); letter-spacing: .06em; text-transform: uppercase; }
.mbody h4 { margin: 4px 0 10px; font-size: 17px; color: var(--ciruela); line-height: 1.25; }
.mrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mrow .price { font-size: 21px; font-weight: 700; color: var(--ciruela); }
.mcard .pf { margin-top: auto; border-top: 1px solid var(--line); display: flex; }
.mcard .pf button { flex: 1; height: 44px; border: 0; background: #fff; cursor: pointer; color: var(--copal-d); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; }
.mcard .pf button + button { border-left: 1px solid var(--line); }
.mcard .pf button:hover { background: var(--tint); }
@media (max-width: 920px) {
  .menu-hero { padding: 26px 22px; min-height: 210px; background: linear-gradient(180deg, rgba(17, 0, 15, .55), rgba(17, 0, 15, .92)), url("/menu/portada.jpg") center / cover no-repeat; }
  .menu-hero h2 { font-size: 40px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mbody h4 { font-size: 15px; }
  .mrow .price { font-size: 17px; }
  .mcard .pf button { font-size: 12px; }
}
.toasts { top: 22px; bottom: auto; pointer-events: none; }
@media (max-width: 920px) { .toasts { top: 12px; bottom: auto; } }
