/* =============================================
   FIBO — Design System & Complete Styles
   Dark/Light Mode | Glassmorphism | Tablet-first
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ── */
:root {
  /* Background scale */
  --bg-0: #020617;
  --bg-1: #0F172A;
  --bg-2: #1E293B;
  --bg-3: #334155;
  --bg-4: #475569;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-light: rgba(30, 41, 59, 0.6);
  --bg-card: rgba(30, 41, 59, 0.8);

  /* Text */
  --tx-1: #F8FAFC;
  --tx-2: #CBD5E1;
  --tx-3: #94A3B8;
  --tx-4: #64748B;

  /* Brand */
  --brand:      #F97316;
  --brand-dim:  rgba(249, 115, 22, 0.15);
  --brand-glow: 0 0 20px rgba(249, 115, 22, 0.3);

  /* Table states */
  --s-libre:    #22C55E;
  --s-libre-bg: rgba(34, 197, 94, 0.12);
  --s-libre-b:  rgba(34, 197, 94, 0.3);

  --s-ocupada:    #F59E0B;
  --s-ocupada-bg: rgba(245, 158, 11, 0.12);
  --s-ocupada-b:  rgba(245, 158, 11, 0.3);

  --s-reservada:    #3B82F6;
  --s-reservada-bg: rgba(59, 130, 246, 0.12);
  --s-reservada-b:  rgba(59, 130, 246, 0.3);

  --s-cocina:    #EAB308;
  --s-cocina-bg: rgba(234, 179, 8, 0.12);
  --s-cocina-b:  rgba(234, 179, 8, 0.35);

  --s-listo:    #A855F7;
  --s-listo-bg: rgba(168, 85, 247, 0.15);
  --s-listo-b:  rgba(168, 85, 247, 0.35);

  --s-cuenta:    #EF4444;
  --s-cuenta-bg: rgba(239, 68, 68, 0.15);
  --s-cuenta-b:  rgba(239, 68, 68, 0.35);

  --s-cerrada:    #64748B;
  --s-cerrada-bg: rgba(100, 116, 139, 0.1);

  /* Borders */
  --border:       rgba(51, 65, 85, 0.8);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.12);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;

  /* Shadows */
  --sh-sm: 0 2px 8px rgba(0,0,0,0.35);
  --sh-md: 0 4px 20px rgba(0,0,0,0.45);
  --sh-lg: 0 8px 40px rgba(0,0,0,0.55);

  /* Transitions */
  --t-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --topbar-h:  64px;
  --chrome-h:  var(--topbar-h);
  --bottom-nav-h: 64px;
}

/* Gestion interna de precios SaaS */
.pricing-admin-shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1500px;
  margin: 0 auto;
  animation: pricingAdminEnter 240ms ease-out both;
}
.pricing-admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-glass);
}
.pricing-admin-eyebrow {
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pricing-admin-header h2 { color: var(--tx-1); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
.pricing-admin-header p { max-width: 650px; margin-top: 7px; color: var(--tx-3); font-size: 13px; }
.pricing-admin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.pricing-admin-save-state { color: var(--tx-4); font-size: 11px; font-weight: 700; }
.pricing-admin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--border-glass); }
.pricing-admin-kpi { position: relative; min-width: 0; padding: 17px 20px 18px; border-right: 1px solid var(--border-glass); overflow: hidden; }
.pricing-admin-kpi:last-child { border-right: 0; }
.pricing-admin-kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--tx-4); opacity: .7; }
.pricing-admin-kpi.tone-brand::before { background: var(--brand); }
.pricing-admin-kpi.tone-green::before { background: var(--s-libre); }
.pricing-admin-kpi.tone-blue::before { background: var(--s-reservada); }
.pricing-admin-kpi.tone-amber::before { background: var(--s-ocupada); }
.pricing-admin-kpi-value { color: var(--tx-1); font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pricing-admin-kpi-label { margin-top: 5px; color: var(--tx-2); font-size: 12px; font-weight: 700; }
.pricing-admin-kpi-detail { margin-top: 3px; color: var(--tx-4); font-size: 10px; }
.pricing-admin-workspace { min-width: 0; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--r-xl); overflow: hidden; }
.pricing-admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border-glass); }
.pricing-admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-glass); }
.pricing-admin-tab {
  min-height: 36px;
  padding: 7px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--tx-4);
  font-size: 12px;
  font-weight: 800;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.pricing-admin-tab:hover { color: var(--tx-2); }
.pricing-admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.pricing-admin-tab span { margin-left: 4px; opacity: .65; }
.pricing-admin-search { display: flex; align-items: center; gap: 8px; width: min(330px, 42vw); padding: 8px 11px; color: var(--tx-4); background: var(--bg-1); border: 1px solid var(--border-glass); border-radius: var(--r-sm); }
.pricing-admin-search svg { width: 15px; height: 15px; flex: 0 0 auto; }
.pricing-admin-search input { min-width: 0; width: 100%; color: var(--tx-1); background: transparent; border: 0; outline: 0; font-size: 12px; }
.pricing-admin-note { padding: 10px 16px; color: var(--tx-4); background: rgba(59,130,246,.06); border-bottom: 1px solid rgba(59,130,246,.14); font-size: 11px; }
.pricing-admin-list { display: flex; flex-direction: column; }
.pricing-admin-row {
  display: grid;
  grid-template-columns: minmax(290px, 1.6fr) minmax(150px, .65fr) 120px 130px;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 18px;
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--t-normal), box-shadow var(--t-normal);
  animation: pricingAdminRow 260ms ease-out both;
}
.pricing-admin-row:last-child { border-bottom: 0; }
.pricing-admin-row:hover { background: rgba(255,255,255,.018); }
.pricing-admin-row.dirty { background: rgba(249,115,22,.055); box-shadow: inset 3px 0 0 var(--brand); }
.pricing-admin-row[hidden] { display: none; }
.pricing-admin-identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.pricing-admin-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; color: var(--brand); background: var(--brand-dim); border-radius: 10px; }
.pricing-admin-icon svg { width: 17px; height: 17px; }
.pricing-admin-identity > div:last-child { min-width: 0; }
.pricing-admin-identity strong { display: inline; color: var(--tx-1); font-size: 13px; }
.pricing-admin-identity code { display: inline-block; margin-left: 7px; padding: 2px 5px; color: var(--tx-4); background: var(--bg-1); border-radius: 4px; font: 9px/1.2 monospace; vertical-align: 1px; }
.pricing-admin-identity p { max-width: 620px; margin-top: 4px; color: var(--tx-4); font-size: 11px; line-height: 1.45; }
.pricing-admin-field { min-width: 0; }
.pricing-admin-field > label, .pricing-admin-plan-checks > label { display: block; margin-bottom: 5px; color: var(--tx-4); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.pricing-admin-field select, .pricing-admin-price-field > div { width: 100%; height: 36px; color: var(--tx-1); background: var(--bg-1); border: 1px solid var(--border-glass); border-radius: var(--r-sm); }
.pricing-admin-field select { padding: 0 9px; outline: 0; font-size: 11px; }
.pricing-admin-price-field > div { display: flex; align-items: center; padding: 0 10px; }
.pricing-admin-price-field span { color: var(--brand); font-size: 12px; font-weight: 800; }
.pricing-admin-price-field input { min-width: 0; width: 100%; padding-left: 6px; color: var(--tx-1); background: transparent; border: 0; outline: 0; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pricing-admin-usage { display: flex; flex-direction: column; }
.pricing-admin-usage strong { color: var(--tx-1); font-size: 17px; font-variant-numeric: tabular-nums; }
.pricing-admin-usage span { color: var(--tx-4); font-size: 9px; }
.pricing-admin-switch { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 7px; color: var(--tx-3); font-size: 10px; font-weight: 700; }
.pricing-admin-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pricing-admin-switch span { position: relative; width: 34px; height: 19px; background: var(--bg-4); border-radius: 999px; transition: background var(--t-fast); }
.pricing-admin-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; background: white; border-radius: 50%; transition: transform var(--t-fast); }
.pricing-admin-switch input:checked + span { background: var(--brand); }
.pricing-admin-switch input:checked + span::after { transform: translateX(15px); }
.pricing-admin-switch em { grid-column: 2; font-style: normal; }
.pricing-admin-module-row { grid-template-columns: minmax(260px, 1.5fr) 150px 120px minmax(210px, .9fr) minmax(150px, .65fr); }
.pricing-admin-plan-checks > div { display: flex; gap: 5px; flex-wrap: wrap; }
.pricing-admin-plan-checks > div label { cursor: pointer; }
.pricing-admin-plan-checks input { position: absolute; opacity: 0; pointer-events: none; }
.pricing-admin-plan-checks span { display: block; padding: 5px 7px; color: var(--tx-4); background: var(--bg-1); border: 1px solid var(--border-glass); border-radius: 6px; font-size: 9px; font-weight: 700; text-transform: capitalize; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.pricing-admin-plan-checks input:checked + span { color: var(--brand); background: var(--brand-dim); border-color: rgba(249,115,22,.35); }
.pricing-admin-module-status { display: flex; flex-direction: column; gap: 5px; color: var(--tx-3); font-size: 9px; }
.pricing-admin-module-status label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.pricing-admin-module-status input { accent-color: var(--brand); }
.pricing-admin-module-status small { margin-top: 2px; color: var(--tx-4); font-size: 9px; }
.pricing-admin-loading, .pricing-admin-error { min-height: 55vh; align-items: center; justify-content: center; text-align: center; color: var(--tx-3); }
.pricing-admin-loading span, .pricing-admin-error span { color: var(--tx-4); font-size: 11px; }
.pricing-admin-spinner { width: 30px; height: 30px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: pricingAdminSpin .7s linear infinite; }
@keyframes pricingAdminSpin { to { transform: rotate(360deg); } }
@keyframes pricingAdminEnter { from { opacity: 0; transform: translateY(6px); } }
@keyframes pricingAdminRow { from { opacity: 0; transform: translateY(4px); } }

@media (max-width: 1180px) {
  .pricing-admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-admin-kpi:nth-child(2) { border-right: 0; }
  .pricing-admin-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border-glass); }
  .pricing-admin-row, .pricing-admin-module-row { grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(130px, .6fr)); }
  .pricing-admin-module-row .pricing-admin-plan-checks, .pricing-admin-module-row .pricing-admin-module-status { grid-column: span 1; }
}
@media (max-width: 760px) {
  .pricing-admin-shell { gap: 16px; }
  .pricing-admin-header { align-items: flex-start; flex-direction: column; }
  .pricing-admin-actions { width: 100%; justify-content: flex-start; }
  .pricing-admin-save-state { width: 100%; }
  .pricing-admin-toolbar { align-items: stretch; flex-direction: column; }
  .pricing-admin-search { width: 100%; }
  .pricing-admin-row, .pricing-admin-module-row { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pricing-admin-identity { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .pricing-admin-kpis { grid-template-columns: 1fr; }
  .pricing-admin-kpi { border-right: 0; border-bottom: 1px solid var(--border-glass); }
  .pricing-admin-kpi:last-child { border-bottom: 0; }
  .pricing-admin-row, .pricing-admin-module-row { grid-template-columns: 1fr; }
  .pricing-admin-identity, .pricing-admin-module-row .pricing-admin-plan-checks, .pricing-admin-module-row .pricing-admin-module-status { grid-column: auto; }
  .pricing-admin-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pricing-admin-shell, .pricing-admin-row, .pricing-admin-spinner { animation: none; }
}

/* ── LIGHT MODE THEME ── */
body.light-mode {
  --bg-0: #FFFFFF;
  --bg-1: #F8FAFC;
  --bg-2: #F1F5F9;
  --bg-3: #E2E8F0;
  --bg-4: #CBD5E1;
  --bg-glass: rgba(248, 250, 252, 0.90);
  --bg-glass-light: rgba(241, 245, 249, 0.80);
  --bg-card: rgba(255, 255, 255, 0.95);

  --tx-1: #0F172A;
  --tx-2: #1E293B;
  --tx-3: #334155;
  --tx-4: #64748B;

  --border:       rgba(226, 232, 240, 1);
  --border-glass: rgba(148, 163, 184, 0.25);
  --border-light: rgba(148, 163, 184, 0.35);

  --sh-sm: 0 1px 4px rgba(0,0,0,0.08);
  --sh-md: 0 4px 16px rgba(0,0,0,0.10);
  --sh-lg: 0 8px 32px rgba(0,0,0,0.14);

  --brand-glow: 0 0 16px rgba(249, 115, 22, 0.20);
}

/* Disable glassmorphism blur in light mode */
body.light-mode .gf-topbar,
body.light-mode .gf-navtabs,
body.light-mode .card,
body.light-mode .metric-card,
body.light-mode .modal,
body.light-mode .payment-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.light-mode .card,
body.light-mode .metric-card {
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
}

body.light-mode .btn-ghost {
  background: var(--bg-2);
  color: var(--tx-2);
  border: 1px solid var(--border);
}
body.light-mode .btn-ghost:hover {
  background: var(--bg-3);
  color: var(--tx-1);
  border-color: var(--border);
}

body.light-mode .input,
body.light-mode input[class*="input"],
body.light-mode select,
body.light-mode textarea {
  background: var(--bg-0);
  border-color: var(--border);
  color: var(--tx-1);
}
body.light-mode .input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

body.light-mode .bottom-nav {
  background: rgba(248, 250, 252, 0.97);
  border-top: 1px solid var(--border);
}

body.light-mode ::-webkit-scrollbar-thumb { background: var(--bg-3); }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

body.light-mode .nav-tab:hover { background: rgba(0,0,0,0.04); }

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--tx-1);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ── LAYOUT ── */
.gf-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR — DEPRECATED (sidebar removed, kept for safety) ── */
.gf-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  transition: width var(--t-normal), min-width var(--t-normal);
  z-index: 100;
  overflow: hidden;
}
.gf-sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-brand {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-glass);
  min-height: 68px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--brand-glow);
}
.brand-logo img { width: 100%; height: 100%; display: block; }
.brand-text {
  overflow: hidden;
  transition: opacity var(--t-normal), width var(--t-normal);
}
.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx-1);
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.brand-text span {
  font-size: 11px;
  color: var(--tx-4);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.gf-sidebar.collapsed .brand-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-normal);
}
.gf-sidebar.collapsed .nav-section-label { opacity: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--r-md);
  color: var(--tx-3);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  position: relative;
  margin-bottom: 2px;
  min-height: 44px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--tx-1);
}
.nav-item.active {
  background: var(--brand-dim);
  color: var(--brand);
}
.nav-item.active .nav-icon { color: var(--brand); }
.nav-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--tx-4);
  transition: color var(--t-fast);
}
.nav-item:hover .nav-icon { color: var(--tx-2); }
.nav-label {
  overflow: hidden;
  transition: opacity var(--t-normal), width var(--t-normal);
  flex: 1;
}
.gf-sidebar.collapsed .nav-label { opacity: 0; width: 0; }
.nav-badge {
  background: var(--s-cuenta);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  transition: opacity var(--t-normal);
}
.gf-sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-glass);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.user-info { overflow: hidden; transition: opacity var(--t-normal); }
.gf-sidebar.collapsed .user-info { opacity: 0; width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--tx-1); white-space: nowrap; }
.user-role { font-size: 11px; color: var(--tx-4); white-space: nowrap; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.05);
  color: var(--tx-4);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: var(--tx-2); }
