:root {
  --bg: #0c0c0c;
  --bg-elev: #161616;
  --bg-panel: #1c1c1c;
  --line: #2a2a2a;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --brand: #c8102e;
  --brand-deep: #8f0b20;
  --ok: #2f9e6b;
  --warn: #d4a017;
  --busy: #c8102e;
  --free: #2f9e6b;
  --billing: #d4a017;
  --blocked: #555;
  --radius: 10px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Bebas Neue", Impact, sans-serif;
  --input-bg: #0e0e0e;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(200, 16, 46, 0.18), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
button.ghost { background: transparent; color: var(--muted); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

#app { min-height: 100vh; }

/* —— Login —— */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #1a1a1a, #121212);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.brand-mark {
  font-family: var(--display);
  font-size: 3rem;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0 0 0.25rem;
}
.brand-mark span { color: var(--brand); }
.login-card p.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field input {
  background: #0e0e0e;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  color: var(--text);
}
.field input:focus { outline: 2px solid rgba(200, 16, 46, 0.45); border-color: var(--brand); }
.login-error {
  background: rgba(200, 16, 46, 0.12);
  border: 1px solid rgba(200, 16, 46, 0.35);
  color: #ffb3bf;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.login-card button[type="submit"] { width: 100%; margin-top: 0.25rem; }
.hint { margin-top: 1rem; font-size: 0.75rem; color: #666; text-align: center; }

/* —— Shell —— */
.shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .logo {
  font-family: var(--display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
  margin: 0;
}
.topbar .logo span { color: var(--brand); }
.nav {
  display: flex;
  gap: 0.35rem;
  flex: 1;
}
.nav button {
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
}
.nav button.active {
  background: rgba(200, 16, 46, 0.15);
  color: #fff;
  border: 1px solid rgba(200, 16, 46, 0.35);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.shift-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.shift-pill.open { color: #8dffc0; border-color: rgba(47, 158, 107, 0.5); background: rgba(47, 158, 107, 0.12); }
.shift-pill.closed { color: #ffb3bf; border-color: rgba(200, 16, 46, 0.4); background: rgba(200, 16, 46, 0.1); }

.main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 960px) {
  .main.caja-layout { grid-template-columns: 1.1fr 0.9fr; }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.muted { color: var(--muted); font-size: 0.85rem; }

/* —— Mesas —— */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.table-card {
  aspect-ratio: 1.15;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.table-card:hover { transform: translateY(-2px); }
.table-card .name { font-weight: 700; font-size: 1.05rem; }
.table-card .meta { font-size: 0.75rem; color: var(--muted); }
.table-card .badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.table-card.free { border-color: rgba(47, 158, 107, 0.45); }
.table-card.free .badge { background: rgba(47, 158, 107, 0.2); color: #8dffc0; }
.table-card.occupied { border-color: rgba(200, 16, 46, 0.55); }
.table-card.occupied .badge { background: rgba(200, 16, 46, 0.2); color: #ffb3bf; }
.table-card.billing { border-color: rgba(212, 160, 23, 0.55); }
.table-card.billing .badge { background: rgba(212, 160, 23, 0.2); color: #ffe08a; }
.table-card.blocked { opacity: 0.55; }
.table-card.selected { outline: 2px solid var(--brand); }

/* Modo claro: mesas con contraste legible */
body.theme-light .table-card {
  background: #fff;
  border-width: 2px;
  box-shadow: 0 2px 10px rgba(40, 30, 20, 0.08);
  color: #1a1a1a;
}
body.theme-light .table-card .name { color: #1a1a1a; }
body.theme-light .table-card .meta { color: #5c564f; }
body.theme-light .table-card.free {
  border-color: #1f8a55;
  background: linear-gradient(180deg, #f3fbf6 0%, #fff 55%);
}
body.theme-light .table-card.free .badge {
  background: #1f8a55;
  color: #fff;
}
body.theme-light .table-card.occupied {
  border-color: #c8102e;
  background: linear-gradient(180deg, #fff5f6 0%, #fff 55%);
}
body.theme-light .table-card.occupied .badge {
  background: #c8102e;
  color: #fff;
}
body.theme-light .table-card.billing {
  border-color: #b8860b;
  background: linear-gradient(180deg, #fff8e8 0%, #fff 55%);
}
body.theme-light .table-card.billing .badge {
  background: #b8860b;
  color: #fff;
}
body.theme-light .table-card.selected {
  outline: 3px solid var(--brand);
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.2);
}
body.theme-light .panel {
  background: #fff;
  border-color: #ddd6ce;
  box-shadow: 0 1px 4px rgba(40, 30, 20, 0.04);
}
body.theme-light .product-btn {
  background: #fff;
  border-color: #d5cec6;
  color: #1a1a1a;
}
body.theme-light .sale-row {
  background: #fff;
  border-color: #ddd6ce;
}

/* —— Caja —— */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}
.product-btn {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: left;
  color: var(--text);
}
.product-btn:hover { border-color: rgba(200, 16, 46, 0.5); }
.product-btn .price { color: var(--brand); font-weight: 700; margin-top: 0.35rem; display: block; }

.cart-lines { display: grid; gap: 0.5rem; margin: 0.75rem 0; max-height: 320px; overflow: auto; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: var(--bg-elev);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.cart-line button.qty {
  background: #111;
  border: 1px solid var(--line);
  width: 2rem;
  padding: 0.25rem;
}
.totals {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}
.totals .row { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.25rem; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.actions button { flex: 1 1 120px; }

.sales-list { display: grid; gap: 0.45rem; }
.sale-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elev);
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #111;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  z-index: 50;
  max-width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  animation: rise 0.25s ease;
}
.toast.ok { border-color: rgba(47, 158, 107, 0.5); }
.toast.err { border-color: rgba(200, 16, 46, 0.5); }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.print-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: grid; place-items: center; z-index: 60; padding: 1rem;
}
.print-modal pre {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  max-width: 560px;
  width: 100%;
  max-height: 70vh;
  overflow: auto;
  font-size: 0.75rem;
  color: #cfcfcf;
}

.work-tip {
  margin: 0 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(200, 16, 46, 0.25);
  background: rgba(200, 16, 46, 0.08);
  font-size: 0.85rem;
  color: var(--muted);
}
.work-tip strong { color: var(--text); }

.pay-sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: grid; place-items: center; z-index: 70; padding: 1rem;
}
.pay-sheet-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  width: min(420px, 100%);
  display: grid;
  gap: 0.85rem;
}
.pay-sheet-card h3 { margin: 0; font-family: var(--display); font-size: 1.6rem; letter-spacing: 0.03em; }
.pay-total { font-size: 2rem; font-weight: 700; margin: 0; color: var(--brand); }
.pay-methods { display: grid; gap: 0.5rem; }
.pay-methods.inline { grid-template-columns: repeat(3, 1fr); }
.pay-opt, .pay-methods button {
  min-height: 3rem;
  font-size: 1.05rem;
}
.tip-inline { font-size: 0.8rem; margin: 0; }

#thermal-print-root {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: grid; place-items: center; z-index: 80; padding: 1rem;
  overflow: auto;
}
.thermal-receipt {
  width: 80mm;
  max-width: 100%;
  background: #fff;
  color: #111;
  padding: 12px 10px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}
.thermal-logo { display: block; max-height: 48px; margin: 0 auto 8px; }
.thermal-brand { text-align: center; font-weight: 700; font-size: 15px; }
.thermal-meta { text-align: center; font-size: 11px; }
.thermal-line { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0; }
.thermal-grand { font-weight: 700; font-size: 14px; margin-top: 4px; }
.thermal-thanks { text-align: center; margin-top: 10px; font-size: 11px; }
.thermal-receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.thermal-actions {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
  width: min(320px, 100%);
}

.empty-cta {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  background: var(--bg-elev);
}
.empty-cta h3 { margin: 0 0 0.35rem; }
.empty-cta p { color: var(--muted); margin: 0 0 1rem; }

.help-hero h2 { margin-top: 0; }
.help-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.help-num {
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}
.help-step h3 { margin: 0 0 0.35rem; }
.help-step p { margin: 0 0 0.75rem; color: var(--muted); }
.help-list { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.help-list li { margin: 0.35rem 0; }
.pay-quick { margin-top: 0.85rem; }
.alert-warn {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.12);
  color: #ffe08a;
  font-size: 0.88rem;
}

@media print {
  @page {
    size: 80mm auto;
    margin: 4mm;
  }
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  body.printing-ticket #app,
  body.printing-ticket .shell,
  body.printing-ticket .pay-sheet,
  body.printing-ticket .toast,
  body.printing-ticket .work-guide {
    display: none !important;
  }
  body.printing-ticket #thermal-print-root {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    overflow: visible !important;
    place-items: start !important;
  }
  body.printing-ticket .thermal-actions,
  body.printing-ticket .no-print {
    display: none !important;
  }
  body.printing-ticket .thermal-receipt {
    width: 72mm;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    page-break-after: avoid;
    page-break-inside: avoid;
  }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.panel-head h2 { margin: 0; }
.table-wrap { overflow: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}
.alert-warn {
  background: rgba(212, 160, 23, 0.12);
  border: 1px solid rgba(212, 160, 23, 0.35);
  color: #ffe08a;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.form-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
}
.form-grid label { display: grid; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.form-grid input, .form-grid select,
.inline-form input, .inline-form select,
.cart-panel select, .sale-row select, .panel select, .panel input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]) {
  background: var(--input-bg, var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  width: 100%;
  max-width: 100%;
}
.form-grid input[type="color"] {
  width: 3.5rem;
  height: 2.5rem;
  padding: 0.2rem;
  cursor: pointer;
}
.form-grid select option,
.panel select option {
  background: var(--bg-panel);
  color: var(--text);
}
body.theme-light {
  --bg: #f3f1ee;
  --bg-elev: #ffffff;
  --bg-panel: #ffffff;
  --line: #ddd6ce;
  --text: #1a1a1a;
  --muted: #6b6560;
  --input-bg: #ffffff;
}
body.theme-light .form-grid input,
body.theme-light .form-grid select,
body.theme-light .inline-form input,
body.theme-light .inline-form select,
body.theme-light .panel select,
body.theme-light .panel input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
body.theme-light .sale-row select {
  background: #fff;
  color: #1a1a1a;
  border-color: #cfc8c0;
}
body.theme-light .work-tip,
body.theme-light .work-guide {
  background: #fff5f6;
  border-color: #f0c4cb;
  color: #5a4a4c;
}
body.theme-light .work-tip strong,
body.theme-light .work-guide strong { color: #1a1a1a; }
body.theme-light .tenant-chip strong { color: #fff; }
body.theme-light .config-tabs button {
  color: #4a4540;
  background: #fff;
}
body.theme-light .alert-warn {
  color: #7a5a00;
  background: #fff4d6;
  border-color: #e6c76a;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  display: grid;
  gap: 0.35rem;
}
.stat strong { font-size: 1.15rem; }
.nav { flex-wrap: wrap; }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .user-chip { width: 100%; justify-content: space-between; }
}

.integ-grid { display: grid; gap: 1rem; }
.integ-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--bg-elev);
}
.integ-card.activa { border-color: rgba(47, 158, 107, 0.55); }
.integ-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.integ-header h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.integ-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: flex-start; }
.badge-activa { background: rgba(47, 158, 107, 0.18); color: #8dffc0; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 700; }
.badge-inactiva { background: rgba(200, 16, 46, 0.15); color: #ffb3bf; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 700; }
.badge-sandbox { background: rgba(212, 160, 23, 0.18); color: #ffe08a; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 700; }
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--text) !important;
  font-size: 0.9rem !important;
}
.check-row input { width: auto; }

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }

.tenant-chip {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 0.25rem;
  align-items: baseline;
  max-width: 200px;
}
.tenant-chip strong { color: #fff; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-config {
  border: 1px solid rgba(200, 16, 46, 0.45) !important;
  color: #fff !important;
  background: rgba(200, 16, 46, 0.12) !important;
}
.nav-config.active {
  background: rgba(200, 16, 46, 0.28) !important;
}
.main.config-layout {
  grid-template-columns: 220px 1fr;
  align-items: start;
}
@media (max-width: 900px) {
  .main.config-layout { grid-template-columns: 1fr; }
}
.config-side h2 { margin-top: 0; }
.config-tabs { display: grid; gap: 0.35rem; margin-top: 1rem; }
.config-tabs button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  padding: 0.65rem 0.85rem;
}
.config-tabs button.active {
  border-color: rgba(200, 16, 46, 0.5);
  color: #fff;
  background: rgba(200, 16, 46, 0.15);
}
.config-body { display: grid; gap: 1rem; }
.url-list { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.url-list div { display: grid; gap: 0.25rem; padding: 0.75rem; background: var(--bg-elev); border-radius: 8px; border: 1px solid var(--line); }
.url-list a, .url-list code { word-break: break-all; color: #ffb3bf; font-size: 0.85rem; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.chip.active-chip {
  border-color: var(--brand);
  background: rgba(200, 16, 46, 0.15);
  color: var(--text);
}
.menu-product-card { align-items: flex-start; }
.menu-product-main { display: flex; gap: 0.85rem; flex: 1; min-width: 0; }
.menu-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--bg);
}
.menu-thumb.placeholder {
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem;
}
.form-grid textarea {
  background: var(--input-bg, var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font: inherit;
  width: 100%;
  resize: vertical;
}
.menu-builder-list { display: grid; gap: 0.5rem; }
.menu-builder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.menu-builder-item .price-tag { color: var(--brand); white-space: nowrap; }
.brand-preview { transition: background 0.2s ease, color 0.2s ease; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.inline-form input { min-width: 180px; }

body.theme-light {
  background:
    radial-gradient(1000px 420px at 8% -8%, rgba(200, 16, 46, 0.08), transparent 55%),
    var(--bg);
}
body.theme-warm {
  --bg: #1a1410;
  --bg-elev: #241c16;
  --bg-panel: #2a2119;
  --line: #3d3228;
  --text: #f7efe6;
  --muted: #b5a89a;
  --input-bg: #241c16;
}
body.layout-compact .product-btn,
body.layout-compact .table-card {
  padding: 0.55rem 0.65rem;
  min-height: auto;
}
body.layout-touch .product-btn,
body.layout-touch .table-card,
body.layout-touch button {
  min-height: 3.25rem;
  font-size: 1.05rem;
  padding: 0.9rem 1.1rem;
}
body.layout-touch .nav button {
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
}

.work-guide {
  margin: 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(200, 16, 46, 0.28);
  background: rgba(200, 16, 46, 0.08);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
}
.work-guide-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.work-guide-icon svg { width: 34px; height: 34px; }
.work-guide-body h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}
.work-guide-body p {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.work-guide-body ol {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.45;
}
.work-guide-body li { margin: 0.15rem 0; }
.work-guide-dismiss {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .work-guide { grid-template-columns: 1fr; }
  .work-guide-dismiss { justify-self: start; }
}
