:root {
  --brand-brown: #8b624a;
  --brand-brown-dark: #5b3928;
  --brand-cream: #f2e1cc;
  --yellow: #8b624a;
  --yellow-dark: #5b3928;
  --yellow-soft: #f2e1cc;
  --ink: #33251d;
  --muted: #76665a;
  --surface: #ffffff;
  --surface-2: #fbf5ed;
  --line: #e5d2bd;
  --danger: #c93f3f;
  --success: #1f8f5f;
  --blue: #2767c7;
  --shadow: 0 18px 50px rgba(53, 42, 21, .10);
  --radius: 22px;
  --sidebar: 260px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-2); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(139,98,74,.14), transparent 30%),
    var(--surface-2);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(91,57,40,.96), rgba(176,139,105,.90)),
    radial-gradient(circle at 20% 10%, #fff, transparent 35%);
}
.login-card {
  width: min(100%, 510px);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 30px;
  padding: clamp(24px, 5vw, 42px);
  box-shadow: 0 30px 80px rgba(72,44,29,.24);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; overflow: hidden;
  border: 1px solid #ead9bd; box-shadow: 0 9px 18px rgba(75,47,24,.18);
  flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand strong { display: block; font-size: 18px; letter-spacing: .01em; }
.brand span { color: var(--muted); font-size: 12px; }
.brand-login { margin-bottom: 32px; }
.login-copy h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.05; margin: 8px 0 14px; }
.login-copy p:last-child { color: var(--muted); line-height: 1.6; }
.eyebrow { margin: 0; color: var(--yellow-dark); font-size: 11px; letter-spacing: .15em; font-weight: 800; }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 750; color: #514c45; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 14px; padding: 13px 14px; outline: none; transition: .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--yellow-dark); box-shadow: 0 0 0 4px rgba(139,98,74,.18); }
.demo-access { margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--yellow-soft); display: grid; gap: 3px; font-size: 12px; }

.btn {
  border: 0; border-radius: 14px; padding: 11px 15px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--yellow); color: #fff; box-shadow: 0 10px 22px rgba(91,57,40,.24); }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: #fde5e5; color: var(--danger); }