.sidebar-toggle svg { width: 14px; height: 14px; transition: transform var(--t-normal); }
.gf-sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* ── MAIN ── */
.gf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

/* ── TOPBAR ── */
.gf-topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 16px 0 16px;
  display: flex;
  align-items: stretch;
  gap: 0;
  z-index: 50;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 0; flex-shrink: 0; padding-right: 8px; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--tx-1); }
.topbar-subtitle { font-size: 13px; color: var(--tx-3); font-weight: 400; }
.topbar-center { flex: 1; min-width: 0; display: flex; align-items: stretch; overflow: hidden; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-left: 8px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; padding-right: 12px; border-right: 1px solid var(--border-glass); }
.topbar-brand img { border-radius: var(--r-md); flex-shrink: 0; }
.topbar-brand-text h1 { font-size: 15px; font-weight: 700; color: var(--tx-1); line-height: 1.2; white-space: nowrap; }
.topbar-brand-text span { font-size: 10px; color: var(--tx-4); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }

.top-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 36px;
}
.top-btn svg { width: 16px; height: 16px; }
.top-btn-ghost { color: var(--tx-3); background: transparent; }
.top-btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--tx-1); }
.top-btn-ghost.active { background: var(--brand-dim); color: var(--brand); }
.top-btn-brand { background: var(--brand); color: white; box-shadow: var(--brand-glow); }
.top-btn-brand:hover { filter: brightness(1.1); }
.top-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--r-md);
  position: relative;
}

.time-display {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-2);
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: var(--r-md);
}

/* ── NAV TABS (inline in topbar) ── */
.gf-navtabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.55) transparent;
  height: 100%;
  flex: 1;
}
.gf-navtabs::-webkit-scrollbar { height: 4px; }
.gf-navtabs::-webkit-scrollbar-track { background: transparent; }
.gf-navtabs::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.45);
  border-radius: 999px;
}
.gf-navtabs::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.72); }

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  min-width: 64px;
  color: var(--tx-4);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
  user-select: none;
  height: 100%;
}
.nav-tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-tab:hover {
  color: var(--tx-2);
  background: rgba(255,255,255,0.05);
}
.nav-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-dim);
}
.nav-tab .nav-badge {
  position: absolute;
  top: 8px;
  right: 6px;
  background: var(--s-cuenta);
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-glass);
  pointer-events: none;
}

/* ── CONTENT ── */
/* Ayuda */
.help-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.help-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: var(--bg-glass);
}
.help-intro-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--tx-1);
}
.help-intro-text {
  max-width: 760px;
  margin-top: 6px;
  color: var(--tx-3);
  font-size: 13px;
  line-height: 1.55;
}
.help-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.help-flow span {
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: rgba(249,115,22,0.11);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.help-card {
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: var(--bg-glass);
}
.help-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.help-card-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--r-md);
  color: var(--brand);
  background: rgba(249,115,22,0.11);
}
.help-card-icon svg { width: 19px; height: 19px; }
.help-card-title {
  color: var(--tx-1);
  font-size: 14px;
  font-weight: 800;
}
.help-card-focus {
  margin-top: 3px;
  color: var(--tx-3);
  font-size: 12px;
  line-height: 1.4;
}
.help-card-detail {
  margin-top: 12px;
  color: var(--tx-4);
  font-size: 12px;
  line-height: 1.55;
}

.gf-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  scroll-behavior: smooth;
}

/* ── CARDS & GLASS ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 20px;
}
.card-sm { padding: 16px; border-radius: var(--r-lg); }
.card-lg { padding: 24px; border-radius: var(--r-2xl); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--tx-1); }
.card-subtitle { font-size: 12px; color: var(--tx-4); margin-top: 2px; }
.menu-day-title { font-size: 15px; font-weight: 800; color: var(--tx-1); }
.menu-day-date {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tx-2);
  letter-spacing: 0;
}

/* ── BADGES & PILLS ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-libre    { background: var(--s-libre-bg);    color: var(--s-libre);    border: 1px solid var(--s-libre-b); }
.badge-ocupada  { background: var(--s-ocupada-bg);  color: var(--s-ocupada);  border: 1px solid var(--s-ocupada-b); }
.badge-reservada{ background: var(--s-reservada-bg);color: var(--s-reservada);border: 1px solid var(--s-reservada-b); }
.badge-cocina   { background: var(--s-cocina-bg);   color: var(--s-cocina);   border: 1px solid var(--s-cocina-b); }
.badge-listo    { background: var(--s-listo-bg);    color: var(--s-listo);    border: 1px solid var(--s-listo-b); }
.badge-cuenta   { background: var(--s-cuenta-bg);   color: var(--s-cuenta);   border: 1px solid var(--s-cuenta-b); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  min-height: 44px;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary { background: var(--brand); color: white; box-shadow: var(--brand-glow); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(249,115,22,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-success { background: var(--s-libre); color: #052e16; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger { background: var(--s-cuenta); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-purple { background: var(--s-listo); color: white; }
.btn-purple:hover { filter: brightness(1.1); }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--tx-2);
  border: 1px solid var(--border-glass);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--tx-1); }

.btn-outline-brand {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-outline-brand:hover { background: var(--brand-dim); }

.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; border-radius: var(--r-md); }
.btn-lg { padding: 14px 24px; font-size: 15px; min-height: 52px; border-radius: var(--r-xl); }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; min-width: 44px; min-height: 44px; border-radius: var(--r-md); }

/* ── INPUTS ── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 12px; font-weight: 600; color: var(--tx-3); text-transform: uppercase; letter-spacing: 0.5px; }
.input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--tx-1);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }
.input::placeholder { color: var(--tx-4); }
.input-search {
  padding-left: 40px;
}
.input-wrapper { position: relative; }
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx-4);
  pointer-events: none;
}
.input-icon svg { width: 16px; height: 16px; }
.money-field .money-input {
  padding-left: 34px;
  font-variant-numeric: tabular-nums;
}
.money-prefix {
  width: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
}
.input-action-right {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  color: var(--tx-3);
  cursor: pointer;
  background: none;
  border: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.input-action-right:hover { background: rgba(255,255,255,0.08); color: var(--tx-1); }
.input-action-right svg { width: 16px; height: 16px; }
.input-with-action { padding-right: 40px; }
.catalog-field-name { cursor: pointer; }
.catalog-picker { display: flex; flex-direction: column; gap: 12px; }
.catalog-picker-filters { display: flex; gap: 8px; flex-wrap: wrap; max-height: 112px; overflow: auto; }
.catalog-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 480px); overflow: auto; }
.catalog-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
  color: var(--tx-1);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.catalog-picker-row:hover { border-color: var(--brand); background: var(--brand-dim); }
.catalog-picker-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-picker-meta { color: var(--tx-4); font-size: 12px; white-space: nowrap; }
.client-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  background: var(--bg-card);
  color: var(--tx-1);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.client-picker-row:hover,
.client-picker-row:focus-visible {
  border-color: rgba(249,115,22,0.55);
  background: rgba(249,115,22,0.06);
  outline: none;
}
.client-picker-row:active { transform: translateY(1px); }
.client-picker-main { min-width: 0; }
.client-picker-name {
  font-weight: 700;
  color: var(--tx-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-picker-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--tx-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-picker-use { pointer-events: none; }
.catalog-picker-empty {
  padding: 22px;
  color: var(--tx-4);
  text-align: center;
  border: 1px dashed var(--border-glass);
  border-radius: var(--r-md);
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border-glass); margin: 16px 0; }

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-grid-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.metric-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}
.metric-card.mc-brand::after { background: var(--brand); }
.metric-card.mc-green::after { background: var(--s-libre); }
.metric-card.mc-amber::after { background: var(--s-ocupada); }
.metric-card.mc-purple::after { background: var(--s-listo); }

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.metric-icon svg { width: 20px; height: 20px; }
.mc-brand .metric-icon { background: var(--brand-dim); color: var(--brand); }
.mc-green .metric-icon { background: var(--s-libre-bg); color: var(--s-libre); }
.mc-amber .metric-icon { background: var(--s-ocupada-bg); color: var(--s-ocupada); }
.mc-purple .metric-icon { background: var(--s-listo-bg); color: var(--s-listo); }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--tx-1);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.metric-label { font-size: 12px; color: var(--tx-4); font-weight: 500; }
.metric-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-delta.up { color: var(--s-libre); }
.metric-delta.down { color: var(--s-cuenta); }

.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass);
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 13px; color: var(--tx-2); }
.activity-time { font-size: 11px; color: var(--tx-4); font-variant-numeric: tabular-nums; }

.alerts-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
}
.alert-item.alert-warn { background: var(--s-cocina-bg); color: var(--s-cocina); border: 1px solid var(--s-cocina-b); }
.alert-item.alert-info { background: var(--s-reservada-bg); color: var(--s-reservada); border: 1px solid var(--s-reservada-b); }
.alert-item.alert-success { background: var(--s-listo-bg); color: var(--s-listo); border: 1px solid var(--s-listo-b); }
.alert-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* =============================================
   SALON — FLOOR PLAN
   ============================================= */
.salon-wrapper { display: flex; flex-direction: column; gap: 16px; height: 100%; }

.sector-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-glass);
  width: fit-content;
}
.sector-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-4);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.sector-tab:hover { color: var(--tx-2); }
.sector-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.sector-tab .sector-count {
  background: var(--bg-3);
  color: var(--tx-3);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.sector-tab.active .sector-count { background: var(--brand-dim); color: var(--brand); }

.floor-canvas-wrap {
  flex: 1;
  min-height: 500px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  overflow: hidden;
  position: relative;
}

.floor-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  padding: 40px;
}

.floor-label {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── TABLE ITEM ── */
.mesa-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--t-fast), filter var(--t-fast);
  user-select: none;
}
.mesa-item:hover { transform: scale(1.06); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.mesa-item:active { transform: scale(0.97); }

.mesa-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── TABLE SURFACE ── */
.mesa-surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--r-md);
  transition: all var(--t-normal);
  border: 2px solid transparent;
  position: relative;
  z-index: 2;
}
.mesa-surface.cuadrada   { width: 80px; height: 72px; }
.mesa-surface.rectangular { width: 116px; height: 72px; }
.mesa-surface.grande     { width: 160px; height: 72px; }
.mesa-surface.redonda    { width: 68px; height: 68px; border-radius: 50%; }
.mesa-surface.barra      { width: 80px; height: 44px; border-radius: var(--r-lg); }

.mesa-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transform-origin: center;
  transition: transform .08s linear;
  pointer-events: none;
}

.mesa-num {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: white;
}
.mesa-cap {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.8;
  color: white;
  display: flex;
  align-items: center;
  gap: 3px;
}
.mesa-mozo {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.75;
  color: white;
  max-width: 90px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ── MESA STATE COLORS ── */
.mesa-libre    .mesa-surface { background: var(--s-libre-bg);    border-color: var(--s-libre-b);    box-shadow: 0 0 20px rgba(34,197,94,0.15); }
.mesa-ocupada  .mesa-surface { background: var(--s-ocupada-bg);  border-color: var(--s-ocupada-b);  box-shadow: 0 0 20px rgba(245,158,11,0.15); }
.mesa-reservada .mesa-surface{ background: var(--s-reservada-bg);border-color: var(--s-reservada-b);box-shadow: 0 0 20px rgba(59,130,246,0.15); }
.mesa-cocina   .mesa-surface { background: var(--s-cocina-bg);   border-color: var(--s-cocina-b);   box-shadow: 0 0 20px rgba(234,179,8,0.2); }
.mesa-listo    .mesa-surface { background: var(--s-listo-bg);    border-color: var(--s-listo-b);    box-shadow: 0 0 20px rgba(168,85,247,0.2); }
.mesa-cuenta   .mesa-surface { background: var(--s-cuenta-bg);   border-color: var(--s-cuenta-b);   box-shadow: 0 0 20px rgba(239,68,68,0.2); }

.mesa-libre    .mesa-num { color: var(--s-libre); }
.mesa-ocupada  .mesa-num { color: var(--s-ocupada); }
.mesa-reservada .mesa-num { color: var(--s-reservada); }
.mesa-cocina   .mesa-num { color: var(--s-cocina); }
.mesa-listo    .mesa-num { color: var(--s-listo); }
.mesa-cuenta   .mesa-num { color: var(--s-cuenta); }

/* ── CHAIRS ── */
.chair {
  position: absolute;
  background: rgba(100,116,139,0.5);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 4px;
  z-index: 1;
  transition: background var(--t-normal);
}
.chair-h { width: 22px; height: 10px; }
.chair-v { width: 10px; height: 22px; }
.chair-r { border-radius: 50%; width: 14px; height: 14px; }

/* cuadrada chairs: 2 top, 2 bottom */
.cuadrada .chair.ct1 { top: -16px; left: 12px; }
.cuadrada .chair.ct2 { top: -16px; left: 40px; }
.cuadrada .chair.cb1 { bottom: -16px; left: 12px; }
.cuadrada .chair.cb2 { bottom: -16px; left: 40px; }

/* rectangular chairs: 3 top, 3 bottom */
.rectangular .chair.ct1 { top: -16px; left: 10px; }
.rectangular .chair.ct2 { top: -16px; left: 44px; }
.rectangular .chair.ct3 { top: -16px; left: 78px; }
.rectangular .chair.cb1 { bottom: -16px; left: 10px; }
.rectangular .chair.cb2 { bottom: -16px; left: 44px; }
.rectangular .chair.cb3 { bottom: -16px; left: 78px; }

/* grande chairs: 4 top, 4 bottom + 2 sides */
.grande .chair.ct1 { top: -16px; left: 10px; }
.grande .chair.ct2 { top: -16px; left: 42px; }
.grande .chair.ct3 { top: -16px; left: 74px; }
.grande .chair.ct4 { top: -16px; left: 106px; }
.grande .chair.cb1 { bottom: -16px; left: 10px; }
.grande .chair.cb2 { bottom: -16px; left: 42px; }
.grande .chair.cb3 { bottom: -16px; left: 74px; }
.grande .chair.cb4 { bottom: -16px; left: 106px; }

/* redonda chairs: top, bottom */
.redonda .chair.ct1 { top: -16px; left: 28px; border-radius: 50%; width: 12px; height: 12px; }
.redonda .chair.cb1 { bottom: -16px; left: 28px; border-radius: 50%; width: 12px; height: 12px; }

/* barra chairs: 1 bottom each */
.barra .chair.ct1 { bottom: -14px; left: 8px; }
.barra .chair.ct2 { bottom: -14px; left: 50px; }

.mesa-item:hover .chair { background: rgba(148,163,184,0.6); }

/* ── STATUS INDICATOR ── */
.mesa-pulse {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 10;
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
}
.mesa-cocina .pulse-dot  { background: var(--s-cocina); animation: pulseAnim 1.5s ease-in-out infinite; }
.mesa-listo  .pulse-dot  { background: var(--s-listo);  animation: pulseAnim 1.5s ease-in-out infinite; }
.mesa-cuenta .pulse-dot  { background: var(--s-cuenta); animation: pulseAnim 1s ease-in-out infinite; }
@keyframes pulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ── LEGEND ── */
.floor-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: 12px 16px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--tx-3);
  font-weight: 500;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =============================================
   PEDIDOS — ORDER CREATION
   ============================================= */
.pedidos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - var(--chrome-h));
}

.productos-panel { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.productos-search { flex-shrink: 0; }
.categoria-tabs-wrap {
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-glass);
}
.categoria-tabs-wrap::-webkit-scrollbar { display: none; }
.categoria-tabs {
  display: flex;
  gap: 0;
  width: max-content;
}
.cat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
  min-height: 38px;
  white-space: nowrap;
}
.cat-tab:hover { color: var(--tx-2); }
.cat-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cat-tab-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; opacity: 0.7; }

.productos-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  align-content: start;
  padding: 4px 2px 4px;
}

.productos-grid--listado {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.productos-grid--listado .producto-card {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(180px, 2fr) auto;
  grid-template-areas: "nombre descripcion footer";
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  gap: 12px;
}

.productos-grid--listado .producto-card-img {
  display: none;
}

.productos-grid--listado .producto-nombre {
  grid-area: nombre;
  font-size: 14px;
}

.productos-grid--listado .producto-desc {
  grid-area: descripcion;
  -webkit-line-clamp: 2;
}

.productos-grid--listado .producto-footer {
  grid-area: footer;
  min-width: 118px;
  justify-content: flex-end;
  gap: 12px;
}

.productos-grid--listado .producto-expand-btn {
  display: none;
}

@media (max-width: 580px) {
  .productos-grid--listado .producto-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "nombre footer"
      "descripcion footer";
    gap: 3px 10px;
  }

  .productos-grid--listado .producto-footer {
    flex-direction: column;
    align-items: flex-end;
    min-width: 88px;
    gap: 3px;
  }
}

.producto-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.producto-card--expandable .producto-nombre { padding-right: 30px; }
.producto-card:hover {
  background: rgba(249,115,22,0.08);
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.producto-card:active { transform: translateY(0); }
.producto-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-1);
  line-height: 1.3;
  overflow: visible;
  overflow-wrap: anywhere;
  display: block;
}
.producto-desc {
  font-size: 11px;
  color: var(--tx-4);
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.producto-card.expanded {
  min-height: 158px;
  z-index: 2;
}
.producto-card.expanded .producto-nombre {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.producto-card.expanded .producto-desc {
  display: block;
  -webkit-line-clamp: unset;
  max-height: 64px;
  overflow-y: auto;
  padding-right: 4px;
}
.producto-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: var(--r-md);
  background: rgba(15,23,42,0.7);
  color: var(--tx-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.producto-expand-btn:hover {
  color: var(--brand);
  border-color: rgba(249,115,22,0.45);
  background: rgba(249,115,22,0.12);
}
.producto-expand-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
}
.producto-card.expanded .producto-expand-btn svg { transform: rotate(180deg); }
.producto-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; min-width: 0; }
.producto-precio { font-size: 15px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.producto-tiempo { font-size: 10px; color: var(--tx-4); display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.producto-tiempo svg { width: 10px; height: 10px; }

/* ── ORDER PANEL ── */
.order-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  overflow: hidden;
}
.order-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order-mesa-info { display: flex; flex-direction: column; }
.order-mesa-num { font-size: 18px; font-weight: 800; color: var(--tx-1); }
.order-meta { font-size: 12px; color: var(--tx-4); }

.order-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--tx-4);
  padding: 40px;
  text-align: center;
}
.order-empty svg { width: 40px; height: 40px; opacity: 0.4; }
.order-empty p { font-size: 13px; }
.order-empty--pedido-tipo {
  align-items: stretch;
  justify-content: flex-start;
  padding: 18px;
}
.pedido-empty-card {
  width: 100%;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  text-align: left;
}
.pedido-empty-icon {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(249,115,22,0.35);
  border-radius: var(--r-md);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249,115,22,0.08);
}
.pedido-empty-icon svg { width: 18px; height: 18px; opacity: 1; }
.pedido-empty-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--tx-1);
}
.pedido-empty-desc {
  max-width: 260px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tx-4);
}
.pedido-empty-card .btn {
  width: max-content;
  margin-top: 4px;
}

.order-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass);
  transition: all var(--t-fast);
}
.order-item:hover { background: rgba(255,255,255,0.06); }
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-size: 13px; font-weight: 600; color: var(--tx-1); }
.order-item-obs { font-size: 11px; color: var(--tx-4); font-style: italic; margin-top: 2px; }
.order-item-price { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.08);
  color: var(--tx-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--border-glass);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.qty-btn:hover { background: rgba(255,255,255,0.15); }
.qty-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx-1);
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.order-footer { padding: 16px 20px; border-top: 1px solid var(--border-glass); display: flex; flex-direction: column; gap: 12px; }
.order-totals { display: flex; flex-direction: column; gap: 6px; }
.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--tx-3);
}
.order-total-row.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--tx-1);
  padding-top: 6px;
  border-top: 1px solid var(--border-glass);
}
.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.order-actions--kitchen-print { grid-template-columns: 1fr auto auto; }

/* =============================================
   COCINA — KDS
   ============================================= */
.cocina-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.cocina-stats { display: flex; gap: 12px; }
.cocina-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
}
.cocina-stat span:first-child { color: var(--tx-4); }

.kds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-content: start;
}

.ticket {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--t-fast);
}
.ticket:hover { transform: translateY(-2px); }

.ticket-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
}
.ticket-mesa { font-size: 16px; font-weight: 800; color: var(--tx-1); }
.ticket-info { font-size: 11px; color: var(--tx-4); margin-top: 2px; }
.ticket-timer {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: var(--r-md);
}
.ticket-timer.ok     { background: var(--s-libre-bg);  color: var(--s-libre); }
.ticket-timer.warn   { background: var(--s-cocina-bg); color: var(--s-cocina); }
.ticket-timer.danger { background: var(--s-cuenta-bg); color: var(--s-cuenta); }

.ticket-items { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ticket-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.03);
  transition: background var(--t-fast);
}
.ticket-item:hover { background: rgba(255,255,255,0.06); }
.ticket-item-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--tx-1);
  min-width: 24px;
  font-variant-numeric: tabular-nums;
}
.ticket-item-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--tx-2); }
.ticket-item-obs { font-size: 11px; color: var(--s-cocina); font-style: italic; margin-top: 2px; }
.ticket-item-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.state-pendiente  { background: var(--tx-4); }
.state-preparando { background: var(--s-cocina); box-shadow: 0 0 6px var(--s-cocina); }
.state-listo      { background: var(--s-listo);  box-shadow: 0 0 6px var(--s-listo); }
.state-entregado  { background: var(--s-libre); }

.ticket-actions { padding: 12px 12px 14px; display: flex; gap: 8px; }

/* =============================================
   CAJA — PAYMENT
   ============================================= */
.caja-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 45%);
  gap: 20px;
  height: calc(100vh - var(--chrome-h));
  min-height: 0;
}

.caja-layout > div:first-child {
  min-height: 0;
  overflow: hidden;
}

.cuentas-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.cuenta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.cuenta-card:hover { border-color: var(--brand); background: rgba(249,115,22,0.06); }
.cuenta-card.selected { border-color: var(--brand); background: var(--brand-dim); }
.cuenta-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.cuenta-mesa { font-size: 16px; font-weight: 800; color: var(--tx-1); }
.cuenta-mozo { font-size: 12px; color: var(--tx-4); margin-top: 2px; }
.cuenta-total-preview { font-size: 20px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.cuenta-items-preview { font-size: 12px; color: var(--tx-4); }

.payment-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
.payment-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-glass);
}
.payment-title { font-size: 18px; font-weight: 800; color: var(--tx-1); }
.payment-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.payment-items { display: flex; flex-direction: column; gap: 6px; }
.payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--tx-2);
}
.payment-item-price { font-weight: 700; color: var(--tx-1); font-variant-numeric: tabular-nums; }