.btn-success { background: #dcf5e9; color: #14734a; }
.btn-large { min-height: 52px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  background: rgba(255,255,255,.94); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 10;
}
.side-nav { display: grid; gap: 7px; margin-top: 34px; }
.nav-btn {
  border: 0; background: transparent; color: #635e57; border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-weight: 750; text-align: left;
}
.nav-btn span { font-size: 20px; min-width: 24px; text-align: center; }
.nav-btn.active { background: var(--yellow-soft); color: var(--yellow-dark); }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.connection-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.connection-badge span { width: 9px; height: 9px; border-radius: 99px; background: var(--success); }
.connection-badge.offline span { background: var(--danger); }
.main-content { min-width: 0; padding: 0 28px 40px; }
.topbar {
  min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  position: sticky; top: 0; background: rgba(247,245,240,.88); backdrop-filter: blur(16px); z-index: 8;
}
.topbar h2 { margin: 4px 0 0; font-size: 27px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.user-pill > span { width: 36px; height: 36px; border-radius: 12px; background: var(--yellow); display: grid; place-items: center; font-weight: 900; overflow: hidden; }
.user-pill > span img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-pill strong, .user-pill small { display: block; }
.user-pill small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.view { display: none; animation: fadeIn .2s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero {
  background: linear-gradient(120deg, #4b2f21, #806049); color: #fff;
  border-radius: 28px; padding: clamp(24px, 5vw, 42px); position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after { content: "🧇"; position: absolute; right: 4%; top: -18px; font-size: 150px; opacity: .12; transform: rotate(14deg); }
.hero h3 { font-size: clamp(28px, 5vw, 46px); margin: 8px 0; max-width: 720px; }
.hero p { color: rgba(255,255,255,.72); max-width: 650px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.stat-card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(45,37,22,.04);
}
.stat-card { padding: 20px; }
.stat-card .stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--yellow-soft); font-size: 20px; }
.stat-card small { color: var(--muted); display: block; margin: 16px 0 7px; }
.stat-card strong { font-size: 27px; }
.negative-value { color: var(--danger); }
.expense-category { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: #f3e5d4; color: #69442f; font-size: 11px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; margin-top: 18px; }
.panel { padding: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-header h3 { margin: 0; }
.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 35px 15px; color: var(--muted); }
.empty-state .empty-icon { font-size: 45px; display: block; margin-bottom: 10px; }

.sales-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.catalog-area { min-width: 0; }
.category-tabs { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.category-tab { white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 15px; font-weight: 800; }
.category-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; margin-top: 8px; }
.product-card {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 17px;
  text-align: left; min-height: 160px; display: flex; flex-direction: column; transition: .16s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(45,37,22,.08); border-color: #c9aa8e; }
.product-card .product-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--yellow-soft); display: grid; place-items: center; font-size: 27px; }
.product-card h4 { margin: 15px 0 6px; font-size: 16px; }
.product-card p { color: var(--muted); font-size: 12px; margin: 0 0 12px; line-height: 1.45; }
.product-card strong { margin-top: auto; font-size: 20px; }
.cart-panel { position: sticky; top: 110px; padding: 18px; }
.cart-list { display: grid; gap: 11px; max-height: 48vh; overflow: auto; padding-right: 3px; }
.cart-item { border: 1px solid var(--line); border-radius: 15px; padding: 12px; }
.cart-item-head { display: flex; justify-content: space-between; gap: 12px; }
.cart-item h4 { margin: 0; font-size: 14px; }
.cart-item .choices { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 6px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qty-controls { display: flex; gap: 7px; align-items: center; }
.icon-btn { border: 1px solid var(--line); background: #fff; width: 31px; height: 31px; border-radius: 10px; font-weight: 900; }
.cart-summary { border-top: 1px dashed #d9d0c3; margin-top: 15px; padding-top: 14px; display: grid; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.summary-row.total { color: var(--ink); font-size: 20px; font-weight: 900; }
.cart-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; margin-top: 14px; }
.discount-chip { display: flex; justify-content: space-between; align-items: center; background: #fff0f0; color: #9b3030; padding: 10px; border-radius: 12px; font-size: 12px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: #fff; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: #fbfaf8; }
tr:last-child td { border-bottom: 0; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 800; }
.status-paid { background: #dcf5e9; color: #157049; }
.status-cancelled { background: #fde5e5; color: #a73131; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters > * { width: auto; min-width: 160px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.cards-list { display: grid; gap: 12px; }
.user-card, .setting-card { border: 1px solid var(--line); border-radius: 16px; padding: 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; }
.user-card-meta { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--yellow-soft); display: grid; place-items: center; font-weight: 900; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.avatar-large { width: 92px; height: 92px; border-radius: 24px; font-size: 30px; }
.employee-photo-editor { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); }
.employee-photo-editor > div:last-child { min-width: 0; flex: 1; }
@media (max-width: 520px) { .employee-photo-editor { align-items: flex-start; } .avatar.avatar-large { width: 78px; height: 78px; border-radius: 20px; } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(24,21,17,.55); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 18px;
}
.modal {
  width: min(100%, 620px); max-height: min(90vh, 850px); overflow: auto;
  background: #fff; border-radius: 25px; box-shadow: 0 28px 80px rgba(0,0,0,.28); padding: 22px;
}
.modal.modal-wide { width: min(100%, 820px); }
.modal-header { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 18px; }
.modal-header h3 { margin: 0; font-size: 23px; }
.modal-close { border: 0; background: var(--surface-2); border-radius: 11px; width: 38px; height: 38px; font-size: 20px; }
.option-group { margin-top: 18px; }
.option-group h4 { margin: 0 0 5px; }
.option-group p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.option-btn { border: 1px solid var(--line); background: #fff; padding: 12px; border-radius: 13px; text-align: left; font-weight: 750; }
.option-btn.selected { border-color: var(--yellow-dark); background: var(--yellow-soft); box-shadow: 0 0 0 2px rgba(139,98,74,.14); }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.money-big { font-size: 36px; font-weight: 950; margin: 6px 0 18px; }
.payment-tabs { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.payment-tab { border: 1px solid var(--line); background: #fff; padding: 11px 7px; border-radius: 12px; font-weight: 800; font-size: 12px; }
.payment-tab.active { background: var(--ink); color: #fff; }
.receipt { background: #fbfaf6; border: 1px dashed #cfc4b4; border-radius: 16px; padding: 18px; }
.receipt-head { text-align: center; padding-bottom: 14px; border-bottom: 1px dashed #cfc4b4; }
.receipt-lines { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px dashed #cfc4b4; }
.receipt-line { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; }
.receipt-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 900; margin-top: 14px; }

.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 300; padding: 13px 16px; border-radius: 13px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sales-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
}
@media (max-width: 820px) {
  :root {
  --brand-brown: #8b624a;
  --brand-brown-dark: #5b3928;
  --brand-cream: #f2e1cc; --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 0 14px 92px; }
  .topbar { min-height: 76px; }
  .topbar h2 { font-size: 22px; }
  .topbar-actions .btn { display: none; }
  .user-pill { padding-right: 8px; }
  .user-pill div { display: none; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5,1fr); position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 30; padding: 7px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.95); backdrop-filter: blur(16px); box-shadow: 0 15px 40px rgba(0,0,0,.15);
  }
  .mobile-nav .nav-btn { display: grid; place-items: center; gap: 2px; padding: 7px 3px; font-size: 10px; }
  .mobile-nav .nav-btn span { font-size: 19px; min-width: auto; }
  .mobile-nav .nav-btn small { font-size: 9px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { border-radius: 22px; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 21px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card { min-height: 148px; padding: 14px; }
  .product-card h4 { font-size: 14px; }
  .option-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .payment-tabs { grid-template-columns: 1fr 1fr; }
  .modal { padding: 18px; border-radius: 20px; }
  .cart-actions { grid-template-columns: 1fr; }
  .filters > * { width: 100%; }
  .topbar-actions { gap: 4px; }
}

/* Versión 0.3: caja y reportes */
.cash-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(45,37,22,.04);
}
.cash-status.is-open {
  background: linear-gradient(135deg, #233428, #395844);
  color: #fff;
  border-color: transparent;
}
.cash-status.is-open p { color: rgba(255,255,255,.72); }
.cash-status h3 { margin: 4px 0 6px; font-size: 28px; }
.cash-status p { margin: 0; color: var(--muted); }
.cash-stats, .report-stats { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 18px; }
.cash-close-summary, .payment-summary { display: grid; gap: 12px; }
.cash-close-summary > div, .payment-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.cash-close-summary > div:last-of-type, .payment-summary > div:last-child { border-bottom: 0; }
.cash-close-summary span, .payment-summary span { color: var(--muted); }
.report-inner { box-shadow: none; }
.bar-list { display: grid; gap: 15px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.bar-row span { color: var(--muted); font-size: 12px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), var(--yellow-dark)); }
.mobile-menu-grid { display: grid; gap: 10px; }
.mobile-menu-grid .setting-card { width: 100%; cursor: pointer; font: inherit; color: inherit; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.filters label input { min-width: 160px; }

@media (max-width: 1100px) {
  .cash-stats, .report-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .cash-status { align-items: flex-start; flex-direction: column; }
  .cash-status .inline-actions { width: 100%; }
  .cash-status .inline-actions .btn { flex: 1; }
  .cash-stats, .report-stats { grid-template-columns: 1fr 1fr; }
}


/* Inventario · v0.4 */
.inventory-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.inventory-alert { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #edc66a; background: #fffaf0; }
.inventory-alert p { margin: 6px 0 0; }
.stock-pill, .movement-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.stock-ok { background: #dcf5e9; color: #157049; }
.stock-low { background: #fff0cf; color: #8a5b00; }
.stock-out { background: #fde5e5; color: #a73131; }
.stock-inactive { background: #ece9e3; color: #6f685e; }
.movement-in { background: #dcf5e9; color: #157049; }
.movement-out { background: #fde5e5; color: #a73131; }
.movement-adjust { background: #e7ebff; color: #364da2; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 250px; }
.table-actions .btn { padding: 8px 10px; font-size: 11px; }
.check-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: #fbfaf8; }
.check-row input { width: 18px; height: 18px; }
.movement-preview { border-radius: 16px; padding: 15px; background: var(--yellow-soft); display: grid; gap: 4px; }
.movement-preview span, .movement-preview small { color: var(--muted); }
.movement-preview strong { font-size: 24px; }
@media (max-width: 820px) { .inventory-stats { grid-template-columns: 1fr 1fr; } .inventory-alert { align-items: flex-start; flex-direction: column; } }


/* Recetas e inventario automático · v0.5 */
.recipe-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.recipe-pill { display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:850;white-space:nowrap; }
.recipe-ready { background:#dcf5e9;color:#157049; }
.recipe-empty { background:#f0ede7;color:#756d61; }
.recipe-help { display:grid;gap:4px;padding:14px 16px;border-radius:16px;background:var(--yellow-soft);margin-bottom:14px; }
.recipe-help span { color:var(--muted);font-size:13px;line-height:1.45; }
.recipe-editor { display:grid;gap:10px;max-height:56vh;overflow:auto;padding-right:3px; }
.recipe-row { display:grid;grid-template-columns:1.5fr .8fr 1.4fr auto;gap:10px;align-items:end;padding:13px;border:1px solid var(--line);border-radius:16px;background:#fbfaf8; }
.recipe-row label { display:grid;gap:6px;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em; }
.recipe-row select,.recipe-row input { width:100%; }
.recipe-remove { margin-bottom:1px; }
.inventory-sale-preview { display:grid;gap:5px;padding:13px 15px;margin:0 0 16px;border:1px solid #bfe0cb;border-radius:15px;background:#effaf3; }
.inventory-sale-preview p { margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.45; }
.inventory-sale-preview small { color:#397254; }
.inventory-sale-preview.has-shortage { border-color:#e7bc61;background:#fff8e6; }
.inventory-sale-preview.has-shortage small { color:#8a5b00; }
.receipt-cancelled { opacity:.72; }
.cancel-note { margin-top:8px;padding:8px 10px;border-radius:10px;background:#fde5e5;color:#a73131;font-size:12px;font-weight:750; }
.receipt-inventory { display:grid;gap:4px;margin-top:14px;padding-top:12px;border-top:1px dashed var(--line); }
.receipt-inventory small { color:var(--muted);line-height:1.45; }
.cancelled-row { opacity:.68; }
@media (max-width:900px){.recipe-row{grid-template-columns:1fr 1fr}.recipe-row label:nth-child(3){grid-column:1/-1}.recipe-remove{width:100%}}
@media (max-width:650px){.recipe-stats{grid-template-columns:1fr 1fr}.recipe-row{grid-template-columns:1fr}.recipe-row label:nth-child(3){grid-column:auto}}


/* Pedidos y comandas · v0.6 */
.orders-header { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px;border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(135deg,#fff9e9,#fff); }
.orders-header h3 { margin:3px 0 6px;font-size:25px; }
.orders-header p { margin:0; }
.order-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.order-filters { display:flex;gap:8px;overflow:auto;padding:18px 0 12px; }
.orders-board { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start; }
.order-card { border:1px solid var(--line);border-top:5px solid #c6bcae;border-radius:20px;background:#fff;padding:16px;display:grid;gap:14px;box-shadow:0 10px 30px rgba(45,37,22,.04); }
.order-card.order-pending { border-top-color:#e6a91d; }
.order-card.order-preparing { border-top-color:#5279d8; }
.order-card.order-ready { border-top-color:#20a367;box-shadow:0 12px 30px rgba(32,163,103,.12); }
.order-card.order-delivered { border-top-color:#a49b90;opacity:.72; }
.order-card-top { display:flex;align-items:flex-start;justify-content:space-between;gap:12px; }
.order-card-top > div { display:grid;gap:3px; }
.order-card-top small { color:var(--muted); }
.order-number { font-size:28px;font-weight:950;line-height:1;color:var(--ink); }
.order-status { display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:900;white-space:nowrap; }
.order-status.order-pending { background:#fff0c9;color:#8a5b00; }
.order-status.order-preparing { background:#e6edff;color:#3659ad; }
.order-status.order-ready { background:#dcf5e9;color:#157049; }
.order-status.order-delivered { background:#ece9e3;color:#6f685e; }
.order-status.order-cancelled { background:#fde5e5;color:#a73131; }
.order-items { display:grid;gap:9px;padding:12px 0;border-top:1px dashed var(--line);border-bottom:1px dashed var(--line); }
.order-items > div { display:grid;gap:2px; }
.order-items small { color:var(--muted);line-height:1.35; }
.order-note { padding:10px 12px;border-radius:12px;background:var(--yellow-soft);font-size:12px;font-weight:750; }
.order-card-footer { display:flex;justify-content:space-between;align-items:center;gap:10px; }
.order-capture { margin:0 0 16px;padding:15px;border:1px solid var(--line);border-radius:16px;background:#fbfaf8; }
.order-capture .panel-header { margin-bottom:12px; }
.receipt-order { margin:12px auto 5px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap; }
.receipt-order > strong { font-size:20px; }
@media (max-width:1100px){.orders-board{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:700px){.orders-header{align-items:flex-start;flex-direction:column}.orders-header .btn{width:100%}.order-stats{grid-template-columns:1fr 1fr}.orders-board{grid-template-columns:1fr}.order-card-footer{align-items:stretch;flex-direction:column}.order-card-footer .inline-actions,.order-card-footer .btn{width:100%}.order-card-footer .inline-actions .btn{flex:1}}

/* Editor completo de menú · v0.7 */
.catalog-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.catalog-count { display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;background:var(--surface-2);color:var(--muted);font-size:11px;font-weight:850;white-space:nowrap; }
.product-basic { margin-bottom:18px; }
.catalog-editor-heading { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 0 12px;border-top:1px solid var(--line); }
.catalog-editor-heading h4 { margin:0 0 4px;font-size:18px; }
.catalog-editor-heading p { margin:0; }
.option-groups-editor { display:grid;gap:14px;max-height:58vh;overflow:auto;padding-right:4px; }
.option-editor-card { border:1px solid var(--line);border-radius:20px;background:#fbfaf8;padding:15px;display:grid;gap:14px; }
.option-editor-top { display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start; }
.option-editor-number,.category-order { width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--yellow-soft);font-weight:950; }
.option-editor-fields { display:grid;grid-template-columns:1.5fr 1fr .65fr .65fr .8fr;gap:9px; }
.option-editor-fields label { display:grid;gap:5px;color:var(--muted);font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em; }
.option-editor-actions { display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end; }
.option-list-editor { display:grid;gap:8px;padding-top:12px;border-top:1px dashed var(--line); }
.option-list-head { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.option-editor-row { display:grid;grid-template-columns:30px minmax(150px,1.5fr) minmax(110px,.7fr) 110px 38px 38px 42px;gap:8px;align-items:center; }
.drag-index { color:var(--muted);font-size:11px;font-weight:900;text-align:center; }
.price-input { display:flex;align-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden; }
.price-input span { padding-left:10px;color:var(--muted);font-weight:850; }
.price-input input { border:0;background:transparent;min-width:0; }
.empty-option-row { padding:14px;border:1px dashed var(--line);border-radius:14px;color:var(--muted);text-align:center;font-size:12px; }
.category-editor { display:grid;gap:10px;max-height:58vh;overflow:auto;padding-right:3px; }
.category-editor-row { display:grid;grid-template-columns:34px 62px minmax(170px,1fr) 110px 110px 38px 38px 90px;gap:8px;align-items:center;padding:11px;border:1px solid var(--line);border-radius:16px;background:#fbfaf8; }
.category-icon-input { text-align:center;font-size:20px;padding-left:4px!important;padding-right:4px!important; }
@media (max-width:1100px){.option-editor-fields{grid-template-columns:1fr 1fr 1fr}.category-editor-row{grid-template-columns:34px 56px 1fr 100px}.category-editor-row .catalog-count{display:none}.category-editor-row .icon-btn,.category-editor-row .btn{width:100%}}
@media (max-width:760px){.catalog-stats{grid-template-columns:1fr 1fr}.catalog-editor-heading{align-items:stretch;flex-direction:column}.catalog-editor-heading .btn{width:100%}.option-editor-top{grid-template-columns:1fr}.option-editor-number{display:none}.option-editor-actions{justify-content:stretch}.option-editor-actions .btn{flex:1}.option-editor-fields{grid-template-columns:1fr 1fr}.option-editor-row{grid-template-columns:1fr 110px 95px 38px 38px 42px}.option-editor-row .drag-index{display:none}.category-editor-row{grid-template-columns:46px 1fr 95px}.category-editor-row .category-order{display:none}.category-editor-row .icon-btn,.category-editor-row .btn{min-height:38px}.category-editor-row .catalog-count{display:none}}
@media (max-width:520px){.option-editor-fields{grid-template-columns:1fr}.option-editor-row{grid-template-columns:1fr 95px}.option-editor-row select{grid-column:1/-1}.option-editor-row .icon-btn,.option-editor-row .btn{width:100%}.category-editor-row{grid-template-columns:44px 1fr}.category-editor-row select{grid-column:1/-1}.category-editor-row .icon-btn,.category-editor-row .btn{width:100%}}

/* Compras y proveedores · v0.8 */
.purchase-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.purchase-pill { display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:900;white-space:nowrap; }
.purchase-paid { background:#dcf5e9;color:#157049; }
.purchase-partial { background:#e7ebff;color:#364da2; }
.purchase-pending { background:#fff0cf;color:#8a5b00; }
.purchase-cancelled { background:#fde5e5;color:#a73131; }
.supplier-list { display:grid;gap:10px;max-height:62vh;overflow:auto;padding-right:3px; }
.supplier-card { display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:15px;border:1px solid var(--line);border-radius:18px;background:#fbfaf8; }
.supplier-card p { margin:7px 0 0;color:var(--muted);font-size:12px; }
.supplier-card small { color:var(--muted);line-height:1.45; }
.supplier-title { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:5px; }
.supplier-balance { display:grid;justify-items:end;gap:5px;min-width:150px; }
.supplier-balance small { text-transform:uppercase;font-size:10px;font-weight:850;letter-spacing:.04em; }
.supplier-balance strong { font-size:19px; }
.purchase-editor-heading { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 0 5px;border-top:1px solid var(--line); }
.purchase-editor-heading h4 { margin:0 0 3px;font-size:18px; }
.purchase-editor-heading p { margin:0; }
.purchase-lines { display:grid;gap:9px;max-height:43vh;overflow:auto;padding-right:3px; }
.purchase-line { display:grid;grid-template-columns:32px minmax(190px,1.5fr) minmax(110px,.7fr) minmax(130px,.8fr) minmax(115px,.7fr) 42px;gap:8px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:16px;background:#fbfaf8; }
.purchase-line label { display:grid;gap:5px;color:var(--muted);font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em; }
.purchase-line-number { width:30px;height:30px;display:grid;place-items:center;align-self:center;border-radius:10px;background:var(--yellow-soft);font-weight:950; }
.purchase-line-total { display:grid;gap:4px;padding:0 4px 6px; }
.purchase-line-total small { color:var(--muted);font-size:10px;font-weight:850;text-transform:uppercase; }
.purchase-line-total strong { font-size:16px; }
.purchase-payment-box { display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:10px;align-items:end;padding:15px;border:1px solid #ead38d;border-radius:18px;background:var(--yellow-soft); }
.purchase-payment-box > div,.purchase-payment-box label { display:grid;gap:5px; }
.purchase-payment-box small,.purchase-payment-box label { color:var(--muted);font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em; }
.purchase-payment-box strong { font-size:22px; }
.purchase-detail-summary { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:14px; }
.purchase-detail-summary > div { display:grid;gap:5px;padding:13px;border:1px solid var(--line);border-radius:15px;background:#fbfaf8; }
.purchase-detail-summary small { color:var(--muted);text-transform:uppercase;font-size:10px;font-weight:850;letter-spacing:.04em; }
.purchase-detail-summary strong { font-size:20px; }
.purchase-note { display:grid;gap:4px;padding:12px 14px;margin-bottom:14px;border-radius:14px;background:var(--yellow-soft); }
.purchase-note span,.purchase-note small { color:var(--muted);line-height:1.4; }
.purchase-payments { display:grid;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line); }
.purchase-payments h4 { margin:0; }
.payment-row { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 13px;border:1px solid var(--line);border-radius:14px;background:#fbfaf8; }
.payment-row > div { display:grid;gap:3px; }
.payment-row small,.payment-row > span { color:var(--muted);font-size:12px; }
.empty-state.compact { min-height:auto;padding:16px; }
textarea { width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:#fff;color:var(--ink);font:inherit;resize:vertical; }
textarea:focus { outline:2px solid rgba(139,98,74,.26);border-color:#8b624a; }
@media (max-width:1000px){.purchase-line{grid-template-columns:30px 1.4fr .7fr .8fr}.purchase-line-total{grid-column:2/4}.purchase-line .icon-btn{grid-column:4}.purchase-payment-box{grid-template-columns:1fr 1fr}}
@media (max-width:760px){.purchase-stats{grid-template-columns:1fr 1fr}.supplier-card{flex-direction:column}.supplier-balance{justify-items:start;min-width:0;width:100%}.purchase-editor-heading{align-items:stretch;flex-direction:column}.purchase-editor-heading .btn{width:100%}.purchase-line{grid-template-columns:1fr 1fr}.purchase-line-number{display:none}.purchase-line label:first-of-type{grid-column:1/-1}.purchase-line-total{grid-column:auto}.purchase-line .icon-btn{grid-column:auto;width:100%}.purchase-detail-summary{grid-template-columns:1fr 1fr}.payment-row{align-items:flex-start;flex-direction:column}}
@media (max-width:500px){.purchase-payment-box{grid-template-columns:1fr}.purchase-line{grid-template-columns:1fr}.purchase-line label:first-of-type{grid-column:auto}.purchase-detail-summary{grid-template-columns:1fr 1fr}}


/* Sincronización cifrada y modo nube · v1.0 */
.sync-hero { display:flex;align-items:center;justify-content:space-between;gap:22px;padding:26px 28px;border-radius:26px;background:linear-gradient(135deg,#302a25,#514338);color:#fff;box-shadow:var(--shadow);overflow:hidden; }
.sync-hero h3 { margin:5px 0 7px;font-size:clamp(23px,3vw,35px); }
.sync-hero p { margin:0;color:rgba(255,255,255,.76); }
.sync-orbit { width:94px;height:94px;min-width:94px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);font-size:46px;box-shadow:0 0 0 14px rgba(255,255,255,.05); }
.sync-hero.sync-ok { background:linear-gradient(135deg,#1e5943,#2f8061); }
.sync-hero.sync-pending { background:linear-gradient(135deg,#765214,#b27c1f); }
.sync-hero.sync-conflict,.sync-hero.sync-error { background:linear-gradient(135deg,#7d2929,#b54848); }
.sync-stats { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:18px; }
.sync-small-value { font-size:14px!important;line-height:1.25;word-break:break-word; }
.sync-action-list { display:grid;gap:9px;margin:14px 0; }
.sync-action-list .setting-card { width:100%;text-align:left;cursor:pointer; }
.sync-action-list .setting-card span { display:grid;gap:3px; }
.sync-action-list .setting-card small { color:var(--muted);font-weight:600;line-height:1.35; }
.sync-action-list .setting-card:disabled { opacity:.5;cursor:not-allowed; }
.sync-security { margin:16px 0;padding:15px;border-radius:17px;background:#edf7f2;border:1px solid #c5e6d6; }
.sync-security strong { color:#175c43; }
.sync-security p { margin:7px 0 0;color:#42695a;font-size:12px;line-height:1.5; }
.sync-conflict-panel { display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:18px;border-color:#e6a3a3;background:#fff4f4; }
.sync-conflict-panel p { margin:6px 0 0; }
.connection-badge.sync-warning span { background:#e39b1c;box-shadow:0 0 0 4px rgba(227,155,28,.15); }
#syncNowBtn { white-space:nowrap; }
.form-stack label small { display:block;margin-top:5px;color:var(--muted);font-size:11px;line-height:1.4;text-transform:none;letter-spacing:0;font-weight:600; }
@media (max-width:900px){.sync-stats{grid-template-columns:1fr 1fr}.sync-conflict-panel{align-items:stretch;flex-direction:column}.sync-conflict-panel .inline-actions,.sync-conflict-panel .btn{width:100%}}
@media (max-width:600px){.sync-hero{padding:22px;align-items:flex-start}.sync-orbit{width:64px;height:64px;min-width:64px;font-size:30px;box-shadow:0 0 0 8px rgba(255,255,255,.05)}.sync-stats{grid-template-columns:1fr 1fr}.topbar-actions #syncNowBtn{display:none!important}}

/* Seguridad, permisos y bitácora · v1.0 */
.permission-editor { display:grid;gap:10px;padding:15px;border:1px solid var(--line);border-radius:18px;background:#fbfaf8; }
.permission-editor > strong { font-size:15px; }
.permission-editor > small { color:var(--muted);font-size:11px;line-height:1.45; }
.permission-editor .check-row { margin:0;padding:9px 10px;border-radius:12px;background:#fff;border:1px solid var(--line); }
.audit-pill { display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;background:#eee9ff;color:#55408e;font-size:11px;font-weight:900;white-space:nowrap; }
.danger-zone { border-color:#efcaca;background:#fff9f9; }
.btn:disabled { opacity:.48;cursor:not-allowed;filter:grayscale(.15); }
.login-card::after { content:'v1.0';position:absolute;right:18px;bottom:14px;color:var(--muted);font-size:10px;font-weight:900;letter-spacing:.08em; }
.login-card { position:relative; }
@media (max-width:700px){.permission-editor{padding:12px}.audit-pill{white-space:normal;text-align:center}}