.payment-methods { display: flex; flex-direction: column; gap: 8px; }
.payment-method-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--tx-4); margin-bottom: 4px; }
.payment-methods-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.04);
  color: var(--tx-3);
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 12px;
  font-weight: 600;
}
.pay-method-btn svg { width: 22px; height: 22px; }
.pay-method-btn:hover { background: rgba(255,255,255,0.08); color: var(--tx-1); }
.pay-method-btn.selected { background: var(--brand-dim); color: var(--brand); border-color: var(--brand); }
.payment-debt-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: var(--r-md);
  background: rgba(249, 115, 22, 0.08);
  color: var(--brand);
  font-size: 12px;
  line-height: 1.35;
}
.payment-debt-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.payment-difference {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
}
.payment-difference div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payment-difference span,
.payment-difference small {
  font-size: 11px;
  color: var(--tx-4);
  line-height: 1.35;
}
.payment-difference strong {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tx-1);
}
.payment-difference.negative {
  border-color: var(--s-cuenta-b);
  background: var(--s-cuenta-bg);
}
.payment-difference.negative strong { color: var(--s-cuenta); }
.payment-difference.positive {
  border-color: var(--s-libre-b);
  background: var(--s-libre-bg);
}
.payment-difference.positive strong { color: var(--s-libre); }
.pay-collapsible {
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: 12px;
  background: rgba(255,255,255,0.03);
}
.pay-collapsible > summary {
  cursor: pointer;
  margin-bottom: 0;
  list-style-position: inside;
}
.pay-collapsible[open] > summary {
  margin-bottom: 4px;
}
.payment-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.payment-section-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.payment-discount-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(92px, .65fr);
  gap: 8px;
  align-items: end;
}
.payment-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(86px, .8fr) auto;
  gap: 8px;
  align-items: center;
}
.payment-charge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.payment-charge-row .input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(180px, 100%);
  font-size: 12px;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.discount-row .input { flex: 1; }
.discount-label { font-size: 12px; color: var(--tx-4); font-weight: 500; }

.payment-summary {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.payment-total-big {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.payment-total-big span:first-child { font-size: 16px; font-weight: 600; color: var(--tx-2); }
.payment-total-big .amount { font-size: 32px; font-weight: 800; color: var(--s-libre); font-variant-numeric: tabular-nums; }

.payment-footer { padding: 16px 20px; border-top: 1px solid var(--border-glass); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.caja-admin-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--chrome-h) - 48px);
  min-height: 0;
  overflow: hidden;
}

.caja-admin-tabs {
  flex-shrink: 0;
  padding: 0 20px;
}

.caja-admin-cuentas {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.caja-admin-cuentas .caja-layout {
  flex: 1;
  height: 100%;
  min-height: 0;
}

.arqueos-table .menu-table-row {
  cursor: pointer;
}

.arqueos-table .menu-table-row:hover,
.arqueos-table .menu-table-row.selected {
  background: rgba(249,115,22,0.06);
}

.menu-table-header.arqueos-row-grid,
.menu-table-row.arqueos-row-grid {
  grid-template-columns: 1.1fr 1.1fr .9fr .9fr .9fr 120px;
}

.arqueo-detail-panel {
  max-height: none;
}

/* =============================================
   MENU — PRODUCT MANAGEMENT
   ============================================= */
.menu-layout { display: flex; flex-direction: column; gap: 16px; }
.menu-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.menu-filters { display: flex; align-items: center; gap: 10px; }

.menu-table {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.menu-table-header, .menu-table-row {
  display: grid;
  grid-template-columns: 1fr 140px 100px 80px 100px 120px;
  align-items: center;
  padding: 12px 20px;
  gap: 12px;
}
.menu-table-header {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border-glass);
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.menu-table-row {
  border-bottom: 1px solid rgba(51,65,85,0.3);
  font-size: 13px;
  color: var(--tx-2);
  transition: background var(--t-fast);
}
.menu-table-row:last-child { border-bottom: none; }
.menu-table-row:hover { background: rgba(255,255,255,0.03); }
.menu-table-row .name { font-weight: 600; color: var(--tx-1); }
.menu-table-row .price { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.price-admin {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.price-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.price-admin-search {
  width: min(420px, 100%);
  margin-right: auto;
}
.price-admin-filter {
  width: 190px;
}
.price-admin-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  background: var(--bg-card);
}
.price-admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(145px, .75fr) minmax(120px, .65fr) minmax(132px, .7fr) minmax(132px, .7fr) minmax(132px, .7fr) 104px;
  min-width: 1120px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(51,65,85,0.3);
  font-size: 13px;
  color: var(--tx-2);
}
.price-admin-row:last-child { border-bottom: none; }
.price-admin-row.dirty {
  background: rgba(249,115,22,0.055);
}
.price-admin-head {
  padding-block: 8px;
  background: rgba(255,255,255,0.04);
}
.price-admin-head button,
.price-admin-head span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--tx-4);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
}
.price-admin-head button {
  cursor: pointer;
}
.price-admin-head button:hover { color: var(--tx-2); }
.price-admin-row .name {
  font-weight: 700;
  color: var(--tx-1);
}
.price-admin-desc {
  margin-top: 2px;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--tx-4);
}
.price-admin-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
}
.price-admin-cat span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.price-admin-system {
  font-weight: 800;
  color: var(--tx-2);
  font-variant-numeric: tabular-nums;
}
.price-admin-input {
  height: 36px;
  min-width: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.price-admin-final {
  color: var(--brand);
  font-weight: 800;
}
.price-admin-margin-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
}
.price-admin-margin-field span {
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ingredient-list-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ingredient-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ingredient-list-search {
  width: min(460px, 100%);
}
.ingredient-list-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  background: var(--bg-card);
}
.ingredient-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(130px, .85fr) minmax(116px, .7fr) minmax(105px, .65fr) minmax(116px, .7fr) minmax(106px, .65fr) minmax(150px, .95fr) minmax(108px, .65fr) 104px;
  min-width: 1120px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(51,65,85,0.3);
}
.ingredient-list-row:last-child { border-bottom: none; }
.ingredient-list-head {
  background: rgba(255,255,255,0.04);
  padding-block: 8px;
}
.ingredient-list-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--tx-4);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
}
.ingredient-list-sort:hover { color: var(--tx-2); }
.ingredient-list-input {
  min-width: 0;
  height: 36px;
  font-size: 12px;
}
.ingredient-list-stock {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx-2);
  font-variant-numeric: tabular-nums;
}
.ingredient-list-muted {
  margin-top: 2px;
  font-size: 11px;
  color: var(--tx-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ingredient-list-active {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--tx-3);
}
@media (max-width: 720px) {
  .ingredient-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .ingredient-list-search {
    width: 100%;
  }
}
.clientes-list-row {
  grid-template-columns: minmax(160px, 1.35fr) minmax(94px, .9fr) minmax(52px, .45fr) minmax(82px, .65fr) minmax(126px, .9fr) 44px;
}
.clientes-list-saldo {
  min-width: 126px;
}
.clientes-list-table .badge-saldo-debe,
.clientes-list-table .badge-saldo-aldia,
.clientes-list-table .badge-saldo-favor {
  white-space: nowrap;
}
.menu-import {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.menu-import-drop {
  padding: 14px;
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.03);
}
.menu-import-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.025);
}
.menu-import-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--tx-1);
  text-transform: uppercase;
}
.menu-import-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.menu-import-columns span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(249,115,22,.12);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}
.menu-import-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--tx-3);
}
.menu-import-sample {
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.menu-import-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr .7fr 1fr 1fr .6fr;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(51,65,85,.35);
  color: var(--tx-3);
  font-size: 12px;
}
.menu-import-row:last-child { border-bottom: none; }
.menu-import-row--head {
  background: rgba(255,255,255,.05);
  color: var(--tx-1);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}
.status-pill.active   { background: var(--s-libre-bg); color: var(--s-libre); }
.status-pill.inactive { background: rgba(100,116,139,0.1); color: var(--tx-4); }
.row-actions { display: flex; gap: 6px; }

/* =============================================
   REPORTES — REPORTS
   ============================================= */
.reportes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 20px;
}
.chart-title { font-size: 15px; font-weight: 600; color: var(--tx-1); margin-bottom: 4px; }
.chart-subtitle { font-size: 12px; color: var(--tx-4); margin-bottom: 16px; }

.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: var(--tx-3); min-width: 80px; text-align: right; }
.bar-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.bar-val { font-size: 11px; color: var(--tx-4); min-width: 50px; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; gap: 20px; align-items: center; }
.donut-svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx-2); }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-val { margin-left: auto; font-weight: 700; color: var(--tx-1); font-variant-numeric: tabular-nums; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  --modal-viewport-gap: clamp(16px, 6vh, 64px);
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--modal-viewport-gap) 24px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity var(--t-normal);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-2xl);
  width: 80%;
  max-height: calc(100vh - (var(--modal-viewport-gap) * 2));
  max-height: calc(100dvh - (var(--modal-viewport-gap) * 2));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--t-normal);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--tx-1); }
.modal-subtitle { font-size: 13px; color: var(--tx-4); margin-top: 2px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.07);
  color: var(--tx-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--tx-1); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 20px 24px; overflow-y: auto; overscroll-behavior-y: contain; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-glass); display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 580px) {
  .modal-overlay {
    --modal-viewport-gap: max(12px, env(safe-area-inset-top, 0px));
    padding-inline: 12px;
  }
  .modal {
    width: 100%;
    border-radius: var(--r-xl);
  }
}

/* ── MODAL INNER TABS (product form) ── */
.modal-inner-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-glass);
  margin: -20px -24px 20px;
  padding: 0 24px;
}
.modal-inner-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.modal-inner-tab:hover { color: var(--tx-2); }
.modal-inner-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.modal-tab-panel { display: none; flex-direction: column; gap: 14px; }
.modal-tab-panel.active { display: flex; }

/* ── MODIFIER DRAG & DROP ── */
.modifier-group-editor {
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: 12px;
  background: rgba(255,255,255,.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--t-fast), opacity var(--t-fast);
}
.modifier-group-editor.drag-over { box-shadow: 0 0 0 2px var(--brand); }
.modifier-group-editor.dragging { opacity: 0.4; }

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 32px;
  cursor: grab;
  color: var(--tx-4);
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.drag-handle:hover { color: var(--tx-2); background: rgba(255,255,255,0.06); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 14px; height: 14px; }

.mod-group-header {
  display: grid;
  grid-template-columns: 24px 1.1fr .8fr 72px 72px auto;
  gap: 8px;
  align-items: end;
}
.mod-option-row {
  display: grid;
  grid-template-columns: 20px 1fr 120px auto;
  gap: 8px;
  align-items: center;
  transition: opacity var(--t-fast);
}
.mod-option-row.dragging { opacity: 0.4; }
.mod-option-row.drag-over-top { border-top: 2px solid var(--brand); }
.mod-option-row.drag-over-bottom { border-bottom: 2px solid var(--brand); }

select.input {
  color: var(--tx-1);
  background-color: var(--bg-3);
  color-scheme: dark;
  appearance: auto;
}

select.input option,
select.input optgroup {
  color: #e5e7eb;
  background-color: #111827;
}

/* ── TABLE DETAIL MODAL ── */
.table-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  margin-bottom: 4px;
}
.table-status-bar.libre    { background: var(--s-libre-bg);    border: 1px solid var(--s-libre-b); }
.table-status-bar.ocupada  { background: var(--s-ocupada-bg);  border: 1px solid var(--s-ocupada-b); }
.table-status-bar.cocina   { background: var(--s-cocina-bg);   border: 1px solid var(--s-cocina-b); }
.table-status-bar.listo    { background: var(--s-listo-bg);    border: 1px solid var(--s-listo-b); }
.table-status-bar.cuenta   { background: var(--s-cuenta-bg);   border: 1px solid var(--s-cuenta-b); }
.table-status-bar.reservada{ background: var(--s-reservada-bg);border: 1px solid var(--s-reservada-b); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-key { font-size: 11px; color: var(--tx-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.info-val { font-size: 15px; font-weight: 700; color: var(--tx-1); }

/* =============================================
   TOASTS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--tx-1);
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
  cursor: pointer;
}
.toast.out { animation: toastOut 0.3s cubic-bezier(0.4,0,0.2,1) forwards; }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--s-libre); }
.toast-error   { border-left: 3px solid var(--s-cuenta); }
.toast-info    { border-left: 3px solid var(--brand); }
.toast-warning { border-left: 3px solid var(--s-cocina); }
.toast-success .toast-icon { color: var(--s-libre); }
.toast-error   .toast-icon { color: var(--s-cuenta); }
.toast-info    .toast-icon { color: var(--brand); }
.toast-warning .toast-icon { color: var(--s-cocina); }

.update-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  width: min(420px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--tx-1);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
}

.update-notice[hidden] { display: none; }
.update-notice-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.update-notice-copy strong { font-size: 13px; }
.update-notice-copy span { color: var(--tx-3); font-size: 12px; line-height: 1.35; }
.update-notice .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .update-notice {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
  }
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* =============================================
   UTILITIES
   ============================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-muted { color: var(--tx-4); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Section heading */
.section-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--tx-1);
  letter-spacing: -0.4px;
}

/* =============================================
   RESPONSIVE — Tablet (768px)
   ============================================= */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid-bottom { grid-template-columns: 1fr; }
  .reportes-grid { grid-template-columns: 1fr 1fr; }
  .pedidos-layout { grid-template-columns: 1fr 340px; }
  .caja-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 45%); }
  .menu-table-header,
  .menu-table-row { grid-template-columns: 1fr 120px 90px 80px 100px; }
  .clientes-list-row {
    grid-template-columns: minmax(150px, 1.2fr) minmax(90px, .75fr) minmax(50px, .4fr) minmax(78px, .55fr) minmax(128px, .9fr);
  }
  .menu-table-header > *:last-child,
  .menu-table-row > *:last-child { display: none; }
  .menu-import-sample { overflow-x: auto; }
  .menu-import-row { min-width: 560px; }
}

@media (max-width: 900px) {
  .payment-sections-grid { grid-template-columns: 1fr; }
  .payment-discount-grid { grid-template-columns: minmax(0, 1.35fr) minmax(92px, .65fr); }
}

@media (max-width: 768px) {
  .gf-navtabs { display: none; }
  .topbar-center { display: none; }
  #mobile-menu { display: flex !important; }
  .gf-topbar { padding: 0 12px; }
  .gf-content { padding: 12px 14px; padding-bottom: calc(var(--bottom-nav-h) + 16px); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .pedidos-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .caja-layout { grid-template-columns: 1fr; height: auto; }
  .caja-admin-view { height: auto; overflow: visible; }
  .caja-admin-cuentas { overflow: visible; }
  .payment-panel { height: auto; }
  .payment-sections-grid,
  .payment-discount-grid { grid-template-columns: 1fr; }
  .payment-split-row { grid-template-columns: minmax(0, 1fr) minmax(84px, .7fr) auto; }
  .order-panel { height: 400px; }
  .order-actions--kitchen-print { grid-template-columns: 1fr; }
  .kds-grid { grid-template-columns: 1fr; }
  .sector-tab span:last-child { display: none; }
}


/* =============================================
   EXTENSIONS — Login · Equipo · Mi Cuenta · Mi Negocio · Drag&Drop
   ============================================= */

/* â”€â”€ MOBILE OVERLAY â”€â”€ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }

/* â”€â”€ BOTTOM NAV (mobile app feel) â”€â”€ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--tx-4);
  cursor: pointer;
  transition: color var(--t-fast);
  font-size: 10px;
  font-weight: 600;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--brand); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--brand);
  border-radius: 0 0 2px 2px;
}
.bottom-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--s-cuenta);
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-0);
}

/* ── HISTORIAL DE PEDIDOS ── */
.hist-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  height: calc(100vh - var(--chrome-h) - 120px);
  min-height: 400px;
}
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding-right: 4px;
}
.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.hist-row:hover { background: var(--bg-2); }
.hist-row.active { background: var(--brand-dim); border-color: var(--brand); }
.hist-row-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hist-num {
  font-size: 13px; font-weight: 700; color: var(--brand);
  min-width: 36px; flex-shrink: 0;
}
.hist-info { min-width: 0; }
.hist-quien { font-size: 13px; font-weight: 600; color: var(--tx-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 11px; color: var(--tx-4); }
.hist-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.hist-total { font-size: 13px; font-weight: 700; color: var(--tx-1); }

.hist-detail {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hist-empty-detail {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--tx-4);
}
.hist-empty-icon svg { width: 40px; height: 40px; opacity: 0.3; }
.hist-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hist-detail-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--tx-1);
}
.hist-detail-title svg { width: 20px; height: 20px; color: var(--tx-3); }
.hist-detail-num { color: var(--brand); }
.hist-detail-fecha { font-size: 12px; color: var(--tx-4); flex-shrink: 0; }
.hist-detail-cliente {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--tx-2);
}
.hist-detail-cliente svg { width: 16px; height: 16px; color: var(--tx-4); flex-shrink: 0; }
.hist-items {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
}
.hist-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 0;
}
.hist-item-name { font-size: 13px; color: var(--tx-1); font-weight: 500; }
.hist-item-obs { color: var(--tx-4); font-weight: 400; font-style: italic; }
.hist-item-right { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; }
.hist-item-qty { font-size: 12px; color: var(--tx-4); }
.hist-item-price { font-size: 13px; font-weight: 600; color: var(--tx-2); }
.hist-totals {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
  margin-top: auto;
}
.hist-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--tx-3);
}
.hist-total-row.total { font-size: 16px; font-weight: 700; color: var(--tx-1); }
.hist-total-row.medios { margin-top: 4px; }

@media (max-width: 768px) {
  .hist-layout { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .hist-detail { display: none; }
  .hist-layout.detail-open .hist-list { display: none; }
  .hist-layout.detail-open .hist-detail { display: flex; }
}

/* ── MORE SHEET (mobile bottom sheet for extra nav items) ── */
.more-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
}
.more-sheet {
  width: 100%;
  background: var(--bg-1);
  border-top: 1px solid var(--border-glass);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 16px calc(var(--bottom-nav-h) + 8px);
  transform: translateY(100%);
  transition: transform var(--t-normal);
}
.more-sheet.open { transform: translateY(0); }
.more-sheet-handle {
  width: 36px; height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.more-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.more-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--tx-3);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.more-sheet-item:active { background: var(--brand-dim); }
.more-sheet-item.active { color: var(--brand); }
.more-sheet-icon { width: 24px; height: 24px; }
.more-sheet-icon svg { width: 24px; height: 24px; }

body.light-mode .more-sheet { background: var(--bg-1); }
body.light-mode .more-sheet-overlay { background: rgba(15, 23, 42, 0.4); }

/* ── LOGIN SCREEN ── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.login-card {
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 48px);
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-2xl);
  padding: 36px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--brand-glow);
}
.login-logo img { width: 100%; height: 100%; display: block; }
.login-title { font-size: 24px; font-weight: 800; color: var(--tx-1); letter-spacing: -0.5px; }
.login-subtitle { font-size: 13px; color: var(--tx-4); }
.login-negocio { font-size: 16px; font-weight: 700; color: var(--brand); }
.profile-user-badge { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: 0.5px; margin-top: 2px; }

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #EF4444;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.login-error svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  18%  { transform: translateX(-8px); }
  36%  { transform: translateX(8px); }
  54%  { transform: translateX(-5px); }
  72%  { transform: translateX(4px); }
  90%  { transform: translateX(-2px); }
}
.login-card.shake { animation: loginShake 0.42s ease; }

.login-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.login-users { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.login-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  width: 100%;
}
.login-user-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--brand); }
.login-user-btn.selected { background: var(--brand-dim); border-color: var(--brand); }
.login-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}
.login-user-info { flex: 1; min-width: 0; }
.login-user-name { font-size: 14px; font-weight: 600; color: var(--tx-1); }
.login-user-role { font-size: 11px; color: var(--tx-4); margin-top: 1px; }
.login-role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* â”€â”€ REGISTRO 2 COLUMNAS â”€â”€ */
.login-card--wide { max-width: min(680px, calc(100vw - 32px)); }
.rg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.rg-col-full { grid-column: 1 / -1; }
.rg-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 2px;
}
.rg-codigo-wrap { position: relative; }
.rg-codigo-wrap .input { padding-right: 108px; }
.codigo-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  pointer-events: none;
  white-space: nowrap;
}
.codigo-badge--auto     { background: rgba(249,115,22,0.12); color: #F97316; }
.codigo-badge--ok       { background: rgba(34,197,94,0.15);  color: #22C55E; }
.codigo-badge--taken    { background: rgba(239,68,68,0.15);  color: #EF4444; }
.codigo-badge--checking { background: rgba(255,255,255,0.07); color: var(--tx-4); }
.rg-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 580px) {
  .login-screen {
    align-items: flex-start;
    padding: 14px;
  }
  .login-card {
    max-height: none;
    border-radius: var(--r-xl);
    padding: 24px;
  }
  .login-card--wide { max-width: 100%; }
  .rg-grid { grid-template-columns: 1fr; }
  .rg-col-full { grid-column: 1; }
  .rg-codigo-wrap .input { padding-right: 88px; }
  .codigo-badge {
    right: 8px;
    font-size: 10px;
    padding: 3px 7px;
  }
}
@media (max-height: 760px) and (min-width: 581px) {
  .login-screen {
    align-items: flex-start;
    padding-block: 16px;
  }
  .login-card {
    gap: 18px;
    padding: 28px 36px;
  }
  .login-card--wide .login-brand {
    gap: 8px;
  }
  .login-card--wide .login-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
  .login-card--wide .login-title { font-size: 22px; }
  .rg-grid { gap: 14px 20px; }
  .rg-actions .btn-lg {
    min-height: 48px;
    padding-block: 12px;
  }
}

/* â”€â”€ EQUIPO â”€â”€ */
.equipo-layout { display: flex; flex-direction: column; gap: 16px; }
.equipo-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.equipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.usuario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.usuario-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.usuario-card.inactivo { opacity: 0.5; }
.usuario-card-top { display: flex; align-items: center; gap: 12px; }
.usuario-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
}
.usuario-info { flex: 1; min-width: 0; }
.usuario-nombre { font-size: 15px; font-weight: 700; color: var(--tx-1); }
.usuario-email { font-size: 11px; color: var(--tx-4); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usuario-turno {
  font-size: 11px;
  color: var(--tx-3);
  background: rgba(255,255,255,0.05);
  padding: 3px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.usuario-actions { display: flex; gap: 6px; margin-top: auto; }

/* â”€â”€ ROLE BADGES â”€â”€ */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.role-dueno    { background: rgba(249,115,22,0.15); color: #F97316; }
.role-admin    { background: rgba(59,130,246,0.15);  color: #3B82F6; }
.role-encargado{ background: rgba(236,72,153,0.15); color: #EC4899; }
.role-cajero   { background: rgba(34,197,94,0.15);  color: #22C55E; }
.role-mozo     { background: rgba(168,85,247,0.15); color: #A855F7; }
.role-cocinero { background: rgba(234,179,8,0.15);  color: #EAB308; }

/* â”€â”€ MI CUENTA â”€â”€ */
.micuenta-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
@media (max-width: 900px) { .micuenta-layout { grid-template-columns: 1fr; } }

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  border: 3px solid var(--border-light);
  position: relative;
  cursor: pointer;
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mc-avatar-drop {
  min-height: 96px;
  border: 1px dashed rgba(148,163,184,0.45);
  border-radius: var(--r-lg);
  background: rgba(15,23,42,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  color: var(--tx-3);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.mc-avatar-drop:hover,
.mc-avatar-drop.dragging,
.mc-avatar-drop.has-file {
  border-color: var(--brand);
  background: var(--brand-dim);
  color: var(--tx-1);
}
.mc-avatar-drop-icon svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}
.mc-avatar-drop-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.mc-avatar-drop-hint {
  font-size: 11px;
  color: var(--tx-4);
}
.profile-avatar-lg .avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-0);
}
.profile-avatar-lg .avatar-edit svg { width: 10px; height: 10px; color: white; }
.profile-name { font-size: 18px; font-weight: 800; color: var(--tx-1); }
.profile-email { font-size: 13px; color: var(--tx-4); }
.profile-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.profile-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}
.profile-stat-val { font-size: 18px; font-weight: 800; color: var(--brand); }
.profile-stat-label { font-size: 10px; color: var(--tx-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

.profile-form { display: flex; flex-direction: column; gap: 16px; }
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx-1);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title svg { width: 16px; height: 16px; color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* â”€â”€ MI NEGOCIO â”€â”€ */
.minegocio-layout { display: flex; flex-direction: column; gap: 16px; }
.negocio-header-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(239,68,68,0.1));
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--r-2xl);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.negocio-logo-box {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--brand), #EF4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  position: relative;
  box-shadow: var(--brand-glow);
}
.negocio-logo-box .edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.negocio-logo-box:hover .edit-overlay { opacity: 1; }
.edit-overlay svg { width: 20px; height: 20px; color: white; }
.negocio-info h2 { font-size: 22px; font-weight: 800; color: var(--tx-1); }
.negocio-info p { font-size: 13px; color: var(--tx-3); margin-top: 4px; }
.negocio-config-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 768px) { .negocio-config-grid { grid-template-columns: 1fr; } }

.pedido-channel-bar {
  display: flex;
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--border-glass);
}
.pedido-channel-bar .btn {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -1px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-4) !important;
  min-height: 40px;
  gap: 7px;
  transition: color var(--t-fast), border-color var(--t-fast) !important;
}
.pedido-channel-bar .btn:hover { color: var(--tx-2) !important; }
.pedido-channel-bar .btn.btn-primary,
.pedido-channel-bar .btn.btn-brand {
  color: var(--brand) !important;
  border-bottom-color: var(--brand) !important;
}
.mn-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  border-bottom: 1px solid var(--border-glass);
  scrollbar-width: none;
}
.mn-tabs::-webkit-scrollbar { display: none; }
.mn-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--tx-4);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.mn-tab svg { width: 16px; height: 16px; }
.mn-tab:hover { color: var(--tx-2); }
.mn-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: transparent;
}
.mn-tab-content { display: block; }
.mn-tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.mn-tab-panel.active { display: flex; }
.mn-unsaved-warning {
  display: none;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  padding: 10px 12px;
  border: 1px solid rgba(234,179,8,.38);
  border-radius: var(--r-md);
  background: rgba(234,179,8,.12);
  color: #FACC15;
  font-size: 13px;
  font-weight: 800;
}
.mn-unsaved-warning.active { display: flex; }
.mn-unsaved-warning svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.mn-hours-list,
.mn-list-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mn-hour-row,
.mn-list-row,
.mn-tag-add {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mn-hour-day {
  width: 92px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tx-2);
  font-size: 13px;
  font-weight: 700;
}
.mn-hour-row .input { max-width: 130px; }
.mn-hour-sep {
  color: var(--tx-4);
  font-size: 12px;
  font-weight: 700;
}
.mn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.mn-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(249,115,22,0.35);
  border-radius: var(--r-md);
  background: var(--brand-dim);
  color: var(--tx-1);
  font-size: 12px;
  font-weight: 700;
}
.mn-tag-chip button {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-3);
}
.mn-tag-chip button svg { width: 14px; height: 14px; }
.mn-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.config-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-card-title svg { width: 16px; height: 16px; color: var(--brand); }

/* â”€â”€ DRAG & DROP EDIT MODE â”€â”€ */
.edit-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(234,179,8,0.1);
  border: 1px dashed rgba(234,179,8,0.4);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--s-cocina);
  margin-bottom: 8px;
}
.edit-mode-bar svg { width: 16px; height: 16px; }

.floor-canvas.edit-mode { cursor: default; }
.floor-canvas.edit-mode .mesa-item {
  cursor: grab;
  outline: 1px dashed rgba(234,179,8,0.3);
  border-radius: var(--r-md);
}
.floor-canvas.edit-mode .mesa-item:active { cursor: grabbing; }
.floor-canvas.edit-mode .mesa-item:hover { outline-color: var(--s-cocina); }

/* â”€â”€ PRODUCT IMAGES â”€â”€ */
.producto-card-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--bg-3);
}
.producto-card-img-placeholder {
  width: 100%;
  height: 80px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.img-upload-area:hover { border-color: var(--brand); }
.img-upload-area svg { width: 28px; height: 28px; color: var(--tx-4); }
.img-upload-area p { font-size: 12px; color: var(--tx-4); }

/* â”€â”€ COLOR PICKER â”€â”€ */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-fast);
}
.color-option.selected { border-color: white; transform: scale(1.2); }
.color-option:hover { transform: scale(1.1); }

/* â”€â”€ TURNO SELECT â”€â”€ */
.turno-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.turno-pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.04);
  color: var(--tx-3);
  transition: all var(--t-fast);
}
.turno-pill.selected {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--brand);
}

/* â”€â”€ PERMISOS GRID â”€â”€ */
.permisos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.permiso-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tx-3);
}
.permiso-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.permiso-check.on { background: var(--s-libre); }
.permiso-check.on svg { width: 10px; height: 10px; color: #052e16; }
.permiso-check.off { background: rgba(255,255,255,0.06); border: 1px solid var(--border); }

/* â”€â”€ MOBILE IMPROVEMENTS â”€â”€ */
@media (max-width: 768px) {
  .equipo-grid { grid-template-columns: 1fr; }
  .negocio-config-grid { grid-template-columns: 1fr; }
  .micuenta-layout { grid-template-columns: 1fr; }
  .negocio-header-card { flex-direction: column; text-align: center; }
  .mn-hour-row { align-items: flex-start; flex-wrap: wrap; }
  .mn-hour-day { width: 100%; }
  .mn-hour-row .input { flex: 1 1 120px; max-width: none; }
  .mn-tag-add { flex-direction: column; align-items: stretch; }
  .mn-actions { position: sticky; bottom: calc(var(--bottom-nav-h, 0px) + 8px); background: var(--bg-glass); padding: 10px; border: 1px solid var(--border-glass); border-radius: var(--r-lg); }
  .reportes-grid { grid-template-columns: 1fr; }

  /* Topbar mobile: show only icon + title */
  .time-display { display: none; }
  .top-btn-help span { display: none; }
  .top-btn-help { width: 40px; padding: 8px; justify-content: center; }
  .top-btn-brand span { display: none; }
  .top-btn-brand { min-width: 40px; padding: 8px; }

  .help-intro { grid-template-columns: 1fr; }
  .help-flow { justify-content: flex-start; }
  .help-card { min-height: 0; }

  /* Pedidos mobile: tabs scroll + order below */
  .pedidos-layout { display: flex; flex-direction: column; gap: 14px; }
  .productos-panel { min-height: 300px; }

  /* Caja mobile: stack */
  .caja-layout { display: flex; flex-direction: column; }

  /* Dashboard grid: 2 cols on mobile */
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-value { font-size: 22px; }

  /* Floor canvas: smaller padding */
  .floor-canvas { padding: 20px; min-height: 420px; }

  /* Menu table: hide some columns */
  .menu-table-header > *:nth-child(4),
  .menu-table-row > *:nth-child(4) { display: none; }
  .clientes-list-row {
    grid-template-columns: minmax(150px, 1.2fr) minmax(86px, .7fr) minmax(50px, .4fr) minmax(128px, .9fr);
  }
  .clientes-list-table .menu-table-header > *:nth-child(4),
  .clientes-list-table .menu-table-row > *:nth-child(4) { display: none; }

  /* Sector tabs: compact */
  .sector-tabs { width: 100%; overflow-x: auto; }
  .sector-tab { padding: 7px 12px; font-size: 12px; }
}

/* â”€â”€ SAFE AREA (notch/home indicator) â”€â”€ */
.bottom-nav {
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}
.gf-content {
  padding-bottom: calc(var(--bottom-nav-h, 0px) + env(safe-area-inset-bottom, 0px) + 24px);
}

/* â”€â”€ SECTION NAV GROUP â”€â”€ */
.nav-group-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 8px 0;
}

/* â”€â”€ INPUT TEXTAREA â”€â”€ */
textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* â”€â”€ STATUS DOT INLINE â”€â”€ */
.status-dot-inline {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}



/* =============================================
   V4 — Sidebar · Salon · Pedidos layout · Cart sheet
   ============================================= */
/* â”€â”€ SIDEBAR: toggle visible en colapsado â”€â”€ */
.gf-sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
/* Ocultar usuario al colapsar para que el chevron tenga espacio */
.gf-sidebar.collapsed .sidebar-user { display: none; }
/* El botÃ³n chevron centrado y siempre visible */
.gf-sidebar.collapsed .sidebar-toggle {
  margin-left: auto;
  margin-right: auto;
}
.gf-sidebar.collapsed .sidebar-footer > div {
  justify-content: center !important;
}

/* â”€â”€ OVERLAY: solo bloquea contenido, no el topbar â”€â”€ */
.sidebar-overlay {
  z-index: 110; /* por debajo del topbar en mobile */
}
/* Topbar sobre el overlay en mobile */
@media (max-width: 768px) {
  .gf-topbar { z-index: 130; }
  .gf-sidebar { z-index: 200; }
}

/* â”€â”€ SALÃ“N: contenedor multi-sector con scroll Y â”€â”€ */
.floor-all-sectors {
  --floor-touch-w: 900px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  /* Scroll suave tipo app */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  touch-action: pan-x pan-y;
}
.floor-all-sectors::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.floor-all-sectors::-webkit-scrollbar-track {
  background: rgba(15,23,42,.45);
  border-radius: 999px;
}
.floor-all-sectors::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.65);
  border: 2px solid rgba(15,23,42,.45);
  border-radius: 999px;
}
.floor-all-sectors::-webkit-scrollbar-thumb:hover {
  background: rgba(203,213,225,.8);
}

.floor-legend-bar {
  position: sticky;
  bottom: 0;
  right: 0;
  margin-top: auto;
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-glass);
  flex-shrink: 0;
  z-index: 8;
}

.floor-sector-section {
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
  min-width: var(--floor-touch-w);
}
.floor-sector-section:last-child { border-bottom: none; }

.floor-sector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}
.floor-sector-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.floor-sector-stats {
  font-size: 11px;
  color: var(--tx-4);
  display: flex;
  gap: 10px;
  align-items: center;
}
.floor-sector-stats span { display: flex; align-items: center; gap: 4px; }

.floor-sector-section .floor-canvas {
  position: relative;
  width: 100%;
  min-width: var(--floor-touch-w);
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  padding: 32px 24px;
}

/* â”€â”€ SALÃ“N: wrapper ajustado â”€â”€ */
.salon-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - var(--chrome-h));
  min-height: 0;
}
@media (max-width: 768px) {
  .floor-all-sectors {
    --floor-touch-w: 840px;
  }
  .salon-wrapper {
    height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h, 64px) - 24px);
  }
}

@media (max-width: 480px) {
  .floor-all-sectors {
    --floor-touch-w: 760px;
  }
}

/* â”€â”€ PEDIDOS: mesa header arriba del todo â”€â”€ */
.pedidos-v4 {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - var(--chrome-h));
  min-height: 0;
}
@media (max-width: 768px) {
  .pedidos-v4 {
    height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h, 64px) - 24px);
  }
}

/* Mesa sticky header */
.pedidos-mesa-header {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.pedidos-mesa-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--tx-1);
}
.pedidos-mesa-meta { font-size: 12px; color: var(--tx-4); margin-top: 1px; }

/* Cart badge */
.cart-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-lg);
  background: var(--brand-dim);
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.cart-badge-btn:hover { background: var(--brand); color: white; }
.cart-badge-btn svg { width: 16px; height: 16px; }

/* Products area */
.pedidos-productos-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

/* Desktop: side by side */
@media (min-width: 769px) {
  .pedidos-v4 {
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-rows: 1fr;
    gap: 16px;
    height: calc(100vh - var(--chrome-h));
  }
  .pedidos-mesa-header { display: none; } /* en desktop el header queda en el panel derecho */
  .pedidos-productos-area { gap: 12px; }
}

/* â”€â”€ CARRITO SLIDE-UP (mobile) â”€â”€ */
.cart-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
}
.cart-sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cart-sheet {
  width: 100%;
  max-height: 80dvh;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--t-normal);
  overflow: hidden;
}
.cart-sheet-overlay.open .cart-sheet {
  transform: translateY(0);
}
.cart-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.cart-sheet-header {
  padding: 12px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.cart-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-sheet-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* â”€â”€ ENTREGA: badge listo pulsante â”€â”€ */
.entrega-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--s-listo-bg);
  border: 1px solid var(--s-listo-b);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--s-listo);
  animation: alertPulse 2s ease-in-out infinite;
}
@keyframes alertPulse {
  0%, 100% { border-color: var(--s-listo-b); }
  50%       { border-color: var(--s-listo); box-shadow: 0 0 12px rgba(168,85,247,0.2); }
}
.entrega-alert svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ══════════════════════════════════════════
   GESTIÓN ADMINISTRATIVA — COMPONENTES BASE
   ══════════════════════════════════════════ */

/* ── Lista-detalle layout ── */
.list-detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  min-height: 0;
  flex: 1;
}
.list-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}
.list-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 180px);
}
.list-detail-panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.list-detail-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.list-detail-panel-body > div[style*="239,68,68"] {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.list-detail-panel-body > div[style*="239,68,68"] > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}
.receta-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.receta-tip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}
.list-detail-panel-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Card clickeable de lista ── */
.list-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.list-item-card:hover {
  border-color: rgba(249,115,22,0.4);
  background: rgba(249,115,22,0.04);
}
.list-item-card.selected {
  border-color: var(--brand);
  background: rgba(249,115,22,0.07);
}
.list-item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.list-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx-1);
  line-height: 1.3;
}
.list-item-meta {
  font-size: 11px;
  color: var(--tx-4);
  margin-top: 3px;
}

.clasificador-layout {
  grid-template-columns: minmax(340px, 420px) minmax(420px, 760px);
  align-items: start;
}
.classifier-center {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.classifier-tabs {
  min-width: 0;
}
.classifier-tabs--secondary {
  padding-left: 12px;
  border-left: 2px solid var(--brand);
}
.classifier-tabs--secondary .mn-tab {
  font-size: 12px;
}
.classifier-create-panel {
  margin: 0;
}
.classifier-edit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-grouping-row {
  display: grid;
  grid-template-columns: 48px minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
}
.menu-grouping-row > input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 4px;
}
.menu-grouping-fields {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr);
  gap: 10px;
}
@media (max-width: 720px) {
  .classifier-tabs--secondary {
    padding-left: 8px;
  }
  .menu-grouping-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }
  .menu-grouping-row > input[type="color"] {
    width: 42px;
  }
  .menu-grouping-fields {
    grid-column: 2 / -1;
    grid-template-columns: 1fr;
  }
}
.clasificador-list {
  max-height: calc(100vh - 190px);
}
.clasificador-panel {
  max-width: 760px;
}
.clasificador-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 68px;
}
.clasificador-card.dragging {
  opacity: .55;
}
.clasificador-card.drag-over-top {
  border-top: 2px solid var(--brand);
}
.clasificador-card.drag-over-bottom {
  border-bottom: 2px solid var(--brand);
}
.clasificador-card-grip {
  width: 28px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--tx-4);
  cursor: grab;
  border-radius: var(--r-md);
}
.clasificador-card-grip:hover {
  color: var(--tx-2);
  background: rgba(255,255,255,0.06);
}
.clasificador-card-grip:active {
  cursor: grabbing;
}
.clasificador-card-grip svg {
  width: 14px;
  height: 14px;
}
.clasificador-card-content {
  min-width: 0;
}

/* ── Badges administrativos ── */
.badge-type-plato      { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(239,68,68,0.12);color:#ef4444;border:1px solid rgba(239,68,68,0.25); }
.badge-type-terminado  { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(59,130,246,0.12);color:#3b82f6;border:1px solid rgba(59,130,246,0.25); }
.badge-type-guarnicion { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(168,85,247,0.12);color:#a855f7;border:1px solid rgba(168,85,247,0.25); }
.badge-type-servicio   { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(100,116,139,0.12);color:var(--tx-4);border:1px solid rgba(100,116,139,0.2); }

.badge-stock-ok      { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-libre-bg);color:var(--s-libre);border:1px solid var(--s-libre-b); }
.badge-stock-low     { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-cocina-bg);color:var(--s-cocina);border:1px solid var(--s-cocina-b); }
.badge-stock-out     { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-cuenta-bg);color:var(--s-cuenta);border:1px solid var(--s-cuenta-b); }
.badge-stock-notrack { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;background:rgba(100,116,139,0.1);color:var(--tx-4);border:1px solid rgba(100,116,139,0.15); }

.badge-saldo-debe  { display:inline-flex;align-items:center;padding:2px 10px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-cuenta-bg);color:var(--s-cuenta);border:1px solid var(--s-cuenta-b); }
.badge-saldo-aldia { display:inline-flex;align-items:center;padding:2px 10px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-libre-bg);color:var(--s-libre);border:1px solid var(--s-libre-b); }
.badge-saldo-favor { display:inline-flex;align-items:center;padding:2px 10px;border-radius:20px;font-size:11px;font-weight:700;background:var(--s-listo-bg);color:var(--s-listo);border:1px solid var(--s-listo-b); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 12px;
  text-align: center;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  opacity: 0.22;
}
.empty-state-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--tx-2); }
.empty-state-desc  { font-size: 13px; color: var(--tx-4); max-width: 280px; line-height: 1.5; }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-panel {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--tx-3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.filter-chip:hover { border-color: rgba(249,115,22,0.35); color: var(--tx-1); }
.filter-chip.active { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.45); color: var(--brand); }

/* ── Inline confirm row ── */
.confirm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--s-cuenta-bg);
  border: 1px solid var(--s-cuenta-b);
  font-size: 13px;
  font-weight: 600;
  color: var(--s-cuenta);
  flex-wrap: wrap;
}
.confirm-row span { flex: 1; }

/* ── Bloque saldo (3 columnas) ── */
.saldo-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-glass);
}
.saldo-item { text-align: center; }
.saldo-item-val {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.saldo-item-label {
  font-size: 11px;
  color: var(--tx-4);
  margin-top: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.saldo-debe  { color: var(--s-cuenta); }
.saldo-aldia { color: var(--s-libre); }
.saldo-favor { color: var(--s-listo); }
.saldo-neutro { color: var(--tx-2); }

.arqueo-detail-summary {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
  gap: 14px;
  align-items: stretch;
}
.arqueo-cash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
}
.arqueo-cash-grid .saldo-item:nth-child(3):last-child {
  grid-column: 1 / -1;
}
.arqueo-payments-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: 210px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--r-xl);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    rgba(255,255,255,0.03);
}
.arqueo-payments-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.metal-pie {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 12px;
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.20),
    0 18px 36px rgba(0,0,0,0.28);
}
.metal-pie-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.16), transparent 34%),
    var(--bg-card);
  border: 1px solid rgba(255,255,255,0.12);
}
.metal-pie-inner strong {
  font-size: 21px;
  font-weight: 900;
  color: var(--tx-1);
  line-height: 1;
}
.metal-pie-inner span {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--tx-3);
}
.metal-pie-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.metal-pie-caption span,
.payment-kpi-meta {
  font-size: 11px;
  color: var(--tx-4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metal-pie-caption strong {
  font-size: 13px;
  color: var(--tx-2);
}
.arqueo-payments-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
}
.payment-kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.035);
}
.payment-kpi.empty {
  display: block;
  grid-column: 1 / -1;
  color: var(--tx-4);
  font-size: 13px;
}
.payment-kpi-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}
.payment-kpi-label {
  color: var(--tx-3);
  font-size: 12px;
  font-weight: 800;
}
.payment-kpi-value {
  margin-top: 2px;
  color: var(--tx-1);
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* ── Sección dentro del panel de detalle ── */
.detail-section { display: flex; flex-direction: column; gap: 10px; }
.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
}

/* ── Tabla de movimientos compacta ── */
.mov-table { display: flex; flex-direction: column; gap: 1px; }
.mov-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 9px 12px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  font-size: 12px;
  align-items: center;
}
.mov-row:nth-child(even) { background: rgba(255,255,255,0.02); }
.mov-tipo { color: var(--tx-3); font-weight: 600; }
.mov-nota { color: var(--tx-4); font-size: 11px; }
.mov-monto { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.mov-monto.positivo { color: var(--s-libre); }
.mov-monto.negativo { color: var(--s-cuenta); }
.mov-fecha { color: var(--tx-4); font-size: 11px; text-align: right; }

/* ── Compra items dinámicos ── */
.proveedores-layout--compras {
  height: 100%;
  min-height: 0;
}

/* Reportes tabulares */
.reports-workspace { display:flex; flex-direction:column; gap:16px; min-width:0; }
.report-tags { display:flex; align-items:center; gap:8px; overflow-x:auto; padding-bottom:2px; scrollbar-width:thin; }
.report-tag {
  flex:0 0 auto; border:1px solid var(--border); background:var(--bg-2); color:var(--tx-3);
  border-radius:999px; padding:9px 16px; font:inherit; font-size:13px; font-weight:700; cursor:pointer;
}
.report-tag:hover { color:var(--tx-1); border-color:var(--border-light); }
.report-tag.active { color:#fff; background:var(--brand); border-color:var(--brand); }
.report-filter-card, .report-table-card {
  border:1px solid var(--border); background:var(--bg-2); border-radius:var(--r-lg);
}
.report-filter-card { padding:14px; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.report-filter-fields { display:flex; align-items:flex-end; gap:12px; flex:1; flex-wrap:wrap; }
.report-filter-fields .input-group { min-width:155px; }
.report-filter-fields .report-employee-filter { min-width:220px; flex:1; max-width:320px; }
.report-filter-note { color:var(--tx-4); font-size:13px; padding:11px 2px; }
.report-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.report-table-card { min-width:0; overflow:hidden; }
.report-table-heading { padding:15px 16px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; gap:12px; align-items:center; }
.report-table-heading strong { color:var(--tx-1); font-size:15px; }
.report-table-heading span { color:var(--tx-4); font-size:12px; margin-left:10px; }
.report-table-heading small { color:var(--tx-4); }
.report-table-scroll { overflow:auto; max-height:calc(100vh - 330px); }
.report-table { width:100%; min-width:760px; border-collapse:collapse; font-size:12px; white-space:nowrap; }
.report-table th { position:sticky; top:0; z-index:1; text-align:left; color:var(--tx-3); background:var(--bg-3); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }
.report-table th, .report-table td { padding:11px 14px; border-bottom:1px solid var(--border); }
.report-table tbody tr:hover { background:rgba(255,255,255,.025); }
.report-table td { color:var(--tx-2); font-variant-numeric:tabular-nums; }
.report-state { min-height:220px; display:grid; place-items:center; padding:30px; color:var(--tx-4); text-align:center; }
.report-column-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.report-column-picker p { grid-column:1/-1; color:var(--tx-4); font-size:13px; margin:0 0 6px; }
.report-column-picker label { display:flex; align-items:center; gap:9px; padding:9px 10px; border:1px solid var(--border); border-radius:var(--r-md); color:var(--tx-2); font-size:13px; cursor:pointer; }
.report-column-picker input { accent-color:var(--brand); }
@media (max-width:700px) {
  .report-filter-card { align-items:stretch; }
  .report-filter-fields, .report-actions { width:100%; }
  .report-filter-fields .input-group, .report-filter-fields .report-employee-filter { min-width:calc(50% - 6px); max-width:none; }
  .report-actions .btn { flex:1; }
  .report-table-heading { align-items:flex-start; flex-direction:column; }
  .report-table-scroll { max-height:none; }
  .report-column-picker { grid-template-columns:1fr; }
  .report-column-picker p { grid-column:auto; }
}
.compra-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.compra-datos-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(380px, 1fr);
  gap: 12px;
}
.compra-items-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 118px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}
.compra-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.compra-section-title { color: var(--tx-2); font-size: 13px; font-weight: 800; }
.compra-section-help { margin-top: 2px; color: var(--tx-4); font-size: 10px; }
.compra-items-table {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-gutter: stable;
}
.compra-items-table::-webkit-scrollbar { width: 6px; }
.compra-items-table::-webkit-scrollbar-track { background: transparent; }
.compra-items-table::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-light);
}
.compra-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 82px 108px minmax(130px, 160px) auto;
  gap: 8px;
  align-items: center;
}
.compra-item-costo { min-width: 130px; }
.compra-comprobante-grid {
  display: grid;
  grid-template-columns: 56px minmax(86px, 0.8fr) minmax(120px, 1.2fr);
  gap: 8px;
}
.compra-comprobante-letra {
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}
.compra-comprobantes-contexto {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.018);
}
.compra-contexto-label {
  flex: 0 0 auto;
  color: var(--tx-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.compra-contexto-empty { color: var(--tx-4); font-size: 11px; }
.compra-contexto-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}
.compra-contexto-item {
  display: flex;
  min-width: 165px;
  padding-left: 9px;
  border-left: 1px solid var(--border-glass);
  flex-direction: column;
}
.compra-contexto-item strong { color: var(--tx-2); font-size: 11px; }
.compra-contexto-item small { margin-top: 2px; color: var(--tx-4); font-size: 10px; }
.compra-tributos-section {
  min-width: 0;
}
.compra-cierre-grid {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr) minmax(240px, .8fr);
  gap: 10px;
  align-items: stretch;
}
.compra-cierre-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.018);
}
.compra-cierre-panel > .compra-section-title { margin-bottom: 8px; }
.compra-pago-grid { display: grid; gap: 8px; }
.compra-tributos-list { display: flex; flex-direction: column; gap: 8px; }
.compra-tributos-empty {
  padding: 10px;
  border: 1px dashed var(--border-glass);
  border-radius: var(--r-md);
  color: var(--tx-4);
  font-size: 11px;
  text-align: center;
}
.compra-tributo-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 130px) auto;
  gap: 6px;
  align-items: end;
}
.compra-tributo-info {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  color: var(--tx-4);
  font-size: 11px;
}
.compra-tributo-info span {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 800;
}
.compra-tributo-remove { margin-bottom: 3px; color: var(--s-cuenta); }
.compra-resumen-panel { display: flex; flex-direction: column; }
.compra-total-resumen {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 10px;
}
.compra-total-resumen > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--tx-4);
  font-size: 13px;
}
.compra-total-resumen strong { color: var(--tx-2); }
.compra-total-resumen .compra-total-final {
  padding-top: 8px;
  border-top: 1px solid var(--border-glass);
  color: var(--tx-2);
  font-size: 15px;
  font-weight: 800;
}
.compra-total-resumen .compra-total-final strong {
  color: var(--tx-1);
  font-size: 19px;
}
.compra-submit { width: 100%; margin-top: auto; }

/* ── Gastos ── */
.gastos-shell { display: flex; flex-direction: column; gap: 14px; }
.gastos-heading { margin-bottom: 0; }
.gastos-subtitle { margin-top: 4px; color: var(--tx-4); font-size: 12px; }
.gastos-content { min-width: 0; }
.gastos-carga-layout,
.gastos-tipos-layout {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.5fr);
  gap: 16px;
  align-items: start;
}
.gastos-form-panel,
.gastos-list-panel,
.gastos-chart-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  background: var(--bg-card);
}
.gastos-form-panel { position: sticky; top: 14px; }
.gastos-panel-title { color: var(--tx-1); font-size: 15px; font-weight: 850; }
.gastos-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.gastos-col-full { grid-column: 1 / -1; }
.gastos-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.gastos-alert,
.gastos-summary-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(249,115,22,.28);
  border-radius: var(--r-md);
  background: rgba(249,115,22,.07);
  color: var(--tx-3);
  font-size: 12px;
}
.gastos-alert svg,
.gastos-summary-note svg { width: 16px; flex: 0 0 16px; color: var(--brand); }
.gastos-table { margin-top: 14px; overflow-x: auto; }
.gastos-row {
  display: grid;
  grid-template-columns: 82px minmax(150px, 1.4fr) minmax(120px, 1fr) 82px 110px 34px;
  gap: 10px;
  align-items: center;
  min-width: 720px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--tx-3);
  font-size: 12px;
}
.gastos-row:last-child { border-bottom: 0; }
.gastos-row-head {
  color: var(--tx-4);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.gastos-row strong { display: block; color: var(--tx-2); font-size: 12px; }
.gastos-row small { display: block; margin-top: 2px; color: var(--tx-4); }
.gasto-tipo { display: flex; align-items: center; gap: 7px; }
.gasto-tipo i,
.gasto-tipo-row > i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; }
.gasto-monto { color: var(--tx-1); font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.status-badge { width: max-content; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-paid { background: rgba(34,197,94,.12); color: var(--s-libre); }
.status-pending { background: rgba(234,179,8,.12); color: var(--s-cocina); }
.gasto-color-input { min-height: 38px; padding: 4px; }
.gasto-tipos-list { display: flex; flex-direction: column; margin-top: 10px; }
.gasto-tipo-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border-glass);
}
.gasto-tipo-row:last-child { border-bottom: 0; }
.gasto-tipo-row strong { display: block; color: var(--tx-2); font-size: 13px; }
.gasto-tipo-row small { display: block; margin-top: 3px; color: var(--tx-4); font-size: 11px; }
.gasto-tipo-row.is-inactive { opacity: .5; }
.gastos-summary { display: flex; flex-direction: column; gap: 16px; }
.gastos-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--border-glass); }
.gastos-kpis > div { min-width: 0; padding: 18px; border-right: 1px solid var(--border-glass); }
.gastos-kpis > div:last-child { border-right: 0; }
.gastos-kpis span,
.gastos-kpis small { display: block; color: var(--tx-4); font-size: 11px; }
.gastos-kpis strong { display: block; margin: 8px 0 5px; color: var(--tx-1); font-size: clamp(19px, 2vw, 27px); font-weight: 900; font-variant-numeric: tabular-nums; }
.gastos-chart-panel { min-height: 300px; }
.gastos-bars { display: grid; grid-template-columns: repeat(6, minmax(56px, 1fr)); gap: 16px; height: 220px; margin-top: 20px; }
.gastos-bar-item { display: grid; grid-template-rows: 20px 1fr 18px; gap: 7px; min-width: 0; text-align: center; }
.gastos-bar-value { overflow: hidden; color: var(--tx-3); font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.gastos-bar-track { display: flex; align-items: flex-end; justify-content: center; min-height: 0; border-bottom: 1px solid var(--border-glass); }
.gastos-bar-fill { width: min(46px, 70%); min-height: 2px; border-radius: 6px 6px 0 0; background: var(--brand); transition: height .35s ease; }
.gastos-bar-item > span { color: var(--tx-4); font-size: 11px; font-weight: 800; text-transform: capitalize; }

@media (max-width: 1100px) {
  .gastos-carga-layout,
  .gastos-tipos-layout { grid-template-columns: 1fr; }
  .gastos-form-panel { position: static; }
  .gastos-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gastos-kpis > div:nth-child(2) { border-right: 0; }
  .gastos-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-glass); }
}
@media (max-width: 640px) {
  .gastos-form-panel,
  .gastos-list-panel,
  .gastos-chart-panel { padding: 14px; }
  .gastos-form-grid { grid-template-columns: 1fr; }
  .gastos-col-full { grid-column: auto; }
  .gastos-kpis { grid-template-columns: 1fr; }
  .gastos-kpis > div { border-right: 0; border-bottom: 1px solid var(--border-glass); }
  .gastos-kpis > div:last-child { border-bottom: 0; }
  .gastos-bars { gap: 7px; }
  .gastos-bar-value { display: none; }
}

/* ── Módulos activos toggles ── */
.modulo-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-glass);
}
.modulo-toggle-row:last-child { border-bottom: none; }
.modulo-toggle-info { flex: 1; }
.modulo-toggle-nombre { font-size: 14px; font-weight: 700; color: var(--tx-1); }
.modulo-toggle-desc { font-size: 12px; color: var(--tx-4); margin-top: 2px; }
.modulo-toggle-plan-lock { color: var(--s-cocina); font-weight: 700; }

/* ── Toggle switch ── */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch--disabled { opacity: .55; cursor: not-allowed; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(100,116,139,0.3);
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-fast);
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ── Receta: lista de ingredientes ── */
.receta-items-list { display: flex; flex-direction: column; gap: 8px; }
.receta-item-row {
  display: grid;
  grid-template-columns: 1fr 80px 70px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass);
}

/* ── Responsive ── */
/* Mi Cuenta - facturacion */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.billing-span { grid-column: 1 / -1; }
.billing-plan-name { font-size: 24px; font-weight: 900; color: var(--tx-1); }
.billing-plan-price { margin-top: 6px; font-size: 20px; font-weight: 900; color: var(--brand); }
.billing-plan-price span,
.billing-muted { font-size: 12px; font-weight: 600; color: var(--tx-4); }
.billing-status-row,
.billing-action-row,
.billing-payment-row,
.billing-plan-row,
.billing-module,
.billing-payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.billing-status-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--tx-3);
  font-size: 12px;
  font-weight: 700;
}
.billing-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}
.billing-payment-row {
  justify-content: flex-start;
  margin-bottom: 10px;
  color: var(--tx-2);
  font-size: 14px;
  font-weight: 700;
}
.billing-plan-grid,
.billing-module-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.billing-plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.billing-module-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.billing-module {
  min-height: 148px;
  padding: 14px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
  align-items: stretch;
  flex-direction: column;
}
.billing-module-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.billing-module-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: rgba(249,115,22,.10);
  border: 1px solid rgba(249,115,22,.28);
  flex: 0 0 auto;
}
.billing-module-icon svg { width: 17px; height: 17px; }
.billing-module-title { color: var(--tx-1); font-size: 14px; font-weight: 900; line-height: 1.25; }
.billing-module-desc {
  color: var(--tx-4);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  margin-top: 10px;
}
.billing-module-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}
.billing-module.on { border-color: var(--s-libre-b); background: var(--s-libre-bg); }
.billing-module.on .billing-module-icon {
  color: var(--s-libre);
  background: rgba(34,197,94,.14);
  border-color: var(--s-libre-b);
}
.billing-module.available {
  border-color: rgba(59,130,246,.34);
  background: rgba(59,130,246,.08);
}
.billing-module.available .billing-module-icon {
  color: #60A5FA;
  background: rgba(59,130,246,.12);
  border-color: rgba(96,165,250,.34);
}
.billing-module.available .billing-module-title { color: #DBEAFE; }
.billing-module.off { opacity: .65; }
.billing-module.locked { opacity: .72; }
.billing-plan-list { display: flex; flex-direction: column; gap: 8px; }
.billing-plan-row,
.billing-plan-card {
  padding: 12px 14px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
}
.billing-plan-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.billing-plan-row.current,
.billing-plan-card.current { border-color: var(--brand); background: var(--brand-dim); }
.billing-plan-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tx-1);
  font-size: 14px;
  font-weight: 900;
}
.billing-plan-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.billing-plan-row-price { color: var(--tx-2); font-size: 13px; font-weight: 900; white-space: nowrap; }
.billing-payment-list { display: flex; flex-direction: column; gap: 8px; }
.billing-payment-item {
  padding: 10px 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
}
.billing-payment-item strong { color: var(--tx-1); font-size: 13px; font-weight: 900; }
.billing-payment-item span,
.billing-payment-item small { color: var(--tx-4); font-size: 12px; font-weight: 700; }
@media (max-width: 760px) {
  .billing-grid { grid-template-columns: 1fr; }
  .billing-plan-grid { grid-template-columns: 1fr; }
  .billing-module-grid { grid-template-columns: 1fr; }
  .billing-span { grid-column: auto; }
  .billing-plan-row { align-items: flex-start; flex-direction: column; }
  .billing-plan-row-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .list-detail-layout { grid-template-columns: 1fr; }
  .list-detail-list { max-height: 260px; }
  .list-detail-panel { max-height: none; }
  .arqueo-detail-summary,
  .arqueo-payments-card { grid-template-columns: 1fr; }
  .arqueo-payments-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compra-datos-grid { grid-template-columns: 1fr 1fr; }
  .compra-item-row { grid-template-columns: minmax(200px, 1fr) 72px 92px minmax(110px, 140px) auto; }
  .compra-cierre-grid { grid-template-columns: 1fr 1fr; }
  .compra-resumen-panel { grid-column: 1 / -1; }
  .compra-comprobante-grid { grid-template-columns: 56px 1fr 1fr; }
  .compra-tributo-row { grid-template-columns: 1fr 1fr auto; }
  .receta-item-row { grid-template-columns: 1fr 80px auto; }
}
@media (max-width: 600px) {
  .saldo-block { grid-template-columns: 1fr 1fr; }
  .saldo-block .saldo-item:last-child { grid-column: 1 / -1; }
  .arqueo-cash-grid,
  .arqueo-payments-kpis { grid-template-columns: 1fr; }
  .compra-datos-grid,
  .compra-cierre-grid { grid-template-columns: 1fr; }
  .compra-resumen-panel { grid-column: auto; }
  .compra-item-row { grid-template-columns: 1fr 1fr; }
  .compra-item-row > :first-child { grid-column: 1 / -1; }
  .compra-item-row > :last-child { justify-self: end; }
  .compra-comprobante-grid { grid-template-columns: 1fr; }
  .compra-comprobantes-contexto { align-items: flex-start; flex-direction: column; }
  .compra-contexto-list { width: 100%; }
  .compra-tributo-row { grid-template-columns: 1fr; }
  .compra-tributo-remove { justify-self: end; }
  .compra-comprobante-letra { text-align: left; }
  .proveedores-layout--compras { height: auto; }
  .compra-form { flex: none; min-height: 0; }
  .compra-items-section { flex: none; min-height: 0; }
  .compra-items-table { flex: none; max-height: 300px; }
}

.cliente-facturacion-config {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--bd-1);
}
.cliente-facturacion-heading small,
.caja-facturacion small {
  display: block;
  margin-top: 4px;
  color: var(--tx-4);
  font-size: 11px;
  line-height: 1.4;
}
.cliente-facturacion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.cliente-facturacion-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--bd-1);
  border-radius: var(--r-md);
  background: var(--bg-3);
  cursor: pointer;
}
.cliente-facturacion-option.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cliente-facturacion-option span,
.cliente-facturacion-option small {
  display: block;
  min-width: 0;
}
.cliente-facturacion-option strong { font-size: 12px; color: var(--tx-1); }
.cliente-facturacion-option small { margin-top: 2px; font-size: 10px; color: var(--tx-4); }
.caja-facturacion {
  padding: 12px;
  border: 1px solid var(--bd-1);
  border-radius: var(--r-md);
  background: var(--bg-3);
}
.caja-facturacion-cliente {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.caja-facturacion-nombre { font-size: 13px; font-weight: 700; color: var(--tx-1); }
.caja-facturacion-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.caja-facturacion-select { margin-top: 10px; width: 100%; }
@media (max-width: 680px) {
  .cliente-facturacion-grid { grid-template-columns: 1fr; }
  .caja-facturacion-cliente { align-items: flex-start; flex-direction: column; }
  .caja-facturacion-actions { width: 100%; justify-content: flex-start; }
}
