:root {
  /* ── Premium palette ─────────────────────────────────────────────── */
  --ink: #0f1b2d;
  --ink-soft: #29384c;
  --muted: #64748b;
  --line: #e7ebf1;
  --line-strong: #d6dce6;
  --paper: #ffffff;
  --bg: #eef1f7;
  --hover: #f3f7f5;

  --primary: #15715a;
  --primary-dark: #0f5443;
  --primary-hover: #115f4b;
  --primary-soft: #eef4f1;
  --accent: #2b8a73;
  --accent-2: #1f7a64;
  --gold: #a8801f;
  --secondary: #f7f9fb;
  --danger: #c0394e;
  --danger-soft: #f8edef;

  /* Sober flat fills (sin gradientes llamativos) */
  --grad-primary: var(--primary);
  --grad-primary-hover: var(--primary-hover);
  --grad-accent: var(--accent);
  --grad-sidebar: #121a21;
  --grad-app: #eef1f4;
  --ring: 0 0 0 3px rgba(21,113,90,.14);

  /* Elevation discreta */
  --shadow-soft: 0 1px 2px rgba(17,28,38,.05);
  --shadow: 0 1px 3px rgba(17,28,38,.05), 0 6px 18px rgba(17,28,38,.06);
  --shadow-lg: 0 6px 16px rgba(17,28,38,.08), 0 22px 48px rgba(17,28,38,.12);
  --shadow-primary: 0 2px 6px rgba(15,84,67,.18);

  --radius: 13px;
  --radius-sm: 9px;
  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: block;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13.5px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(30, 58, 95, .18);
  border-color: var(--primary);
  background: white;
}
.nav-button, .tab-button, .ghost-button, .primary-button, .secondary-button, .danger-button, .icon-button {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0;
}
.panel, .metric, .card, .modal, dialog, .toast, .support-modal, .report-preview-document, .ticket-preview-ticket {
  border-radius: var(--radius);
}
.close-button, .modal-close, dialog .close-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.status-badge, .product-status, .active-badge {
  border-radius: 4px;
  padding: 3px 8px;
  font-weight: 700;
  letter-spacing: 0;
}
.input-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.input-with-action .ghost-button { height: 100%; white-space: nowrap; }

.menu-toggle {
  position: fixed;
  top: 18px;
  left: 16px;
  z-index: 130;
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  color: var(--ink);
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  transition: left .18s ease, background .12s ease;
}
.menu-toggle span {
  grid-area: 1 / 1;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.menu-toggle span:nth-child(1) { transform: translateY(-7px); }
.menu-toggle span:nth-child(2) { transform: translateY(0); }
.menu-toggle span:nth-child(3) { transform: translateY(7px); }
body.sidebar-open .menu-toggle {
  left: calc(var(--sidebar-width) + 12px);
  background: #ffffff;
}
body.sidebar-open .menu-toggle span:nth-child(1) { transform: rotate(45deg); }
body.sidebar-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.sidebar-open .menu-toggle span:nth-child(3) { transform: rotate(-45deg); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 120;
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: 20px 16px;
  background: #0f1923;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(-100%);
  transition: transform .18s ease;
  box-shadow: 1px 0 0 rgba(255,255,255,.06), 4px 0 24px rgba(0,0,0,.32);
}
.sidebar.open,
body.sidebar-open .sidebar {
  transform: translateX(0);
}
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  height: 62px;
  width: auto;
  max-width: 120px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
}
.brand strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.brand small { color: rgba(255,255,255,.45); font-size: 11px; }
nav { display: grid; gap: 4px; }
.nav-button, .tab-button, .ghost-button, .primary-button, .secondary-button, .danger-button, .icon-button {
  min-height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-weight: 600;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.nav-button {
  text-align: left;
  background: transparent;
  color: rgba(255,255,255,.65);
  border: 0;
  padding-inline: 12px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-button.active, .nav-button:hover {
  background: rgba(255,255,255,.08);
  color: #ffffff;
  box-shadow: none;
}
.nav-button.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-button,
.tab-button {
  min-height: 40px;
}
.primary-button {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.ghost-button {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.danger-button {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.icon-button {
  width: 38px;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.primary-button:hover { background: var(--primary-dark); }
.secondary-button:hover, .ghost-button:hover { background: #f9fafb; }
.danger-button:hover { background: #fee2e2; }
.xl { min-height: 48px; font-size: 16px; font-weight: 700; }
.sidebar-cash-card {
  margin-top: 0;
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.92) !important;
  box-shadow: none !important;
}
.sidebar-cash-card span,
.sidebar-cash-card small {
  color: rgba(255,255,255,.55) !important;
}
.sidebar-cash-card strong {
  color: #fff !important;
}
.sidebar-cash-actions {
  grid-template-columns: 1fr;
  gap: 6px;
}
.sidebar-cash-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.1) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: rgba(255,255,255,.9) !important;
  box-shadow: none !important;
  transition: opacity .15s ease, background .15s ease;
}
.sidebar-cash-actions button:hover:not(:disabled) {
  background: rgba(255,255,255,.18) !important;
}
/* Deshabilitado: claramente apagado para que el orden sea obvio */
.sidebar-cash-actions button:disabled {
  opacity: .32 !important;
  cursor: not-allowed !important;
  color: rgba(255,255,255,.5) !important;
}
.sidebar-cash-actions .primary-button {
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.24) !important;
  color: #fff !important;
}
.sidebar-cash-actions .danger-button {
  background: rgba(220,38,38,.22) !important;
  border-color: rgba(220,38,38,.4) !important;
  color: #fca5a5 !important;
}
.developer-credit {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 4px;
  border-top: 1px solid rgba(255,255,255,.09);
  color: rgba(255,255,255,.5);
  font-size: 12px;
}
.developer-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 900; color: rgba(255,255,255,.92); font-size: 15px; letter-spacing: .01em; }
.developer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  opacity: 1;
}
.developer-credit strong {
  color: rgba(255,255,255,.62);
  font-weight: 700;
}
.floating-credit {
  position: fixed;
  right: 12px;
  bottom: 14px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}
.floating-credit .developer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 14px;
  color: rgba(15,15,15,.9);
  white-space: nowrap;
  letter-spacing: .01em;
}
.floating-credit .developer-brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  /* El crédito flotante va sobre fondo claro: chip oscuro para que el logo
     blanco (transparente) se vea. */
  background: #121a21;
  padding: 3px;
}
body.sidebar-open .floating-credit {
  opacity: 0;
  pointer-events: none;
}
.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.inline-filter select {
  width: auto;
  min-width: 140px;
}
.toolbar-spacer {
  flex: 1;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

main {
  min-width: 0;
  min-height: 100vh;
  padding: 20px 22px 24px 78px;
  overflow: auto;
  transition: padding-left .18s ease;
}
body.sidebar-open main {
  padding-left: calc(var(--sidebar-width) + 78px);
}
.view, .admin-section { display: none; }
.view.active, .admin-section.active { display: block; }
.topbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar-copy {
  min-width: 0;
  max-width: 100%;
}
.topbar-copy > p {
  margin-left: 62px;
}
.sale-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.sale-title.in-sale-panel {
  margin-bottom: 14px;
}
.sale-title-logo {
  height: 74px;
  width: auto;
  max-width: 160px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow-soft);
}
.topbar-pos {
  max-width: calc(100vw - 128px);
  grid-template-columns: 1fr;
  align-items: center;
  margin-bottom: 0;
}
.topbar-admin {
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  margin-bottom: 12px;
}
.topbar-status {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  align-items: center;
  min-width: 0;
  align-self: end;
}
h1, h2, p { margin-top: 0; }
h1, h2, h3, h4, button, input, select, textarea, label, small { letter-spacing: 0; }
h1 { margin-bottom: 4px; font-size: 24px; font-weight: 700; }
h2 { margin-bottom: 10px; font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
h4 { font-size: 13px; font-weight: 700; }
.muted, .topbar p, .metric small, .product-preview p { color: var(--muted); }

::placeholder {
  color: #8a96a7;
  opacity: 1;
}
input::placeholder,
textarea::placeholder {
  color: #8a96a7;
  font-weight: 600;
}

.close-icon {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  box-shadow: var(--shadow-soft);
}

.panel, .metric, .total-box, .clock-box, .cash-box, dialog .modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel {
  padding: 16px;
  background: var(--paper);
}
.total-box {
  min-width: 0;
  padding: 14px;
  border-top: 3px solid var(--primary);
  background: var(--paper);
  text-align: center;
}
.total-box span, .metric span { display: block; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.total-box strong { font-size: 26px; line-height: 1.1; font-weight: 700; }
.clock-box {
  position: fixed;
  right: 12px;
  bottom: 60px;
  z-index: 80;
  min-width: 0;
  display: block;
  padding: 6px 10px;
  font-weight: 600;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}
.clock-icon {
  display: none;
}
.clock-icon::before, .clock-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  border-radius: 999px;
  background: #173f39;
  transform-origin: 50% 100%;
}
.clock-icon::before { height: 11px; transform: translate(-50%, -100%) rotate(0deg); }
.clock-icon::after { height: 8px; transform: translate(-50%, -100%) rotate(90deg); }
#liveClock { display: block; font-size: 12px; line-height: 1.6; color: #1a2332; font-weight: 700; white-space: nowrap; }
#clockDate { font-size: 11px; color: #374151; font-weight: 600; }
#clockTime { font-size: 13px; color: #111827; font-weight: 700; letter-spacing: 0.03em; }
#liveClock small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.cash-box {
  min-width: 0;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  border-radius: var(--radius-sm);
}
.cash-box span { color: rgba(255,255,255,.5); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.cash-box strong { font-size: 15px; font-weight: 700; }
.cash-box small { font-size: 11px; }
.cash-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.cash-actions button { min-height: 32px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; }
.cash-box.closed { border-top: 2px solid rgba(255,255,255,.2); }
.cash-box.open { border-top: 2px solid #4ade80; }
.operation-warning {
  display: none;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #f5c2c7;
  border-radius: var(--radius-sm);
  background: #fff1f2;
  color: #9f1239;
  font-weight: 900;
}
.operation-warning.visible { display: block; }

.sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
  max-width: calc(100vw - 128px);
  min-height: calc(100vh - 52px);
}
.sale-side-column {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}
.sale-panel {
  position: sticky;
  top: 24px;
  min-height: calc(100vh - 52px);
  max-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
}
.scan-row, .section-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.scan-actions { display: flex; flex-direction: column; gap: 12px; }
.scan-actions .secondary-button { width: 100%; }
.scan-box { position: relative; }
.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 340px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.suggestions.visible { display: block; }
.suggestion-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
  border-bottom: 1px solid #eef2f6;
}
.suggestion-item:hover { background: #f1faf8; }
.suggestion-item small { color: var(--muted); }

.table-wrap { position: relative; overflow: auto; }
.table-wrap.tall { min-height: 0; max-height: none; flex: 1 1 auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
tbody tr:hover { background: #f8fbff; }
.empty-state { display: none; padding: 28px; color: var(--muted); text-align: center; }

.qty-control {
  display: inline-grid;
  grid-template-columns: 34px minmax(56px, auto) 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-control button { height: 34px; background: #f2f4f1; }
.qty-control span { text-align: center; font-weight: 900; }
.sale-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.sale-actions .ghost-button,
.sale-actions .secondary-button { min-height: 46px; }
.sale-panel .sale-actions {
  flex: 0 0 auto;
  z-index: 12;
  padding: 10px 0 18px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.product-preview {
  min-height: 0;
  padding: 12px;
  opacity: .94;
}
.image-placeholder, .product-card img, #productImagePreview img, #productPreview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: cover;
}
#productPreview h2 {
  margin: 8px 0 6px;
  font-size: 15px;
}
#productPreview p {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
}
.product-preview .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}
.image-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, #e8f1ff, #eef7f4); color: var(--muted); font-weight: 800; }
.product-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 900; }
.stock-low { color: #b97524; font-weight: 900; }
.stock-out, .sale-cancelled { color: var(--danger); font-weight: 900; }
.cart-stock-warning {
  background: #fff7ed;
  box-shadow: inset 4px 0 0 #f97316;
}
.cart-stock-warning small { color: #9a3412; font-weight: 800; }

.admin-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}
.admin-locked { max-width: 520px; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.tab-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tab-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
.admin-tabs .tab-button:nth-child(1) .tab-icon { color: #0284c7; }
.admin-tabs .tab-button:nth-child(2) .tab-icon { color: #d97706; }
.admin-tabs .tab-button:nth-child(3) .tab-icon { color: #16a34a; }
.admin-tabs .tab-button:nth-child(4) .tab-icon { color: #7c3aed; }
.admin-tabs .tab-button:nth-child(5) .tab-icon { color: #dc2626; }
.admin-tabs .tab-button:nth-child(6) .tab-icon { color: #0891b2; }
.admin-tabs .tab-button:nth-child(7) .tab-icon { color: #be185d; }
.admin-tabs .tab-button:nth-child(8) .tab-icon { color: #475569; }
.admin-tabs .tab-button:nth-child(9) .tab-icon { color: #0d9488; }
.admin-tabs .tab-button:nth-child(10) .tab-icon { color: #ea580c; }
.admin-tabs .tab-button:nth-child(11) .tab-icon { color: #6366f1; }
/* Botones del menú admin del mismo tamaño (parejos) */
.admin-tabs .tab-button {
  flex: 1 1 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
/* El signo $ de Ventas debe ser verde (no morado) */
.admin-tabs .tab-button[data-admin-section="adminSales"] .tab-icon { color: #16a34a !important; }
.invoice-toolbar {
  align-items: stretch;
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.invoice-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.invoice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}
.invoice-list-panel { min-width: 0; }
.invoice-saved-panel { margin-bottom: 16px; }
.saved-invoice-detail { margin-top: 12px; }
.saved-invoice-print-layout {
  padding: 8px 0;
  color: #000;
}
.saved-invoice-print-layout h3 {
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 900;
}
.saved-invoice-print-layout table {
  font-size: 18px;
}
.saved-invoice-print-layout th,
.saved-invoice-print-layout td {
  padding: 14px 12px;
}
.saved-invoice-totals-list {
  width: min(440px, 100%);
  margin: 24px 0 0 auto;
  display: grid;
  gap: 8px;
  font-size: 22px;
}
.saved-invoice-totals-list div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  padding: 8px 0;
}
.saved-invoice-totals-list .grand-total {
  font-size: 28px;
  font-weight: 900;
}
.saved-invoices-modal {
  width: min(980px, calc(100vw - 36px)) !important;
  max-width: min(980px, calc(100vw - 36px)) !important;
}
.saved-invoices-modal .table-wrap {
  max-height: min(70vh, 760px);
  overflow: auto;
}
.invoice-toolbar-button {
  min-height: 38px;
  min-width: 160px;
  padding: 0 12px;
  font-size: 13px;
}
.invoice-save-button {
  background: var(--primary);
  border-color: var(--primary);
}
.ticket-designer-form > .primary-button {
  display: block;
  width: min(260px, 100%);
  margin: 8px auto 0;
}
#createUserButton {
  min-height: 30px;
  min-width: 0;
  padding: 0 10px;
  white-space: nowrap;
  width: auto;
  font-size: 12px;
  font-weight: 600;
}
.saved-invoice-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}
.saved-invoice-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.invoice-summary {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 12px;
}
.invoice-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.invoice-summary strong {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
}
.invoice-summary #invoiceGrossTotal {
  font-size: 28px;
  color: var(--primary);
  font-weight: 800;
}
.stock-inline-input {
  width: 86px;
  min-height: 36px;
  padding: 8px 10px;
  text-align: right;
  line-height: 1.2;
  box-sizing: border-box;
}
.invoice-name-input {
  width: min(240px, 100%);
  min-height: 36px;
  padding: 8px 10px;
  line-height: 1.2;
  box-sizing: border-box;
}
.invoice-grid td,
.invoice-grid th {
  vertical-align: middle;
}
.invoice-name-cell {
  display: grid;
  gap: 6px;
}
.invoice-name-cell small {
  display: block;
  line-height: 1.2;
}
.invoice-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.invoice-inline-prefix,
.invoice-inline-suffix {
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}
.invoice-money-input {
  width: 102px;
}
.invoice-percent-input {
  width: 72px;
}
.stock-inline-input::-webkit-outer-spin-button,
.stock-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stock-inline-input {
  -moz-appearance: textfield;
}
.tab-button {
  background: transparent;
  color: var(--muted);
  border: 0;
  box-shadow: none;
  padding: 0 10px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
}
.tab-button:hover {
  background: rgba(0,0,0,.05);
  color: var(--ink);
}
.tab-button.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  border: 1px solid var(--line);
}
.tab-button.active .tab-icon { color: var(--primary) !important; }
.report-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.report-cards.compact .metric strong { font-size: 22px; }
.metric {
  padding: 14px 16px;
  background: var(--paper);
  border-top: 3px solid var(--primary);
}
.metric strong { display: block; margin: 6px 0 4px; font-size: 22px; font-weight: 700; }
.metric small { display: block; line-height: 1.5; }
.report-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.report-preview-panel { margin-top: 16px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; font-size: 18px; }
.report-preview-content { min-height: 160px; }
.report-preview-document { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 18px; }
.report-preview-document header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.report-preview-document header h3 { margin: 0; font-size: 22px; }
.report-preview-document header span { color: var(--muted); font-weight: 800; }
.report-preview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.report-preview-metrics article { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fbff; }
.report-preview-metrics span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.report-preview-metrics strong { display: block; margin-top: 6px; font-size: 22px; }
.report-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-preview-grid h4 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; }
.report-chart { display: grid; gap: 8px; }
.chart-row { display: grid; grid-template-columns: minmax(130px, 190px) 1fr minmax(92px, auto); gap: 10px; align-items: center; font-weight: 800; }
.chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { height: 18px; border-radius: 999px; background: #e6edf5; overflow: visible; position: relative; }
.chart-bar { position: relative; display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.chart-bar i { position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.22); transform: translateY(-50%); }
.chart-value { text-align: right; white-space: nowrap; }
.report-preview-table { margin-top: 16px; max-height: none; }
.report-preview-close-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.vertical-chart {
  display: block;
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow-x: auto;
}
.line-chart-wrap { min-width: 720px; }
.line-chart-svg { display: block; width: 100%; height: 320px; background: #fff; }
.line-chart-grid { stroke: #d7dee8; stroke-width: 1; }
.line-chart-axis { stroke: #64748b; stroke-width: 2; }
.line-chart-y { fill: #475569; font-size: 11px; font-weight: 800; text-anchor: end; }
.line-chart-x { fill: #475569; font-size: 11px; font-weight: 800; text-anchor: end; }
.line-chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart-dot { stroke: #fff; stroke-width: 2; }
.line-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 900;
}
.line-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.line-chart-legend i { width: 18px; height: 4px; border-radius: 999px; display: inline-block; }
.classic-bar-chart {
  display: grid;
  grid-template-columns: 74px minmax(320px, 1fr);
  gap: 10px;
  min-height: 260px;
}
.classic-y-axis {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  align-items: start;
  justify-items: end;
  padding-top: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}
.classic-plot {
  position: relative;
  min-height: 236px;
  padding: 0 8px 0 4px;
  border-left: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
}
.classic-grid {
  position: absolute;
  inset: 0 8px 0 4px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #d7dee8 calc(25% - 1px), #d7dee8 25%),
    repeating-linear-gradient(to right, transparent 0, transparent calc(20% - 1px), rgba(215,222,232,.55) calc(20% - 1px), rgba(215,222,232,.55) 20%);
  pointer-events: none;
}
.classic-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  gap: 18px;
  min-height: 236px;
  padding: 16px 12px 0;
}
.classic-bar-item {
  display: grid;
  grid-template-rows: auto 180px auto;
  align-items: end;
  justify-items: center;
  min-width: 82px;
  gap: 8px;
  font-weight: 900;
}
.classic-bar-value { font-size: 12px; white-space: nowrap; color: var(--ink); }
.classic-bar-column {
  position: relative;
  display: flex;
  align-items: end;
  width: 42px;
  height: 180px;
  border-radius: 3px 3px 0 0;
  background: rgba(226,232,240,.72);
  overflow: visible;
}
.classic-bar-column span {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #f97316, #2563eb);
  border: 1px solid rgba(15,23,42,.32);
}
.classic-bar-column i {
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,.22);
  transform: translateX(-50%);
}
.classic-bar-label {
  max-width: 96px;
  min-height: 34px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
}
.expiration-alert-panel h3 { margin-top: 0; }
.expiration-alerts { display: grid; gap: 8px; }
.expiration-alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fefce8;
  color: #713f12;
  font-weight: 900;
}
.expiration-alert.expired {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.password-field { position: relative; display: flex; align-items: center; }
.password-field > input { flex: 1; width: 100%; padding-right: 44px; }
.password-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: none; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: #64748b; }
.password-eye:hover { color: #1e293b; }
.password-eye::before { content: ''; width: 22px; height: 22px; background-color: currentColor; -webkit-mask: var(--eye-mask) center / contain no-repeat; mask: var(--eye-mask) center / contain no-repeat; --eye-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 5c-5 0-9 4.5-10 7 1 2.5 5 7 10 7s9-4.5 10-7c-1-2.5-5-7-10-7zm0 11a4 4 0 110-8 4 4 0 010 8zm0-2a2 2 0 100-4 2 2 0 000 4z"/></svg>'); }
.password-eye.revealed::before { --eye-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M2 4.3l1.3-1.3 17.7 17.7-1.3 1.3-3.1-3.1A11 11 0 0112 19C7 19 3 14.5 2 12a13 13 0 014.2-5.1L2 4.3zm6 7.7a4 4 0 005.7 5.7l-1.5-1.5a2 2 0 01-2.7-2.7L8 12zm4-5c5 0 9 4.5 10 7a13 13 0 01-2.4 3.3l-2.9-2.9A4 4 0 0011.6 8L9.9 6.3A11 11 0 0112 6z"/></svg>'); }
.expiration-date-input { min-width: 160px; }
.expiration-date-cell { min-width: 160px; text-align: left; cursor: pointer; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; }
.expiration-date-cell:hover { border-color: #94a3b8; }
.expiration-date-cell.empty { color: #94a3b8; }
.expiration-warning { color: #b45309; font-weight: 900; }
.expiration-danger { color: #b91c1c; font-weight: 900; }
.expiration-row-alert { background: #fff7ed; }
.payment-summary-lines { display: grid; gap: 8px; font-size: 1.08rem; }
.payment-summary-lines strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 900;
}
.payment-summary-lines .mixed-change-line { background: #ecfeff; color: #0e7490; }
.payment-summary-lines strong:not(.mixed-change-line):not(.mixed-payment-status) { background: #eff6ff; color: #1d4ed8; }
.payment-summary-lines .mixed-payment-status { display: block; text-align: center; font-size: 20px; }
.mixed-payment-status.ok { background: #dcfce7; color: #166534; }
.mixed-payment-status.warning { background: #fef3c7; color: #92400e; }
.mixed-payment-status.danger { background: #fee2e2; color: #991b1b; }
.category-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.report-preview-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.report-preview-table-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}
.report-preview-table-box h4 { margin: 0 0 8px; }

.selection-counter {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafc;
  color: var(--muted);
  font-weight: 800;
}

.product-row.selected {
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.product-inactive-row {
  opacity: 0.78;
}

.product-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9f8f0;
  color: #0f7a49;
  font-weight: 900;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
.wide { grid-column: 1 / -1; }
.import-panel { margin-bottom: 16px; }
.import-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.import-header h3,
.import-header p,
.import-panel h4 { margin: 0; }
.import-progress-block {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.import-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.import-progress-block progress {
  width: 100%;
  height: 12px;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compact-table { max-height: 280px; }
.photo-row { display: flex; align-items: flex-end; gap: 12px; margin: 16px 0; }
#productImagePreview { width: 180px; }
.spacer { flex: 1; }
.backup-panel { max-width: 640px; }
.inventory-summary-panel { margin-bottom: 12px; }
.inventory-summary-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.inventory-summary-cards .metric { flex: 1; min-width: 140px; }
.inventory-cat-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.inventory-cat-table th { text-align: left; padding: 6px 10px; border-bottom: 2px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.inventory-cat-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.inventory-cat-table tbody tr:hover { background: var(--hover); }
.inventory-cat-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.payment-btn { display: inline-flex; align-items: center; gap: 7px; }
.payment-btn svg { flex-shrink: 0; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 4px 0; }
.payment-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  min-width: 88px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
  box-shadow: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  line-height: 1;
}
.payment-method-btn:hover {
  border-color: var(--pm-color, #6366f1);
  background: var(--pm-bg, #f5f3ff);
  box-shadow: 0 4px 14px rgba(15,23,42,.12);
  transform: translateY(-2px);
  color: var(--pm-color, #6366f1);
}
.payment-method-btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(15,23,42,.07); }
.payment-method-btn svg { flex-shrink: 0; }
.payment-btn-text { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.payment-btn-text span { font-size: 12px; font-weight: 800; }
.payment-btn-text small {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: .04em;
  color: #fff;
  background: var(--pm-color, #64748b);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.5;
  opacity: .85;
}
/* diálogo peso */
.common-sale-type { display: flex; gap: 18px; margin: 6px 0 12px; font-weight: 700; }
.common-sale-type label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.app-confirm-modal { width: min(460px, 92vw); }
.app-confirm-message { white-space: pre-line; margin: 8px 0 16px; line-height: 1.45; }
.weight-unit-toggle { display: flex; gap: 14px; margin-bottom: 10px; }
.weight-unit-label { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; cursor: pointer; }
.weight-display-box {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 8px;
  background: #0f172a; border-radius: 10px; padding: 10px 16px; margin-bottom: 6px;
}
/* edición peso desde carrito */
.qty-weight-edit {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; font-weight: 700; color: var(--primary);
  padding: 0 10px; font-size: 13px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.qty-weight-edit svg { width: 13px; height: 13px; opacity: .65; flex: none; }
.qty-weight-edit:hover svg { opacity: 1; }
.qty-weight-edit:hover { color: var(--primary-hover, #1d4ed8); }
/* diálogo stock cero */
.quick-stock-modal { max-width: 340px; }
.quick-stock-body { text-align: center; padding: 8px 0 4px; }
.quick-stock-icon { font-size: 36px; margin-bottom: 6px; }
.quick-stock-product { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.delivery-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.delivery-option-btn { min-width: 100px; }
.delivery-option-btn:hover { color: var(--pm-color, #6366f1); }
.close-cash-sales-summary { margin-bottom: 12px; }
.close-cash-breakdown { width: 100%; border-collapse: collapse; font-size: 13px; }
.close-cash-breakdown th, .close-cash-breakdown td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.close-cash-breakdown th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.close-cash-breakdown tfoot td { border-top: 2px solid var(--line); border-bottom: none; padding-top: 8px; }
.close-cash-breakdown .num { text-align: right; font-variant-numeric: tabular-nums; }
.sort-select {
  width: auto;
  max-width: 220px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
/* El buscador de productos no debe quedar diminuto cuando la barra tiene muchos botones */
.section-toolbar > #productSearch {
  min-width: 320px;
  height: 42px;
  font-size: 15px;
}
.toolbar-actions select,
.toolbar-actions button { width: auto; }
.setting-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.setting-logo-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  min-width: 80px;
}
.setting-logo-preview {
  width: 48px;
  height: 48px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  background: #f8fafc;
  flex-shrink: 0;
}
.setting-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.connection-status-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}
.connection-status-card span {
  color: var(--muted);
  font-weight: 800;
}
.connection-status-card strong {
  font-size: 16px;
}
.ticket-designer-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.ticket-designer-form {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.td-logo-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.td-logo-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.td-logo-controls label {
  font-size: 11px;
  gap: 4px;
  color: var(--muted);
}
.ticket-logo-preview {
  width: 80px;
  height: 80px;
  min-height: unset;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.ticket-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ticket-preview-panel {
  background: #eef0f4;
  border-radius: var(--radius);
  overflow: auto;
  max-height: 82vh;
}
.ticket-preview-shell {
  display: flex;
  justify-content: center;
  padding: 16px 12px 20px;
}
.ticket-preview-ticket {
  width: 76mm;
  padding: 18px 16px;
  border: none;
  border-radius: 4px;
  background: #fff;
  color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,.10), 0 8px 24px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
}
.ticket-qr-placeholder {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: #f0f2f5;
  border-radius: 4px;
}
.ticket-preview-header {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #d8dee8;
}
.ticket-preview-logo {
  display: block;
  max-width: 100%;
  margin: 0 auto 8px;
  /* fill: ancho y alto se ajustan por separado */
  object-fit: fill;
  border-radius: 16px;
  background: #fff;
}
.ticket-preview-logo-empty {
  display: grid;
  place-items: center;
  border: 1px dashed #c8d0dc;
  color: #64748b;
}
.ticket-preview-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ticket-preview-header h4 {
  margin: 6px 0 4px;
  font-size: 24px;
  line-height: 1.05;
}
.ticket-preview-header p {
  margin: 0;
  font-size: 13px;
  color: #334155;
}
.ticket-preview-meta {
  display: grid;
  gap: 4px;
  padding: 12px 0 10px;
  font-size: 13px;
}
.ticket-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ticket-preview-table th,
.ticket-preview-table td {
  padding: 7px 0;
  border-bottom: 1px solid #d8dee8;
}
.ticket-preview-table th:last-child,
.ticket-preview-table td:last-child,
.ticket-preview-table th:nth-child(2),
.ticket-preview-table td:nth-child(2) {
  text-align: right;
}
.ticket-preview-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 900;
}
.ticket-preview-total strong {
  font-size: 24px;
}
.ticket-preview-line,
.ticket-preview-payments div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 900;
}
.ticket-preview-payments {
  display: grid;
  gap: 4px;
}
.ticket-preview-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #d8dee8;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}
.ticket-preview-footer div + div {
  margin-top: 4px;
}
.ticket-preview-whatsapp {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}
.ticket-preview-qr {
  margin-top: 8px;
  text-align: center;
}
.ticket-preview-qr img {
  width: 34mm;
  height: 34mm;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.ticket-preview-qr svg {
  width: 30mm;
  height: 30mm;
  display: block;
  margin: 0 auto;
}

/* Switch tipo iOS para el QR (verde = activo, rojo = apagado) */
.qr-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.qr-toggle-label { font-weight: 700; color: var(--ink); }
.ios-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  cursor: pointer;
  padding: 0;
  gap: 0;
}
.ios-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.ios-switch-track {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--danger);
  transition: background .2s ease;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.ios-switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease;
}
.ios-switch input:checked + .ios-switch-track { background: #1e9e5a; }
.ios-switch input:checked + .ios-switch-track .ios-switch-thumb { transform: translateX(20px); }

/* ── Control de tamaño del logo del ticket ───────────────────────── */
.td-logo-row {
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.td-logo-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.td-logo-head .ticket-logo-preview {
  width: 96px;
  height: 96px;
}
.td-logo-head .ghost-button { width: 100%; }
.td-logo-sliders {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}
.size-slider { display: grid; gap: 8px; color: var(--muted); font-weight: 700; font-size: 12px; }
.size-slider-top { display: flex; align-items: baseline; justify-content: space-between; }
.size-slider-top b {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.size-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e5e7eb;
  outline: none;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.size-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(15,23,42,.35);
  cursor: pointer;
  margin-top: -7px;
}
.size-range:focus { box-shadow: var(--ring); }
.ticket-preview-signature {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

dialog {
  border: 0;
  background: transparent;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  max-width: min(96vw, 1120px);
  max-height: 92vh;
  z-index: 1000;
}
dialog::backdrop { background: rgba(0, 0, 0, .4); }
body.dialog-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: none;
  pointer-events: none;
  z-index: 999;
}
.modal { position: relative; overflow: visible; width: min(560px, 92vw); padding: 20px; }
.wide-modal { width: min(820px, 94vw); }
#productDialog .modal {
  max-height: calc(92vh - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#productDialog .modal footer {
  position: sticky;
  bottom: -20px;
  margin: 16px -20px -20px;
  padding: 12px 20px 16px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 2;
}
.modal header, .modal footer {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.modal header h2,
.modal footer .primary-button,
.modal footer .danger-button,
.modal footer .ghost-button {
  margin-bottom: 0;
}
.close-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  font-size: 18px;
  font-weight: 900;
}
.login-modal footer {
  justify-content: flex-end;
}
.config-only-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}
.config-only-row button {
  font-size: 12px;
  opacity: 0.85;
}
.payment-modal { text-align: center; max-height: calc(92vh - 8px); overflow-y: auto; overscroll-behavior: contain; }
.payment-total { display: block; font-size: 42px; margin: 14px 0 20px; }
.payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.payment-extra {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
}
.payment-extra.hidden { display: none; }
.payment-extra > strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 20px;
}
.payment-extra > strong span {
  font-size: 32px;
  line-height: 1;
}
.admin-auth-box {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}
.admin-auth-box h3 { margin: 0 0 12px; font-size: 16px; }
.stock-add-input { min-width: 110px; }
.support-modal { text-align: center; }
.support-intro { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.support-note, .support-subtitle { margin: 4px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.support-link { display: inline-block; margin: 4px 0 14px; color: var(--primary-dark); font-size: 18px; font-weight: 800; }
.fast-reply { display: inline-block; padding: 6px 10px; border-radius: 999px; background: #eef7ff; color: #0f2740; }
/* Soporte: teléfono + QR WhatsApp + correo con copiar */
.support-phone { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.support-qr-caption { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.support-qr { display: flex; justify-content: center; margin-bottom: 6px; }
.support-qr svg {
  width: 150px;
  height: 150px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
#supportEmail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.support-email-link {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
  cursor: pointer;
}
.support-email-link:hover { text-decoration: underline; }
.support-copy { width: 36px; height: 36px; flex: 0 0 auto; }
.receipt-preview-browser {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: #eef2f7;
}
.receipt-preview-canvas {
  min-height: 72vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}
.receipt-preview-canvas > #saleReceiptPreviewContent {
  width: min(420px, 100%);
}
.receipt-preview-frame {
  display: block;
  width: 92mm;
  min-height: 720px;
  margin: 0 auto;
  border: 0;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}
#saleReceiptPreviewContent .ticket-preview-ticket {
  width: 100%;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

@media (max-width: 640px) {
  dialog {
    max-width: 100vw;
    max-height: 100dvh;
  }
  #productDialog {
    inset: 0;
    transform: none;
    width: 100vw;
    height: 100dvh;
  }
  #productDialog .modal {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 16px;
  }
  #productDialog .modal footer {
    bottom: -16px;
    margin: 14px -16px -16px;
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  }
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  bottom: auto;
  z-index: 2147483647;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  min-width: 320px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(15, 23, 42, .96);
  color: white;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 18px 48px rgba(15,23,42,.22);
  filter: none;
  backdrop-filter: none;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: white;
  font-size: 18px;
  font-weight: 900;
}
.toast.success {
  background: rgba(5, 150, 105, .95);
  box-shadow: 0 18px 48px rgba(5,150,105,.28);
}
.toast.success::before {
  content: "✓";
  background: rgba(255,255,255,.14);
  color: white;
}
.toast.error {
  background: rgba(185, 28, 28, .95);
  box-shadow: 0 18px 48px rgba(185,28,28,.28);
}
.toast.error::before {
  content: "!";
  background: rgba(255,255,255,.14);
  color: white;
}
.toast.warning {
  background: rgba(180, 83, 9, .95);
  box-shadow: 0 18px 48px rgba(180,83,9,.28);
}
.toast.warning::before {
  content: "!";
  background: rgba(255,255,255,.14);
  color: white;
}
.toast.show { opacity: 1; transform: translateY(0); }
dialog .toast {
  position: fixed;
  right: 24px;
  top: 24px;
  bottom: auto;
  z-index: 2147483647;
  filter: none;
  backdrop-filter: none;
}
.hidden { display: none !important; }

@media (max-width: 1120px) {
  main { padding: 84px 16px 24px; }
  body.sidebar-open main {
    padding-left: calc(min(86vw, var(--sidebar-width)) + 18px);
  }
  .menu-toggle {
    top: 18px;
    left: 16px;
  }
  body.sidebar-open .menu-toggle {
    left: calc(min(86vw, var(--sidebar-width)) + 14px);
  }
  .sidebar {
    width: min(86vw, 264px);
    min-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
  }
  nav { grid-auto-flow: row; }
  .developer-credit { margin-top: auto; }
  .sale-layout, .report-cards, .invoice-grid, .report-preview-grid, .report-preview-metrics { grid-template-columns: 1fr; }
  .invoice-summary { position: static; }
  .sale-layout {
    max-width: 100%;
    min-height: calc(100vh - 188px);
  }
  .sale-panel {
    position: relative;
    top: 0;
    min-height: calc(100vh - 188px);
    max-height: none;
  }
  .import-grid { grid-template-columns: 1fr; }
  .topbar,
  .topbar-pos,
  .topbar-admin { grid-template-columns: 1fr; align-items: flex-start; }
  .topbar-status {
    width: 100%;
    justify-content: stretch;
  }
  .admin-session {
    width: 100%;
    justify-content: space-between;
  }
  .selection-counter {
    width: 100%;
    justify-content: center;
  }
  .cash-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .total-box,
  .cash-box {
    width: 100%;
  }
  .clock-box {
    right: 12px;
    bottom: 66px;
  }
  .floating-credit {
    right: 12px;
    bottom: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .ticket-designer-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Zuko Market: menú de idioma en sidebar ─────────── */
.nav-lang-menu {
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.nav-lang-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.5);
  margin-bottom: 8px;
}
.nav-lang-options {
  display: flex; flex-direction: column; gap: 4px;
}
.nav-lang-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: background .12s, color .12s, border-color .12s;
}
.nav-lang-opt:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.nav-lang-opt.active {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
  color: #fff; font-weight: 800;
}

/* ════════════════════════════════════════════════════════════════════
   PREMIUM THEME  —  capa visual (solo estética, sin cambios de layout)
   ════════════════════════════════════════════════════════════════════ */

/* App surface ------------------------------------------------------- */
body {
  background: var(--grad-app);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tipografía -------------------------------------------------------- */
h1 { letter-spacing: -.02em; font-weight: 800; color: var(--ink); }
h2 { letter-spacing: -.01em; font-weight: 800; color: var(--ink); }
h3, h4 { color: var(--ink); }
.sale-title { letter-spacing: -.02em; font-weight: 800; }

/* Inputs ------------------------------------------------------------ */
input, select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fdfefe;
  padding: 10px 13px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input:hover, select:hover, textarea:hover { border-color: #c2cbd8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--ring);
}

/* Botones ----------------------------------------------------------- */
.primary-button, .secondary-button, .ghost-button, .danger-button, .icon-button, .tab-button {
  border-radius: var(--radius-sm);
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.primary-button {
  background: #1f8a63;
  border: 1px solid #177453;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}
.primary-button:hover {
  background: #1c7d59;
  box-shadow: 0 2px 8px rgba(23,116,83,.26);
}
.primary-button:active { background: #177453; box-shadow: none; }
/* "Cambiar administrador" / "Ingresar" se mantiene gris pizarra (neutro). */
#adminLoginButton { background: #334155; border-color: #26303f; }
#adminLoginButton:hover { background: #3d4a5c; box-shadow: 0 2px 8px rgba(15,23,42,.22); }
#adminLoginButton:active { background: #26303f; }
.secondary-button, .ghost-button, .icon-button {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}
.secondary-button:hover, .ghost-button:hover, .icon-button:hover {
  background: #fbfcfd;
  border-color: #aeb9c7;
  color: var(--ink);
}
.danger-button {
  background: #fff;
  color: var(--danger);
  border: 1px solid #e6c2c9;
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}
.danger-button:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #d99aa6;
}
.xl { min-height: 50px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }

/* Sidebar premium --------------------------------------------------- */
.sidebar {
  background: var(--grad-sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 1px 0 0 rgba(255,255,255,.05), 18px 0 50px rgba(5,12,10,.45);
}
.brand { border-bottom: 1px solid rgba(255,255,255,.10); }
.brand strong { letter-spacing: -.01em; }
.brand-logo {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.nav-button { position: relative; border-radius: 9px; }
.nav-button:hover { background: rgba(255,255,255,.06); color: #e8f1ee; }
.nav-button.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 600;
}
.nav-button.active::before {
  content: "";
  position: absolute;
  left: -16px; top: 50%;
  width: 3px; height: 20px;
  transform: translateY(-50%);
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

/* Tarjeta de caja en sidebar --------------------------------------- */
.sidebar-cash-card {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.cash-box.open { border-top: 2px solid var(--accent); }

/* Paneles / tarjetas ------------------------------------------------ */
.panel, .card, .invoice-saved-panel, .import-panel, .inventory-summary-panel,
.backup-panel, .report-preview-panel, .admin-locked {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 22px; }
.sale-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* KPI / métricas ---------------------------------------------------- */
.metric {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: .85;
}
.metric strong { font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.total-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 2px solid var(--primary);
  border-radius: 13px;
  box-shadow: var(--shadow);
}
.total-box strong { color: var(--primary-dark); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* Tablas ------------------------------------------------------------ */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: auto;
}
th { color: var(--muted); background: #f7f9fc; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--hover); }

/* Pills / badges ---------------------------------------------------- */
.product-active-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(15,138,95,.18);
}
.status-badge, .product-status, .active-badge {
  border-radius: 999px;
  padding: 4px 11px;
}
.selection-counter { border-radius: 999px; background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-soft); }

/* Tabs admin -------------------------------------------------------- */
.tab-button {
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
}
.tab-button:hover { border-color: #aeb9c7; color: var(--ink); }
.tab-button.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(21,113,90,.18);
}

/* Sugerencias ------------------------------------------------------- */
.suggestions {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  /* Con overflow hidden no se podia bajar para ver mas productos. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.suggestion-item:hover { background: var(--primary-soft); }

/* Controles de cantidad -------------------------------------------- */
.qty-control { border-radius: 999px; overflow: hidden; border: 1px solid var(--line-strong); }
.qty-control button { background: var(--primary-soft); color: var(--primary-dark); }
.qty-control button:hover { background: #d4efe3; }

/* Diálogos / modales premium --------------------------------------- */
dialog::backdrop { background: rgba(8,15,26,.52); }
body.dialog-open::before { background: rgba(8,15,26,.52); }
.modal {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.modal header { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.payment-method-btn { border-radius: 16px; }

/* Toast — card oscuro premium (texto blanco legible, acento e icono de color
   brillante). Verde+check = positivo · Rojo+exclamación = negativo. */
.toast {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 15px 20px 15px 22px;
  border-radius: 15px;
  background: #1b232e !important;
  color: #f5f7fa !important;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 46px rgba(8,13,20,.46), 0 2px 8px rgba(8,13,20,.34) !important;
  overflow: hidden;
}
.toast.success, .toast.error, .toast.warning {
  background: #1b232e !important;
  box-shadow: 0 18px 46px rgba(8,13,20,.46), 0 2px 8px rgba(8,13,20,.34) !important;
}
/* Acento de color a la izquierda (barra vertical brillante) */
.toast::before {
  content: "" !important;
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  height: auto;
  border-radius: 0;
  background: rgba(255,255,255,.2);
  box-shadow: none;
  font-size: 0;
}
.toast.success::before { content: "" !important; width: 4px; background: linear-gradient(180deg, #34d399, #10b981) !important; }
.toast.error::before { content: "" !important; width: 4px; background: linear-gradient(180deg, #fb7185, #e11d48) !important; }
/* Chip del icono: tinte suave del color de la acción sobre el card oscuro */
.toast-ico {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex: 0 0 auto;
}
.toast.success .toast-ico { background: rgba(52,211,153,.16); color: #34d399; box-shadow: inset 0 0 0 1px rgba(52,211,153,.30); }
.toast.error .toast-ico { background: rgba(251,113,133,.16); color: #fb7185; box-shadow: inset 0 0 0 1px rgba(251,113,133,.30); }
.toast-ico svg { width: 21px; height: 21px; display: block; }
.toast-msg {
  min-width: 0;
  color: #f5f7fa;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -.005em;
}

/* Botón cerrar (X) — mismo estilo card que el toggle del panel lateral
   (cuadrado con borde redondeado), centrado y nítido, un poco más pequeño. */
.close-icon {
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  flex: 0 0 32px;
  border: 1px solid var(--line) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0 !important;
  display: inline-grid;
  place-items: center;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.close-icon { position: relative; }
.close-icon:hover { background: var(--hover) !important; color: var(--ink); border-color: var(--line-strong) !important; }
.close-icon:active { background: var(--line) !important; }
.close-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  background-color: currentColor;
  -webkit-mask: var(--x-mask) center / contain no-repeat;
  mask: var(--x-mask) center / contain no-repeat;
  --x-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" d="M6 6l12 12M18 6L6 18"/></svg>');
}

/* Textareas: solo se agrandan hacia abajo y nunca exceden el ancho/alto de la
   ventana (antes se salían del diálogo al ensancharlas). */
textarea {
  resize: vertical;
  max-width: 100%;
  max-height: 45vh;
}

/* ── Botones estandarizados en toda la sección Administración ──────── */
.admin-section .section-toolbar .ghost-button,
.admin-section .section-toolbar .primary-button,
.admin-section .section-toolbar .danger-button,
.admin-section .section-toolbar .secondary-button {
  height: 40px;
  min-height: 40px;
}
.admin-section .section-toolbar .sort-select,
.admin-section .section-toolbar select {
  height: 40px;
}
.admin-section .selection-counter {
  height: 40px;
  min-height: 40px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-weight: 700;
}

/* Toolbars de Productos y Vencimientos: filas alineadas a la IZQUIERDA y
   buscador compacto. */
#adminProducts .section-toolbar,
#adminExpirations .section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
#adminProducts .section-toolbar .toolbar-actions,
#adminExpirations .section-toolbar .toolbar-actions {
  justify-content: flex-start;
  gap: 10px;
}
#adminProducts .toolbar-spacer { display: none; }
#adminProducts #productSearch,
#adminExpirations #expirationSearch {
  flex: 0 1 300px;
  width: auto;
  min-width: 220px;
  height: 40px;
  font-size: 14px;
}

/* ── Alarma de vencimiento: cards premium ─────────────────────────── */
.exp-alert {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 12px 15px 12px 17px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.exp-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.exp-alert.is-soon::before { background: linear-gradient(180deg, #f6c453, #e0a019); }
.exp-alert.is-today::before,
.exp-alert.is-expired::before { background: linear-gradient(180deg, #e06a78, #c0394e); }
.exp-alert-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.exp-alert.is-soon .exp-alert-ico { background: #fdf3da; color: #a8740f; }
.exp-alert.is-today .exp-alert-ico,
.exp-alert.is-expired .exp-alert-ico { background: #fbe9ec; color: #c0394e; }
.exp-alert-ico svg { width: 21px; height: 21px; display: block; }
.exp-alert-body { min-width: 0; display: grid; gap: 2px; }
.exp-alert-name {
  font-weight: 800;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exp-alert-sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.exp-alert-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.exp-alert.is-soon .exp-alert-badge { background: #fdf3da; color: #8a5e0b; }
.exp-alert.is-today .exp-alert-badge,
.exp-alert.is-expired .exp-alert-badge { background: #fbe9ec; color: #b3324a; }

/* ── Color del menú lateral: swatches + esfera multicolor ──────────── */
.sidebar-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.sb-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.sb-swatch:hover { transform: translateY(-1px); }
.sb-swatch.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,113,90,.22);
}
.sb-swatch-custom {
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  border-color: var(--line-strong);
  background: conic-gradient(from 0deg, #ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}
.sb-swatch-custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

/* ── Auto-contraste del panel lateral ──────────────────────────────────
   Cuando el color elegido es CLARO, todo el contenido del sidebar pasa a
   oscuro para que se siga leyendo perfectamente. */
body.sidebar-on-light .brand strong { color: #0f1b2d; }
body.sidebar-on-light .brand small { color: rgba(15,27,45,.6); }
body.sidebar-on-light .brand { border-bottom-color: rgba(0,0,0,.12); }
body.sidebar-on-light .brand-logo { border-color: rgba(0,0,0,.14); background: rgba(0,0,0,.05); }
body.sidebar-on-light .nav-button { color: rgba(15,27,45,.72); }
body.sidebar-on-light .nav-button:hover { background: rgba(0,0,0,.06); color: #0f1b2d; }
body.sidebar-on-light .nav-button.active { background: rgba(0,0,0,.09); color: #0f1b2d; }
body.sidebar-on-light .sidebar {
  border-right-color: rgba(0,0,0,.08);
  box-shadow: 1px 0 0 rgba(0,0,0,.05), 18px 0 50px rgba(15,27,45,.14);
}
body.sidebar-on-light .sidebar-cash-card {
  background: rgba(0,0,0,.05) !important;
  border-color: rgba(0,0,0,.12) !important;
  color: #0f1b2d !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.04) !important;
}
body.sidebar-on-light .sidebar-cash-card span,
body.sidebar-on-light .sidebar-cash-card small { color: rgba(15,27,45,.6) !important; }
body.sidebar-on-light .sidebar-cash-card strong { color: #0f1b2d !important; }
body.sidebar-on-light .sidebar-cash-actions button {
  background: rgba(0,0,0,.06) !important;
  border-color: rgba(0,0,0,.14) !important;
  color: #0f1b2d !important;
}
body.sidebar-on-light .sidebar-cash-actions button:hover:not(:disabled) { background: rgba(0,0,0,.1) !important; }
body.sidebar-on-light .sidebar-cash-actions .primary-button { background: rgba(0,0,0,.12) !important; color: #0f1b2d !important; }
body.sidebar-on-light .sidebar-cash-actions .danger-button {
  background: rgba(192,57,78,.12) !important;
  border-color: rgba(192,57,78,.4) !important;
  color: #9b2740 !important;
}
body.sidebar-on-light .sidebar-cash-actions button:disabled { color: rgba(15,27,45,.4) !important; }
body.sidebar-on-light .developer-brand,
body.sidebar-on-light .developer-credit strong { color: #0f1b2d; }
/* El logo CajaGou es blanco/transparente: sobre panel claro necesita su chip
   oscuro para no perderse. */
body.sidebar-on-light .developer-credit .developer-brand img {
  background: #121a21;
  padding: 3px;
  border-radius: 5px;
}

/* Scrollbars premium ----------------------------------------------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c3ccd8;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #9aa6b6; background-clip: content-box; }

/* CajaGou web: mientras llegan los datos del negocio no se muestra el icono
   de imagen rota ni el nombre de fabrica ("POS Local Retail"). */
img#businessLogo:not([src]), img#saleBusinessLogo:not([src]),
img#businessLogo[src=""], img#saleBusinessLogo[src=""] { visibility: hidden; }
body:not(.cajagou-datos) #businessName,
body:not(.cajagou-datos) #saleBusinessName,
body:not(.cajagou-datos) #branchName { visibility: hidden; }

/* Accesos rapidos */
.shortcuts-table td { vertical-align: middle; }
.shortcuts-table .shortcut-key {
  display: inline-block; min-width: 64px; padding: 4px 10px; border-radius: 8px; text-align: center;
  font-weight: 800; background: #f1f5f9; border: 1px solid #cbd5e1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.shortcuts-table .shortcut-key.empty { color: #94a3b8; font-weight: 600; font-family: inherit; }
.shortcuts-table .shortcut-key.waiting { background: #fef9c3; border-color: #eab308; color: #854d0e; }
.shortcuts-table .shortcut-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.shortcuts-footer { display: flex; justify-content: flex-end; margin-top: 14px; }

/* Consulta de precios: aire entre la tabla y los botones */
#priceCheckForm footer { margin-top: 18px; padding-top: 14px; }
#priceCheckForm .table-wrap.compact { margin-top: 12px; }

/* Formulario de producto por secciones */
#productDialog .product-section { border: 1px solid #e5e9f0; border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; background: #fff; }
#productDialog .product-section h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: #475569; }
#productDialog .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#productDialog .form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#productDialog .product-hint { margin: 8px 0 0; font-size: 13px; color: #64748b; font-weight: 600; min-height: 18px; }
#productDialog .product-hint strong { color: #166534; }
#productDialog .product-hint.warn strong { color: #b91c1c; }
#productDialog .product-section-head { display: flex; align-items: center; justify-content: space-between; }
#productDialog .product-section-head h3 { margin: 0; }
#productDialog .product-promo { margin-top: 12px; }
#productDialog .promo-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
#productDialog .promo-type { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid #d8dee8; border-radius: 10px; cursor: pointer; font-weight: 600; }
#productDialog .promo-type input { width: auto; margin-top: 3px; }
#productDialog .promo-type span { display: grid; gap: 2px; }
#productDialog .promo-type small { color: #64748b; font-weight: 500; }
#productDialog .promo-type:has(input:checked) { border-color: #16a34a; background: #f0fdf4; }
#productDialog .promo-preview { background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
#productDialog .product-more summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
#productDialog .product-more summary::-webkit-details-marker { display: none; }
#productDialog .product-more summary h3 { margin: 0; }
#productDialog .product-more summary h3::before { content: '▸ '; }
#productDialog .product-more[open] summary h3::before { content: '▾ '; }
#productDialog .product-more summary small { color: #94a3b8; }
#productDialog .product-more[open] summary { margin-bottom: 12px; }
.cart-promo { color: #15803d; font-weight: 700; }
@media (max-width: 760px) {
  #productDialog .form-grid-3, #productDialog .form-grid-4, #productDialog .promo-types { grid-template-columns: 1fr 1fr; }
}

/* Foto automatica del producto seleccionado */
.product-preview .auto-image-slot { display: grid; justify-items: center; gap: 4px; }
#productPreview .auto-image-slot img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 12px; background: #fff; }
.product-preview .auto-image-foot { display: flex; gap: 10px; align-items: center; font-size: 11px; color: #94a3b8; }
.product-preview .auto-image-foot button { background: none; border: 0; padding: 0; color: #64748b; text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------------------------------------------------------------------------
   Ajustes CajaGou web
   ------------------------------------------------------------------------ */

/* Botones de las ventanas con aire respecto del ultimo campo */
.modal footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); margin-bottom: 0; }
#productDialog .modal footer { margin-top: 16px; }

/* Mensajes: tarjeta clara y sobria */
.toast,
.toast.success, .toast.error, .toast.warning {
  background: #ffffff !important;
  color: #1c2430 !important;
  border: 1px solid #e3e6eb !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06) !important;
  padding: 12px 16px 12px 14px !important;
  gap: 12px !important;
  min-width: 300px;
  max-width: 440px;
}
.toast::before, .toast.success::before, .toast.error::before, .toast.warning::before { display: none !important; content: none !important; }
.toast-ico {
  width: 28px !important; height: 28px !important; border-radius: 999px !important;
  box-shadow: none !important;
}
.toast-ico svg { width: 16px !important; height: 16px !important; }
.toast.success .toast-ico { background: #e8f3ec !important; color: #2f7d4f !important; }
.toast.error .toast-ico { background: #fbeceb !important; color: #c0392b !important; }
.toast.warning .toast-ico { background: #fdf3e1 !important; color: #b7791f !important; }
.toast-msg { color: #1c2430 !important; font-weight: 500 !important; font-size: 14px !important; line-height: 1.45 !important; }

/* Quitar del carrito: la misma X (cuadro con borde) que el resto de ventanas */
.cart-remove.close-icon { width: 30px !important; height: 30px !important; min-height: 30px !important; }

/* Venta comun */
.common-sale-modal { width: min(480px, 94vw); }
.common-sale-modal header { align-items: flex-start; }
.common-sale-modal header h2 { margin: 0; }
.common-sale-sub { margin: 2px 0 0; font-size: 13px; }
.cs-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #f1f3f6; border-radius: 10px; margin-bottom: 14px; }
.cs-segment label { display: block; margin: 0; cursor: pointer; }
.cs-segment input { position: absolute; opacity: 0; pointer-events: none; }
.cs-segment span { display: block; text-align: center; padding: 8px 10px; border-radius: 7px; font-weight: 600; color: #6b7483; }
.cs-segment input:checked + span { background: #fff; color: #1c2430; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.cs-price { font-size: 20px !important; font-weight: 700 !important; }
.cs-stepper { display: grid; grid-template-columns: 42px 1fr 42px; border: 1px solid var(--line-strong, #d5d9e0); border-radius: 10px; overflow: hidden; }
.cs-stepper button { border: 0; border-radius: 0; min-height: 44px; background: #f5f6f8; font-size: 20px; font-weight: 600; color: #1c2430; }
.cs-stepper button:hover { background: #eceff3; }
.cs-stepper input { border: 0 !important; border-radius: 0 !important; text-align: center; font-size: 18px; font-weight: 700; box-shadow: none !important; -moz-appearance: textfield; }
.cs-stepper input::-webkit-outer-spin-button, .cs-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cs-weight { display: grid; gap: 6px; }
.cs-weight-read { font-size: 13px; color: #6b7483; text-align: right; }
.cs-weight-read strong { font-size: 18px; color: #1c2430; }
.cs-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; padding: 14px 16px; background: #f5f6f8; border-radius: 10px; }
.cs-total strong { font-size: 26px; font-weight: 750; color: #1c2430; }
.common-sale-modal .hidden { display: none !important; }

/* Lista de productos: edicion en linea */
.product-inline-input { width: 96px; min-height: 34px; padding: 6px 8px; text-align: right; box-sizing: border-box; }
.product-inline-input.margin { width: 70px; }
.mini-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: #6b7483; margin: 0; }
.mini-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mini-switch .mini-track { width: 34px; height: 20px; border-radius: 999px; background: #cfd4dc; position: relative; transition: background .15s ease; flex: 0 0 auto; }
.mini-switch .mini-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s ease; }
.mini-switch input:checked + .mini-track { background: #2f9e5f; }
.mini-switch input:checked + .mini-track::after { transform: translateX(14px); }
.mini-switch input:focus-visible + .mini-track { outline: 2px solid #1f3354; outline-offset: 2px; }
.common-sale-modal div.field { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
.common-sale-modal .cs-grid { align-items: start; }
.common-sale-modal .cs-price, .common-sale-modal #commonSaleWeightInput { height: 46px; min-height: 46px; box-sizing: border-box; }
.common-sale-modal .cs-stepper { height: 46px; }
.common-sale-modal .cs-stepper button, .common-sale-modal .cs-stepper input { height: 44px; min-height: 44px; }
.common-sale-modal #commonSaleWeightInput { text-align: right; font-size: 20px; font-weight: 700; }

/* ---------------------------------------------------------------------------
   Diseno ticket (solo estetica)
   ------------------------------------------------------------------------ */
#adminTicketDesigner .ticket-designer-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
#adminTicketDesigner .ticket-designer-form { padding: 0 !important; overflow: hidden; }
#adminTicketDesigner .td-head { padding: 18px 22px 14px; border-bottom: 1px solid #e3e6eb; }
#adminTicketDesigner .td-head h2 { margin: 0; font-size: 17px; font-weight: 650; color: #1c2430; }
#adminTicketDesigner .td-head p { margin: 2px 0 0; font-size: 13px; }
#adminTicketDesigner .td-block { padding: 16px 22px; border-bottom: 1px solid #eef0f3; }
#adminTicketDesigner .td-block h3 { margin: 0 0 12px; font-size: 13px; font-weight: 650; color: #475569; }
#adminTicketDesigner .td-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#adminTicketDesigner .td-block-head h3 { margin: 0; }
#adminTicketDesigner .td-block-head .qr-toggle-row { padding: 0; margin: 0; gap: 10px; }
#adminTicketDesigner .qr-toggle-label { font-size: 13px; font-weight: 600; color: #475569; }
#adminTicketDesigner .compact-grid { gap: 12px; }
#adminTicketDesigner label { font-weight: 600; font-size: 13px; color: #6b7483; }
#adminTicketDesigner .td-logo-row { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; margin: 0; padding: 0; border: 0; background: none; }
#adminTicketDesigner .td-logo-head { display: grid; gap: 8px; }
#adminTicketDesigner .ticket-logo-preview {
  width: 132px; height: 96px; border: 1px dashed #cfd4dc; border-radius: 10px; background: #fafbfc;
  display: grid; place-items: center; color: #94a3b8; font-size: 12px; font-weight: 600; overflow: hidden;
}
#adminTicketDesigner .ticket-logo-preview img { max-width: 88%; max-height: 80%; object-fit: contain; }
#adminTicketDesigner .td-logo-sliders { display: grid; gap: 14px; }
#adminTicketDesigner .size-slider-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
#adminTicketDesigner .size-slider-top b { font-weight: 650; color: #1c2430; font-variant-numeric: tabular-nums; }
#adminTicketDesigner .size-range { height: 4px; border-radius: 999px; }
#adminTicketDesigner .size-range::-webkit-slider-thumb { width: 16px; height: 16px; border-radius: 999px; background: #fff; border: 2px solid #1f3354; box-shadow: 0 1px 3px rgba(16,24,40,.2); }
#adminTicketDesigner .size-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 999px; background: #fff; border: 2px solid #1f3354; }
#adminTicketDesigner .ios-switch-track { background: #cfd4dc !important; }
#adminTicketDesigner .ios-switch input:checked + .ios-switch-track { background: #2f9e5f !important; }
#adminTicketDesigner .td-actions { display: flex; justify-content: flex-end; padding: 14px 22px; background: #fafbfc; }
#adminTicketDesigner .td-actions .primary-button { min-width: 160px; }
#adminTicketDesigner .ticket-preview-panel { position: sticky; top: 16px; background: #eceff3; border: 1px solid #e3e6eb; border-radius: 12px; padding: 14px 18px 22px; }
#adminTicketDesigner .td-preview-label { font-size: 12px; font-weight: 600; color: #6b7483; margin-bottom: 12px; text-align: center; }
#adminTicketDesigner .ticket-preview-shell { display: flex; justify-content: center; }
#adminTicketDesigner .ticket-preview-ticket { box-shadow: 0 6px 18px rgba(16,24,40,.10) !important; border: 0 !important; border-radius: 4px !important; }
#adminTicketDesigner .ticket-preview-logo-empty { border: 1px dashed #cfd4dc !important; border-radius: 8px !important; background: #fafbfc !important; color: #94a3b8 !important; min-height: 40px; }
@media (max-width: 980px) { #adminTicketDesigner .ticket-designer-grid { grid-template-columns: 1fr; } #adminTicketDesigner .ticket-preview-panel { position: static; } }

/* ---------------------------------------------------------------------------
   Menu lateral: sobrio y ordenado (respeta el color elegido en Configuracion)
   ------------------------------------------------------------------------ */
.sidebar { padding: 18px 14px !important; gap: 14px !important; box-shadow: 1px 0 0 rgba(255,255,255,.04) !important; }
.sidebar .brand { gap: 11px; padding: 2px 4px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand-logo { width: 40px; height: 40px; border-radius: 9px; border: 1px solid rgba(255,255,255,.10) !important; background: rgba(255,255,255,.04) !important; box-shadow: none !important; object-fit: cover; }
.sidebar .brand strong { font-size: 14px; font-weight: 650; line-height: 1.25; }
.sidebar .brand small { font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.3; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar .nav-button {
  justify-content: flex-start; gap: 10px; min-height: 38px; padding: 0 12px !important; border-radius: 8px !important;
  font-size: 14px; font-weight: 500 !important; color: rgba(255,255,255,.72) !important; background: transparent !important; box-shadow: none !important;
}
.sidebar .nav-button svg { opacity: .8; }
.sidebar .nav-button:hover { background: rgba(255,255,255,.06) !important; color: #fff !important; }
.sidebar .nav-button.active { background: rgba(255,255,255,.10) !important; color: #fff !important; font-weight: 600 !important; }
.sidebar .nav-button.active::before { left: -14px !important; width: 3px !important; height: 18px !important; background: #fff !important; opacity: .9; }

.sidebar .sidebar-cash-card {
  padding: 14px !important; border-radius: 10px !important; gap: 4px;
  background: rgba(255,255,255,.04) !important; border: 1px solid rgba(255,255,255,.08) !important; box-shadow: none !important;
}
.sidebar .cash-box.open, .sidebar .cash-box.closed { border-top: 1px solid rgba(255,255,255,.08) !important; }
.sidebar .sidebar-cash-card #cashStatusLabel {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px !important; font-weight: 600; letter-spacing: .02em;
  text-transform: none !important; color: rgba(255,255,255,.62) !important;
}
.sidebar .sidebar-cash-card #cashStatusLabel::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.35); }
.sidebar .cash-box.open #cashStatusLabel::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.15); }
.sidebar .sidebar-cash-card strong { font-size: 19px !important; font-weight: 650 !important; color: #fff !important; letter-spacing: -.01em; margin-top: 2px; }
.sidebar .sidebar-cash-card small { font-size: 11.5px !important; color: rgba(255,255,255,.5) !important; line-height: 1.4; }
.sidebar .sidebar-cash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.sidebar .sidebar-cash-actions button {
  min-height: 34px !important; padding: 6px 8px !important; border-radius: 7px !important; font-size: 12px !important; font-weight: 550 !important; line-height: 1.2;
  background: rgba(255,255,255,.06) !important; color: rgba(255,255,255,.88) !important; border: 1px solid rgba(255,255,255,.10) !important; box-shadow: none !important;
}
.sidebar .sidebar-cash-actions button:hover:not(:disabled) { background: rgba(255,255,255,.11) !important; color: #fff !important; }
.sidebar .sidebar-cash-actions .primary-button { background: #fff !important; color: #16202b !important; border-color: #fff !important; }
.sidebar .sidebar-cash-actions .primary-button:hover:not(:disabled) { background: #eef1f4 !important; color: #16202b !important; }
.sidebar .sidebar-cash-actions .danger-button { color: #fca5a5 !important; background: rgba(239,68,68,.08) !important; border-color: rgba(239,68,68,.22) !important; }
.sidebar .sidebar-cash-actions button:disabled { opacity: .45 !important; }
.sidebar .cajagou-cuenta { gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .cajagou-salir { min-height: 36px; border-radius: 8px !important; background: transparent !important; border: 1px solid rgba(255,255,255,.14) !important; font-weight: 550 !important; }
.sidebar .cajagou-salir:hover { background: rgba(255,255,255,.06) !important; }
.sidebar .developer-credit { border-top: 1px solid rgba(255,255,255,.08) !important; padding-top: 12px !important; justify-content: center; }
.menu-toggle { border-radius: 8px !important; box-shadow: 0 1px 3px rgba(16,24,40,.08) !important; }

/* Panel lateral claro (si el color elegido es claro) */
body.sidebar-on-light .sidebar .nav-button { color: rgba(15,27,45,.72) !important; }
body.sidebar-on-light .sidebar .nav-button.active { background: rgba(15,27,45,.08) !important; color: #0f1b2d !important; }
body.sidebar-on-light .sidebar .nav-button.active::before { background: #0f1b2d !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card { background: rgba(15,27,45,.04) !important; border-color: rgba(15,27,45,.10) !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card #cashStatusLabel, body.sidebar-on-light .sidebar .brand small, body.sidebar-on-light .sidebar .sidebar-cash-card small { color: rgba(15,27,45,.6) !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card strong { color: #0f1b2d !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions button { background: rgba(15,27,45,.05) !important; color: #0f1b2d !important; border-color: rgba(15,27,45,.12) !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions .primary-button { background: #0f1b2d !important; color: #fff !important; }
#adminTicketDesigner .size-slider { display: block; width: 100%; max-width: none; }
#adminTicketDesigner .size-range { width: 100% !important; max-width: none !important; }
#adminTicketDesigner .td-logo-sliders { width: 100%; max-width: none; }
#adminTicketDesigner .ticket-preview-panel { max-height: none !important; overflow: visible !important; }
#adminTicketDesigner .td-logo-sliders { grid-template-columns: 1fr !important; justify-items: stretch; }

/* ---------------------------------------------------------------------------
   Diseno ticket compacto
   ------------------------------------------------------------------------ */
#adminTicketDesigner .ticket-designer-grid { gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
#adminTicketDesigner .td-head { padding: 12px 18px; }
#adminTicketDesigner .td-head h2 { font-size: 15px; }
#adminTicketDesigner .td-block { padding: 12px 18px; }
#adminTicketDesigner .td-block h3 { margin: 0 0 8px; font-size: 12px; text-transform: none; }
#adminTicketDesigner .td-block-head { margin-bottom: 8px; }
#adminTicketDesigner .compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px 10px !important; }
#adminTicketDesigner .compact-grid .span-2 { grid-column: span 2; }
#adminTicketDesigner .compact-grid .wide { grid-column: 1 / -1; }
#adminTicketDesigner label { gap: 3px !important; font-size: 12px; }
#adminTicketDesigner input:not([type="range"]):not([type="checkbox"]) { min-height: 34px !important; height: 34px; padding: 6px 10px !important; font-size: 13px; border-radius: 7px !important; }
#adminTicketDesigner .td-logo-row { grid-template-columns: 110px 1fr; gap: 16px; }
#adminTicketDesigner .ticket-logo-preview { width: 110px; height: 70px; }
#adminTicketDesigner .td-logo-head { gap: 6px; }
#adminTicketDesigner .td-logo-head .ghost-button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
#adminTicketDesigner .td-logo-sliders { gap: 8px; }
#adminTicketDesigner .size-slider-top { margin-bottom: 2px; font-size: 12px; }
#adminTicketDesigner .td-actions { padding: 10px 18px; }
#adminTicketDesigner .td-actions .primary-button { min-height: 36px; }
#adminTicketDesigner .ticket-preview-panel { padding: 16px; }
@media (max-width: 760px) { #adminTicketDesigner .compact-grid { grid-template-columns: 1fr 1fr !important; } }

/* ---------------------------------------------------------------------------
   Tarjeta de caja del menu lateral
   ------------------------------------------------------------------------ */
.sidebar .sidebar-cash-card { padding: 14px 14px 12px !important; border-radius: 12px !important; display: grid; gap: 2px; }
.sidebar .sidebar-cash-card #cashStatusLabel { font-size: 12px !important; font-weight: 600 !important; }
.sidebar .sidebar-cash-card strong { font-size: 22px !important; font-weight: 700 !important; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.sidebar .sidebar-cash-card small { font-size: 11.5px !important; margin-bottom: 2px; }
.sidebar .sidebar-cash-actions { grid-template-columns: 1fr 1fr !important; gap: 6px !important; margin-top: 10px !important; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .sidebar-cash-actions #selectCashierButton,
.sidebar .sidebar-cash-actions #closeCashButton { grid-column: 1 / -1; }
.sidebar .sidebar-cash-actions button { min-height: 32px !important; font-size: 12.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .sidebar-cash-actions .danger-button { background: transparent !important; }

/* ---------------------------------------------------------------------------
   Panel lateral claro (color predeterminado #f7f8fa y cualquier color claro)
   ------------------------------------------------------------------------ */
body.sidebar-on-light .sidebar { color: #1c2430 !important; border-right: 1px solid #e3e6eb !important; box-shadow: none !important; }
body.sidebar-on-light .sidebar .brand { border-bottom-color: #e3e6eb !important; }
body.sidebar-on-light .sidebar .brand strong { color: #1c2430 !important; }
body.sidebar-on-light .sidebar .brand small { color: #6b7483 !important; }
body.sidebar-on-light .sidebar .brand-logo { border-color: #e3e6eb !important; background: #fff !important; }
body.sidebar-on-light .sidebar .nav-button { color: #4b5563 !important; }
body.sidebar-on-light .sidebar .nav-button svg { opacity: .9; }
body.sidebar-on-light .sidebar .nav-button:hover { background: #eef0f3 !important; color: #1c2430 !important; }
body.sidebar-on-light .sidebar .nav-button.active { background: #fff !important; color: #1c2430 !important; box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 0 0 1px #e3e6eb !important; }
body.sidebar-on-light .sidebar .nav-button.active::before { background: #1f3354 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card { background: #fff !important; border: 1px solid #e3e6eb !important; box-shadow: 0 1px 2px rgba(16,24,40,.05) !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card #cashStatusLabel { color: #4b5563 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card #cashStatusLabel::before { background: #cbd2da; }
body.sidebar-on-light .sidebar .cash-box.open #cashStatusLabel::before { background: #22a55b; box-shadow: 0 0 0 3px rgba(34,165,91,.15); }
body.sidebar-on-light .sidebar .sidebar-cash-card strong { color: #1c2430 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-card small { color: #6b7483 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions { border-top-color: #eef0f3; }
body.sidebar-on-light .sidebar .sidebar-cash-actions button { background: #fff !important; color: #1c2430 !important; border: 1px solid #d9dde3 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions button:hover:not(:disabled) { background: #f3f4f6 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions .primary-button { background: #1f3354 !important; color: #fff !important; border-color: #1f3354 !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions .primary-button:hover:not(:disabled) { background: #16263f !important; color: #fff !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions .danger-button { color: #b42318 !important; border-color: #f1c9c4 !important; background: #fff !important; }
body.sidebar-on-light .sidebar .sidebar-cash-actions .danger-button:hover:not(:disabled) { background: #fdf3f2 !important; }
body.sidebar-on-light .sidebar .cajagou-cuenta { border-top-color: #e3e6eb !important; }
body.sidebar-on-light .sidebar .cajagou-cuenta-quien,
body.sidebar-on-light .sidebar .cajagou-sucursal-linea { color: #6b7483 !important; }
body.sidebar-on-light .sidebar .cajagou-cuenta-quien strong,
body.sidebar-on-light .sidebar .cajagou-sucursal-linea strong { color: #1c2430 !important; }
body.sidebar-on-light .sidebar .cajagou-salir { color: #1c2430 !important; border-color: #d9dde3 !important; background: #fff !important; }
body.sidebar-on-light .sidebar .cajagou-salir:hover { background: #f3f4f6 !important; }
body.sidebar-on-light .sidebar .developer-credit { border-top-color: #e3e6eb !important; }

/* Logo CajaGou sin fondo, adaptable al color del panel */
.developer-credit .developer-brand img.cajagou-marca,
body.sidebar-on-light .developer-credit .developer-brand img.cajagou-marca { background: none !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.sidebar .cajagou-marca-oscura { display: none !important; }
body.sidebar-on-light .sidebar .cajagou-marca-clara { display: none !important; }
body.sidebar-on-light .sidebar .cajagou-marca-oscura { display: block !important; }
.floating-credit .cajagou-marca-oscura { display: block !important; }

/* Opcion "Predeterminado" en el selector de color */
.sb-swatch.sb-swatch-default {
  width: auto; border-radius: 999px; padding: 0 12px 0 6px; display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: #1c2430; font-size: 12px; font-weight: 600; border: 1px solid #d9dde3;
}
.sb-default-dot { width: 22px; height: 22px; border-radius: 999px; background: #f7f8fa; border: 1px solid #d9dde3; box-shadow: inset 0 0 0 3px #fff; }
.sb-swatch.sb-swatch-default.active { border-color: #1f3354; box-shadow: 0 0 0 3px rgba(31,51,84,.15); }

/* ---------------------------------------------------------------------------
   Tarjeta de caja: siempre blanca, combina con cualquier color del menu
   ------------------------------------------------------------------------ */
.sidebar .sidebar-cash-card,
body.sidebar-on-light .sidebar .sidebar-cash-card {
  background: #ffffff !important;
  border: 1px solid rgba(16, 24, 40, .08) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06) !important;
  color: #1c2430 !important;
}
.sidebar .sidebar-cash-card #cashStatusLabel { color: #4b5563 !important; }
.sidebar .sidebar-cash-card #cashStatusLabel::before { background: #cbd2da !important; box-shadow: none !important; }
.sidebar .cash-box.open #cashStatusLabel::before { background: #22a55b !important; box-shadow: 0 0 0 3px rgba(34,165,91,.15) !important; }
.sidebar .sidebar-cash-card strong { color: #1c2430 !important; }
.sidebar .sidebar-cash-card small { color: #6b7483 !important; white-space: pre-line; line-height: 1.45 !important; }
.sidebar .sidebar-cash-actions { border-top-color: #eef0f3 !important; }
.sidebar .sidebar-cash-actions button { background: #ffffff !important; color: #1c2430 !important; border: 1px solid #d9dde3 !important; }
.sidebar .sidebar-cash-actions button:hover:not(:disabled) { background: #f3f4f6 !important; color: #1c2430 !important; }
.sidebar .sidebar-cash-actions .primary-button { background: #1f3354 !important; color: #ffffff !important; border-color: #1f3354 !important; }
.sidebar .sidebar-cash-actions .primary-button:hover:not(:disabled) { background: #16263f !important; color: #ffffff !important; }
.sidebar .sidebar-cash-actions .danger-button { background: #ffffff !important; color: #b42318 !important; border-color: #f1c9c4 !important; }
.sidebar .sidebar-cash-actions .danger-button:hover:not(:disabled) { background: #fdf3f2 !important; }
.sidebar .sidebar-cash-actions button:disabled { opacity: .5 !important; color: #6b7483 !important; }

/* ---------------------------------------------------------------------------
   Ventanas (autorizacion, caja, cajero, confirmaciones...): misma linea
   visual que la tarjeta de caja. Blancas, sobrias, campos y botones iguales.
   ------------------------------------------------------------------------ */
dialog::backdrop { background: rgba(15, 23, 42, .38) !important; backdrop-filter: blur(1px); }
dialog .modal {
  background: #ffffff !important;
  border: 1px solid rgba(16, 24, 40, .08) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 48px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06) !important;
  padding: 18px 20px !important;
  color: #1c2430;
}
dialog .modal header {
  margin: -18px -20px 16px !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid #eef0f3 !important;
  align-items: center !important;
}
dialog .modal header h2 { font-size: 16px !important; font-weight: 650 !important; color: #1c2430 !important; letter-spacing: -.005em; }
dialog .modal > p.muted,
dialog .modal .muted { color: #6b7483 !important; font-size: 13px; line-height: 1.5; }
dialog .modal label {
  gap: 5px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #4b5563 !important;
  margin-bottom: 12px;
}
dialog .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
dialog .modal select,
dialog .modal textarea {
  min-height: 40px;
  padding: 8px 12px !important;
  border: 1px solid #d9dde3 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #1c2430 !important;
  font-size: 14px !important;
  font-weight: 500;
  box-shadow: none !important;
}
dialog .modal input:focus, dialog .modal select:focus, dialog .modal textarea:focus {
  outline: none !important;
  border-color: #1f3354 !important;
  box-shadow: 0 0 0 3px rgba(31, 51, 84, .12) !important;
}
dialog .modal input::placeholder, dialog .modal textarea::placeholder { color: #9aa3af; font-weight: 400; }

dialog .modal footer {
  margin: 18px -20px -18px !important;
  padding: 12px 20px !important;
  background: #fafbfc !important;
  border-top: 1px solid #eef0f3 !important;
  border-radius: 0 0 12px 12px;
  justify-content: flex-end !important;
  gap: 8px !important;
}
dialog .modal footer .spacer { flex: 1; }
dialog .modal footer button,
dialog .modal .ghost-button,
dialog .modal .primary-button,
dialog .modal .danger-button,
dialog .modal .secondary-button {
  min-height: 38px;
  padding: 0 16px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
dialog .modal .ghost-button,
dialog .modal .secondary-button { background: #ffffff !important; color: #1c2430 !important; border: 1px solid #d9dde3 !important; }
dialog .modal .ghost-button:hover:not(:disabled),
dialog .modal .secondary-button:hover:not(:disabled) { background: #f3f4f6 !important; }
dialog .modal .primary-button { background: #1f3354 !important; color: #ffffff !important; border: 1px solid #1f3354 !important; }
dialog .modal .primary-button:hover:not(:disabled) { background: #16263f !important; }
dialog .modal .danger-button { background: #ffffff !important; color: #b42318 !important; border: 1px solid #f1c9c4 !important; }
dialog .modal .danger-button:hover:not(:disabled) { background: #fdf3f2 !important; }
dialog .modal button:disabled { opacity: .5; cursor: not-allowed; }

/* Las ventanas con varias acciones propias conservan su cuadricula */
#paymentDialog .modal .payment-method-btn { border-radius: 10px !important; }
#productDialog .modal footer { margin: 16px -20px -18px !important; }
#productDialog .modal header { margin-bottom: 14px !important; }
.common-sale-modal .cs-stepper button { min-height: 44px !important; border: 0 !important; border-radius: 0 !important; background: #f5f6f8 !important; padding: 0 !important; }
#adminLoginDialog .config-only-row { display: none !important; }

/* Venta comun: peso con unidad dentro del campo, alineado con el precio */
.common-sale-modal .cs-weight { position: relative; display: block; }
.common-sale-modal .cs-weight input { padding-right: 34px !important; }
.common-sale-modal .cs-weight-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #6b7483; font-weight: 600; pointer-events: none; }

/* Producto: tipo de venta */
#productDialog .product-type-segment { margin: 0; }
#productDialog .product-type-segment span { display: grid; gap: 1px; padding: 9px 10px; }
#productDialog .product-type-segment small { font-size: 11.5px; font-weight: 500; color: #8a93a1; }
#productDialog .form-grid-4 .span-2 { grid-column: span 2; }

/* Finalizar venta: verde plano, mismo radio que el resto */
#payButton.primary-button { background: #1f8a4c !important; border: 1px solid #1f8a4c !important; border-radius: 10px !important; box-shadow: 0 1px 2px rgba(16,24,40,.08) !important; font-weight: 650 !important; }
#payButton.primary-button:hover:not(:disabled) { background: #19763f !important; border-color: #19763f !important; }
#payButton.primary-button:disabled { background: #9fc8b0 !important; border-color: #9fc8b0 !important; }
dialog .modal.common-sale-modal .cs-grid .field { display: grid !important; grid-template-rows: 18px auto; gap: 6px !important; margin: 0 !important; align-content: start; }
dialog .modal.common-sale-modal .cs-grid .field > span { line-height: 18px; font-size: 13px; font-weight: 600; color: #4b5563; }
dialog .modal.common-sale-modal .cs-weight input { padding-right: 36px !important; }
dialog .modal.common-sale-modal .cs-grid .field.hidden { display: none !important; }
dialog .modal #commonSaleWeightInput { padding-right: 36px !important; }
dialog .modal #commonSaleWeightInput { margin: 0 !important; display: block; width: 100%; }
#productDialog .modal { overflow-x: hidden !important; }

/* Selector de dos opciones (venta comun y "¿Como se vende?") */
dialog .modal .cs-segment {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 4px !important;
  padding: 4px !important;
  background: #f1f3f6 !important;
  border: 1px solid #e3e6eb !important;
  border-radius: 10px !important;
  margin: 0 0 14px !important;
}
dialog .modal .cs-segment label { margin: 0 !important; display: block !important; gap: 0 !important; min-width: 0; }
dialog .modal .cs-segment span {
  display: grid !important;
  place-items: center;
  gap: 1px;
  min-height: 38px;
  padding: 7px 10px !important;
  border-radius: 7px !important;
  border: 1px solid transparent;
  color: #4b5563 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: center;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  cursor: pointer;
}
dialog .modal .cs-segment label:hover span { color: #1c2430 !important; background: rgba(255,255,255,.6); }
dialog .modal .cs-segment input:checked + span {
  background: #ffffff !important;
  color: #1f3354 !important;
  border-color: #d9dde3 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08) !important;
}
dialog .modal .cs-segment input:focus-visible + span { outline: 2px solid #1f3354; outline-offset: 1px; }
dialog .modal .cs-segment small { font-size: 11.5px !important; font-weight: 500 !important; color: #8a93a1 !important; }
dialog .modal .cs-segment input:checked + span small { color: #6b7483 !important; }
#productDialog .product-type-segment { margin: 0 !important; }

/* Mientras carga, los botones con atajo no muestran un texto provisional */
body:not(.cajagou-datos) #payButton,
body:not(.cajagou-datos) #clearCartButton,
body:not(.cajagou-datos) #holdSaleButton,
body:not(.cajagou-datos) #showHeldSalesButton,
body:not(.cajagou-datos) #quickAddButton,
body:not(.cajagou-datos) #commonSaleButton,
body:not(.cajagou-datos) #priceCheckButton { color: transparent !important; }

/* Iconos del menu lateral */
.sidebar .nav-button { gap: 11px !important; }
.sidebar .nav-button .nav-ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .78; transition: opacity .12s ease; }
.sidebar .nav-button:hover .nav-ico,
.sidebar .nav-button.active .nav-ico { opacity: 1; }

/* Configuracion: impresion directa (QZ Tray) */
.cajagou-impresion { margin-top: 16px; padding: 18px 20px !important; }
.cajagou-impresion .ci-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.cajagou-impresion h3 { margin: 0; font-size: 15px; font-weight: 650; color: #1c2430; }
.cajagou-impresion .ci-head p { margin: 2px 0 0; font-size: 13px; }
.cajagou-impresion .ci-estado { white-space: nowrap; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #f1f3f6; color: #4b5563; }
.cajagou-impresion .ci-estado[data-tipo="ok"] { background: #e8f3ec; color: #2f7d4f; }
.cajagou-impresion .ci-estado[data-tipo="error"] { background: #fbeceb; color: #b42318; }
.cajagou-impresion .ci-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: end; }
.cajagou-impresion .ci-grid > label { margin: 0; }
.cajagou-impresion .ci-fila { display: flex; gap: 8px; }
.cajagou-impresion .ci-fila select { flex: 1; }
.cajagou-impresion .ci-switch { display: flex !important; align-items: center; gap: 10px; font-weight: 600; color: #1c2430; cursor: pointer; position: relative; }
.cajagou-impresion .ci-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cajagou-impresion .ci-switch .mini-track { width: 34px; height: 20px; border-radius: 999px; background: #cfd4dc; position: relative; flex: 0 0 auto; transition: background .15s; }
.cajagou-impresion .ci-switch .mini-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.cajagou-impresion .ci-switch input:checked + .mini-track { background: #2f9e5f; }
.cajagou-impresion .ci-switch input:checked + .mini-track::after { transform: translateX(14px); }
.cajagou-impresion .ci-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef0f3; }
.cajagou-impresion .ci-acciones a { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 760px) { .cajagou-impresion .ci-grid { grid-template-columns: 1fr; } }
.cajagou-impresion .ci-grid > .ci-switch:first-child { grid-column: 1 / -1; padding-bottom: 4px; }

/* Fiado */
.fiado-modal { width: min(520px, 94vw); }
.fiado-sub { margin: 2px 0 0; font-size: 13px; }
.fiado-list { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; margin: 4px 0 10px; }
.fiado-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px !important; border: 1px solid #e3e6eb !important; border-radius: 8px !important; background: #fff !important; color: #1c2430 !important; font-weight: 600 !important; min-height: 0 !important; }
.fiado-item:hover { background: #f5f6f8 !important; }
.fiado-item.selected { border-color: #1f3354 !important; box-shadow: 0 0 0 3px rgba(31,51,84,.12) !important; }
.fiado-item small { display: block; color: #6b7483; font-weight: 500; }
.fiado-item .fiado-debt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fiado-item .fiado-debt.has { color: #b42318; }
.fiado-empty { color: #6b7483; font-size: 13px; padding: 8px 2px; }
.fiado-new { margin: 4px 0 10px; }
.fiado-new summary { cursor: pointer; font-weight: 600; color: #1f3354; font-size: 14px; }
.fiado-new-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; }
.fiado-new-grid label { margin: 0 !important; }
.fiado-summary { background: #f5f6f8; border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.7; }
.fiado-summary strong { font-variant-numeric: tabular-nums; }
.fiado-summary .warn { color: #b42318; font-weight: 600; }
.customers-summary { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.customers-summary .metric { min-width: 180px; }
.customer-modal { width: min(860px, 95vw); }
.customer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.customer-box { border: 1px solid #e3e6eb; border-radius: 10px; padding: 12px 14px; }
.customer-box h3, .customer-history-title { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: #475569; }
.customer-history-title { margin-top: 16px; }
.customer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.debt-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.debt-cell.has { color: #b42318; }
@media (max-width: 760px) { .customer-grid, .fiado-new-grid { grid-template-columns: 1fr; } }

/* Repositorio de fotos */
.photo-library-modal { width: min(820px, 95vw); }
.photo-library-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.photo-library-cats button { min-height: 0 !important; padding: 5px 12px !important; border-radius: 999px !important; border: 1px solid #e3e6eb !important; background: #fff !important; color: #1c2430 !important; font-size: 13px !important; font-weight: 600 !important; }
.photo-library-cats button.active { background: #1f3354 !important; border-color: #1f3354 !important; color: #fff !important; }
.photo-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.photo-library-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px !important; min-height: 0 !important; border: 1px solid #e3e6eb !important; border-radius: 10px !important; background: #fff !important; color: #1c2430 !important; font-size: 12.5px !important; font-weight: 600 !important; }
.photo-library-item:hover { border-color: #1f3354 !important; box-shadow: 0 0 0 3px rgba(31,51,84,.12); }
.photo-library-item img { width: 100%; height: 96px; object-fit: contain; background: #f5f6f8; border-radius: 8px; }
.photo-library-item small { color: #6b7483; font-weight: 500; }
.photo-library-empty { color: #6b7483; font-size: 13px; padding: 12px 2px; grid-column: 1 / -1; }
.photo-library-modal > header, .fiado-modal > header, .customer-modal > header { flex-wrap: nowrap !important; align-items: flex-start !important; gap: 12px; }
#deliveryPaymentDialog .delivery-options { grid-template-columns: repeat(3, 1fr) !important; }
.sidebar .nav-button svg.nav-ico-color { opacity: 1 !important; width: 30px; height: 30px; flex-shrink: 0; margin: -3px 0; }
.sidebar .nav-button:not(.active) svg.nav-ico-color { filter: saturate(.85); }


.sidebar .nav-button svg.nav-ico.nav-ico-color { width: 30px !important; height: 30px !important; flex: 0 0 30px !important; margin: -4px 0 !important; opacity: 1 !important; }
/* Sobre panel oscuro, el contorno pasa a un tono claro del mismo color */
body:not(.sidebar-on-light) .sidebar .nav-ico-color [stroke="#414b67"] { stroke: #ccdcf1; }
body:not(.sidebar-on-light) .sidebar .nav-ico-color [stroke="#54446e"] { stroke: #e2def6; }
body:not(.sidebar-on-light) .sidebar .nav-ico-color [stroke="#674b39"] { stroke: #e5d8a2; }
/* Iconos de pestañas en la linea lineal a color */
.tab-icon.tab-icon-color { width: 26px !important; height: 26px !important; min-width: 26px !important; }
.tab-icon.tab-icon-color svg { width: 26px !important; height: 26px !important; }

/* Codigos de barra */
.barcode-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; margin: -4px 0 4px; }
.barcode-tools .barcode-preview { margin-left: auto; height: 46px; display: flex; align-items: center; }
.barcode-tools .barcode-preview svg { height: 46px; width: 150px; }
.bc-toolbar { display: grid !important; grid-template-columns: 1fr 220px 160px; gap: 10px; }
.bc-opciones { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px !important; margin: 10px 0 !important; }
.bc-opciones label { margin: 0 !important; display: flex; align-items: center; gap: 8px; }
.bc-opciones select { min-width: 220px; }
.bc-opciones .spacer { flex: 1; }
.bc-table td { vertical-align: middle; }
.bc-cell svg { width: 150px; height: 44px; display: block; }
.bc-copias { width: 64px !important; text-align: center; }
.bc-paginas { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 12px 0; }
@media (max-width: 900px) { .bc-toolbar { grid-template-columns: 1fr; } }

/* Pantallas de consulta de precios */
.cp-lista { display: grid; gap: 10px; margin-top: 12px; }
.cp-switch { margin-top: 12px; }
.cp-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid #e3e6eb; border-radius: 10px; padding: 10px 12px; }
.cp-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cp-info input { font-size: 12.5px; color: #475569; background: #f7f8fa; width: 100%; }
.cp-acciones { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cp-acciones .ghost-button, .cp-acciones .primary-button { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none; }
@media (max-width: 720px) {
  .cp-fila { grid-template-columns: 1fr; }
  .cp-acciones { justify-content: flex-end; }
}

/* Desglose de IVA en el producto */
.iva-tabla { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 16px; font-size: 13px; margin: 2px 0 6px; max-width: 360px; }
.iva-tabla b { font-weight: 650; color: #6b7483; font-size: 12px; }
.iva-tabla span, .iva-tabla strong { font-variant-numeric: tabular-nums; }
.iva-margenes { font-size: 13px; color: #475569; }

#branchName .brand-linea { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compras a proveedores */
.cmp-datos { display: grid !important; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 12px; padding: 14px 16px !important; margin-bottom: 12px !important; }
.cmp-datos label { margin: 0 !important; }
.cmp-toolbar { display: grid !important; grid-template-columns: 1fr auto auto auto auto; gap: 10px; align-items: center; }
.cmp-num { text-align: right; }
.cmp-acciones { display: grid; gap: 8px; margin-top: 14px; }
.cmp-acciones button { width: 100%; }
.cmp-ok { color: #2e7d4f; font-weight: 600; }
.cmp-borrador { color: #b7791f; font-weight: 600; }
.cmp-sug-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 6px 0 12px; }
.cmp-sug-filtros label { margin: 0 !important; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cmp-sug-filtros .primary-button, .cmp-sug-filtros .ghost-button { margin-left: auto; }
.cmp-sug-filtros .ghost-button { margin-left: 0; }
.cmp-totales-detalle { display: flex; justify-content: flex-end; gap: 22px; margin-top: 12px; font-size: 14px; }
.cmp-totales-detalle span { color: #6b7483; margin-right: 6px; }
#adminPurchases .suggestions button small { display: block; color: #6b7483; font-weight: 500; }
@media (max-width: 1000px) { .cmp-datos { grid-template-columns: 1fr 1fr; } .cmp-toolbar { grid-template-columns: 1fr; } }

/* Arqueo por denominación */
.arq-bloque { border: 1px solid #e3e6eb; border-radius: 10px; padding: 10px 14px; margin: 4px 0 12px; }
.arq-bloque summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #1f3354; }
.arq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.arq-grid h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b7483; font-weight: 650; }
.arq-fila { display: grid; grid-template-columns: 1fr 66px 74px; align-items: center; gap: 8px; margin-bottom: 6px; }
.arq-valor { font-size: 13.5px; font-weight: 600; color: #1c2430; font-variant-numeric: tabular-nums; }
.arq-cantidad { text-align: center; padding: 5px 6px !important; min-height: 0 !important; }
.arq-subtotal { font-size: 13px; color: #6b7483; text-align: right; font-variant-numeric: tabular-nums; }
.arq-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef0f3; }
.arq-total { text-align: right; font-size: 13px; color: #6b7483; }
.arq-total strong { display: block; font-size: 20px; color: #1c2430; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .arq-grid { grid-template-columns: 1fr; } }


/* Peso del producto */
#weightInputDialog .weight-modal { width: min(380px, 94vw); max-width: none; }
#weightInputDialog .weight-modal > header .muted { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: #1c2430; }
.weight-campo { display: block; margin: 0 0 14px !important; }
.weight-campo input { font-size: 30px !important; font-weight: 700 !important; text-align: center; letter-spacing: .02em; font-variant-numeric: tabular-nums; padding: 12px 14px !important; }
.weight-resumen { border: 1px solid #e3e6eb; border-radius: 12px; overflow: hidden; }
.weight-resumen-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; color: #6b7483; }
.weight-resumen-fila strong { color: #1c2430; font-size: 16px; font-variant-numeric: tabular-nums; }
.weight-resumen-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #f7f8fa; border-top: 1px solid #e3e6eb; }
.weight-resumen-total span { font-size: 12.5px; font-weight: 650; color: #6b7483; text-transform: uppercase; letter-spacing: .06em; }
.weight-resumen-total strong { font-size: 24px; font-weight: 800; color: #1f3354; font-variant-numeric: tabular-nums; }
#weightInputDialog .primary-button[disabled] { opacity: .5; cursor: not-allowed; }

/* Vuelto digital (saldo a favor) */
.saldo-barra { display: flex; flex-direction: column; gap: 8px; align-items: center; margin: -4px 0 12px; }
.saldo-barra .ghost-button { min-height: 0 !important; padding: 8px 14px !important; font-size: 13.5px !important; }
.saldo-aplicado { display: flex; align-items: center; gap: 10px; background: #f0f7f2; border: 1px solid #d7e9dd; border-radius: 999px; padding: 6px 8px 6px 14px; font-size: 13.5px; color: #2e7d4f; font-weight: 600; }
.saldo-aplicado button { min-height: 0 !important; width: 26px; height: 26px; padding: 0 !important; border-radius: 50% !important; }
.vuelto-guardar { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 4px; }
.vuelto-guardar .ghost-button { min-height: 0 !important; padding: 8px 14px !important; font-size: 13px !important; }
.vuelto-cliente { display: flex; align-items: center; gap: 10px; background: #fff8ea; border: 1px solid #f2e2bf; border-radius: 999px; padding: 6px 8px 6px 14px; font-size: 13.5px; color: #8a6116; font-weight: 600; }
.vuelto-cliente button { min-height: 0 !important; width: 26px; height: 26px; padding: 0 !important; border-radius: 50% !important; }
.fiado-item .fiado-saldo { color: #2e7d4f; font-weight: 700; }
/* Historial de costos */
.ch-sube { color: #b42318; font-weight: 700; }
.ch-baja { color: #2e7d4f; font-weight: 700; }
.ch-ahorro { color: #2e7d4f; font-weight: 600; font-size: 13px; }
/* Pedidos del barrio */
.ped-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ped-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.ped-filtros .ghost-button.activo { background: #1f3354; border-color: #1f3354; color: #fff; }
.ped-estado { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.ped-nuevo { background: #e8f0fe; color: #1f3354; }
.ped-preparando { background: #fef3c7; color: #b45309; }
.ped-listo { background: #e7f5ec; color: #2e7d4f; }
.ped-entregado { background: #eef0f3; color: #6b7483; }
.ped-rechazado { background: #fee2e2; color: #b42318; }
.ped-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; margin-left: 7px; padding: 0 5px; border-radius: 999px; background: #c62828; color: #fff; font-size: 11.5px; font-weight: 800; }
.ped-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ped-datos div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ped-factura { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: #e8efff; color: #1f3a8a; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.ped-factura-datos { background: #eef3ff; border: 1px solid #c9d6f5; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: #1f2d4d; margin: 8px 0; }
.ped-nota { background: #f7f8fa; border: 1px solid #e3e6eb; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: #475569; }
.ped-totales { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 12px; font-size: 14.5px; }
.ped-totales .grande { font-size: 18px; font-weight: 800; padding-top: 8px; border-top: 1px solid #e3e6eb; }
#pedDetalleAcciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Pedidos en la pantalla de venta */
.ped-boton { position: relative; }
.ped-boton .ped-num:empty { display: none; }
.ped-boton .ped-num { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: #c62828; color: #fff; font-size: 12px; font-weight: 800; }
.ped-boton.ped-hay { border-color: #c62828; color: #c62828; animation: ped-latido 1.6s ease-in-out infinite; }
@keyframes ped-latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .35); } 50% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); } }
.ped-lista { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.ped-item { display: grid; gap: 6px; width: 100%; text-align: left; border: 1px solid #e3e6eb; border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; font: inherit; }
.ped-item:hover { border-color: #1f3354; }
.ped-item-top, .ped-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ped-item-bottom { color: #6b7483; font-size: 13.5px; }
.ped-item-bottom strong { color: #1c2430; font-size: 15px; }
html.plan-sin-pedidos #pedBotonVenta { display: none !important; }
/* Pedidos: cambios de productos */
.ped-acc { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ped-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.ped-tag-cambio { background: #e8eff8; color: #2c5f9e; }
.ped-tag-sin { background: #fbe8e6; color: #b8322a; }
.ped-sin td { color: #858a92; }
.ped-dif { margin-top: 12px; border: 1px solid #f1dcb4; background: #fdf1dc; border-radius: 12px; padding: 10px 14px; display: grid; gap: 4px; font-size: 14px; }
.ped-dif.baja { border-color: #cfe5d9; background: #e7f2ec; }
.ped-dif > div { display: flex; justify-content: space-between; gap: 12px; }
.ped-dif-neto { border-top: 1px dashed rgba(0, 0, 0, .15); padding-top: 6px; margin-top: 2px; font-size: 16px; }
.ped-dif.sube .ped-dif-neto { color: #a86a12; }
.ped-dif.baja .ped-dif-neto { color: #1f7a55; }
#pedDetalleAcciones { align-items: center; }
.ped-rechazar { color: #b8322a; }
.ped-cambio-barra { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: end; margin-bottom: 10px; }
.ped-cambio-barra label { display: grid; gap: 4px; font-size: 12.5px; color: #6b7483; }
.ped-cambio-lista { display: grid; gap: 6px; max-height: 52vh; overflow: auto; }
.ped-cambio-titulo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #858a92; margin: 2px 0 4px; }
.ped-opcion { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid #e3e6eb; border-radius: 12px; background: #fff; padding: 8px 12px; cursor: pointer; font: inherit; }
.ped-opcion:hover { border-color: #1f7a55; background: #f6fbf8; }
.ped-opcion-foto { width: 48px; height: 48px; border-radius: 10px; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; color: #858a92; background: #faf8f5; }
.ped-opcion-foto img { width: 88%; height: 88%; object-fit: contain; }
.ped-opcion-txt { display: grid; gap: 2px; min-width: 0; }
.ped-opcion-txt small { color: #858a92; font-size: 12.5px; }
.ped-opcion-precio { font-weight: 800; font-size: 15px; white-space: nowrap; }
.ped-opcion-precio small { font-weight: 600; color: #858a92; font-size: 12px; }
/* Calculadora de facturas: cargo de distribucion y logistica */
.invoice-logistica { display: grid; gap: 6px; padding: 0 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.invoice-logistica-nombre { width: 100%; font-weight: 600; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; }
.invoice-logistica .invoice-inline-field { width: 100%; }
.invoice-logistica .invoice-inline-field input { width: 100%; }
.invoice-summary .invoice-logistica small { color: var(--muted); font-size: 11.5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
/* ---- Configuracion: Consulta de precios y Market (diseno comun .cgc) ---- */
.cgc { padding: 0 !important; overflow: hidden; }
.cgc .cgc-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 22px; border-bottom: 1px solid #eef0f3; }
.cgc .cgc-icono { width: 42px; height: 42px; border-radius: 12px; background: #eef3fb; color: #1f3354; display: grid; place-items: center; }
.cgc .cgc-icono svg { width: 22px; height: 22px; }
.cgc .cgc-titulo h3 { margin: 0; font-size: 16px; font-weight: 700; color: #1c2430; }
.cgc .cgc-titulo p { margin: 3px 0 0; font-size: 13px; color: #6b7483; line-height: 1.45; }
.cgc .cgc-bloque { padding: 16px 22px; border-bottom: 1px solid #eef0f3; }
.cgc .cgc-bloque:last-child { border-bottom: 0; }
.cgc .cgc-sub { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a93a3; }
.cgc .cgc-opcion { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; margin: 0; cursor: pointer; border-top: 1px solid #f3f4f6; }
.cgc .cgc-sub + .cgc-opcion, .cgc .cgc-bloque > .cgc-opcion:first-child { border-top: 0; padding-top: 2px; }
.cgc .cgc-opcion strong { display: block; font-size: 14px; font-weight: 600; color: #1c2430; }
.cgc .cgc-opcion small { display: block; margin-top: 1px; font-size: 12.5px; color: #6b7483; font-weight: 400; }
.cgc .cgc-switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 42px !important; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #d4d9e1; position: relative; cursor: pointer; transition: background .15s; }
.cgc .cgc-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.cgc .cgc-switch:checked { background: #2e7d4f; }
.cgc .cgc-switch:checked::after { transform: translateX(18px); }
.cgc .cgc-switch:focus-visible { outline: 2px solid #1f3354; outline-offset: 2px; }
.cgc .cgc-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.cgc .cgc-campo { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: #3b4658; }
.cgc .cgc-campo.cgc-ancho { grid-column: 1 / -1; }
.cgc .cgc-campo input { height: 40px; width: 100%; }
.cgc .cgc-prefijo { position: relative; }
.cgc .cgc-prefijo i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: #8a93a3; font-weight: 600; pointer-events: none; }
.cgc .cgc-prefijo input { padding-left: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.cgc .cgc-prefijo input:disabled { background: #f4f5f7; color: #9aa2af; }
.cgc .cgc-color { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border: 1px solid #d8dee8; border-radius: 10px; background: #fff; }
.cgc .cgc-color input { width: 30px !important; height: 26px !important; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.cgc .cgc-color code { font-size: 13px; color: #475569; }
.cgc .cgc-pie { display: flex; justify-content: flex-end; margin-top: 14px; }
.cgc .cgc-pie .primary-button { height: 38px; padding: 0 18px; }
.cgc .cgc-enlaces { display: grid; gap: 10px; }
.cgc .cgc-enlace { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e3e6eb; border-radius: 12px; background: #fafbfc; }
.cgc .cgc-enlace__info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cgc .cgc-enlace__info strong { font-size: 14px; color: #1c2430; }
.cgc .cgc-enlace__info code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: #475569; background: #fff; border: 1px solid #e3e6eb; border-radius: 8px; padding: 6px 10px; }
.cgc .cgc-sin { font-size: 13px; color: #8a93a3; }
.cgc .cgc-enlace__acciones { display: flex; align-items: center; gap: 8px; }
.cgc .cgc-enlace__acciones .ghost-button, .cgc .cgc-enlace__acciones .primary-button { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; }
.cgc .cgc-link { background: none; border: 0; padding: 0 6px; height: 36px; font-size: 13px; font-weight: 600; color: #b42318; cursor: pointer; white-space: nowrap; }
.cgc .cgc-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .cgc .cgc-rejilla { grid-template-columns: 1fr 1fr; }
  .cgc .cgc-enlace { grid-template-columns: 1fr; }
  .cgc .cgc-enlace__acciones { justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .cgc .cgc-head { grid-template-columns: auto minmax(0, 1fr); }
  .cgc .cgc-head .ci-estado { grid-column: 1 / -1; justify-self: start; }
  .cgc .cgc-rejilla { grid-template-columns: 1fr; }
}

/* ---- Configuracion: menu lateral + una area a la vez (cajagou-configuracion.js) ---- */
.cfg-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.cfg-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: #fff; border: 1px solid #e3e6eb; border-radius: 14px; }
.cfg-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: #3b4658; }
.cfg-nav button:hover { background: #f4f6f9; }
.cfg-nav button.activo { background: #eef3fb; color: #1f3354; }
.cfg-nav__icono { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; background: #f4f6f9; display: grid; place-items: center; color: #5b6576; }
.cfg-nav button.activo .cfg-nav__icono { background: #1f3354; color: #fff; }
.cfg-nav__icono svg { width: 18px; height: 18px; }
.cfg-nav strong { display: block; font-size: 13.5px; font-weight: 650; line-height: 1.25; }
.cfg-nav small { display: block; font-size: 12px; color: #8a93a3; line-height: 1.3; margin-top: 1px; }
.cfg-principal { min-width: 0; max-width: 860px; }
.cfg-titulo { margin: 2px 0 14px; }
.cfg-titulo h2 { margin: 0; font-size: 20px; font-weight: 700; color: #1c2430; letter-spacing: -.01em; }
.cfg-titulo p { margin: 3px 0 0; font-size: 13.5px; color: #6b7483; }
.cfg-contenido { display: flex; flex-direction: column; gap: 16px; }
.cfg-contenido > [hidden] { display: none !important; }
/* Todos los bloques con la misma tarjeta; el titulo de la pagina ya dice el area. */
.cfg-contenido > .cfg-bloque { margin: 0 !important; border-radius: 14px; }
.cfg-contenido > .cfg-bloque.cgc .cgc-head { padding: 16px 22px; }
.cfg-contenido > .cajagou-impresion:not(.cgc) { padding: 20px 22px !important; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* General */
#settingsForm.cfg-bloque { display: block !important; padding: 0 !important; overflow: hidden; }
#settingsForm.cfg-bloque > label:not(.cfg-grupo label), #settingsForm.cfg-bloque > .connection-status-card, #settingsForm.cfg-bloque > button:not(.primary-button) { display: none; }
.cfg-grupo { padding: 18px 22px; border-bottom: 1px solid #eef0f3; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.cfg-grupo__head h4 { margin: 0; font-size: 14px; font-weight: 650; color: #1c2430; }
.cfg-grupo__head p { margin: 4px 0 0; font-size: 12.5px; color: #6b7483; line-height: 1.45; }
.cfg-grupo__campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-content: start; }
.cfg-grupo__campos > label { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3b4658; }
.cfg-grupo__campos > label input, .cfg-grupo__campos > label select { height: 40px; }
.cfg-grupo__campos > .cajagou-sucursal-equipo-nota, .cfg-grupo__campos > .setting-logo-row { grid-column: 1 / -1; margin: 0; }
.cfg-pie { display: flex; justify-content: flex-end; padding: 14px 22px; background: #fafbfc; }
.cfg-pie .primary-button { height: 40px; padding: 0 20px; }
@media (max-width: 1100px) {
  .cfg-layout { grid-template-columns: 1fr; gap: 14px; }
  .cfg-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .cfg-nav button { flex: 0 0 auto; width: auto; padding: 8px 12px; }
  .cfg-nav small, .cfg-nav__icono { display: none; }
  .cfg-grupo { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 640px) { .cfg-grupo__campos { grid-template-columns: 1fr; } }
#settingsForm.cfg-bloque[hidden] { display: none !important; }
/* El titulo del area ya esta arriba: dentro del bloque no se repite. */
.cfg-contenido > .cfg-bloque .cgc-titulo h3, .cfg-contenido > .cfg-bloque .cgc-icono,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-head h3 { display: none; }
.cfg-contenido > .cfg-bloque .cgc-head { grid-template-columns: minmax(0, 1fr) auto; }
.cfg-contenido > .cfg-bloque .cgc-titulo p, .cfg-contenido > .cajagou-impresion .ci-head p { margin-top: 0; }
/* Titulo del area en una linea: "General | Este equipo y apariencia" */
.cfg-titulo { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
.cfg-titulo p { margin: 0; font-size: 15px; }
.cfg-titulo p::before { content: '|'; margin-right: 10px; color: #c3c9d3; font-weight: 400; }
/* El titulo va arriba, sobre el menu; menu y tarjeta arrancan a la misma altura. */
.cfg-layout { row-gap: 12px; }
.cfg-layout > .cfg-titulo { grid-column: 1 / -1; margin: 0; padding-left: 4px; }
.cfg-nav { top: 12px; }
/* La caja de busqueda no debe estirarse al alto de los botones de al lado:
   si no, el menu de sugerencias se abre muy por debajo del campo. */
.scan-row .scan-box { align-self: start; }

/* ---- Costo inventario: una cifra manda, el resto acompana ---- */
.inventory-summary-panel { margin-bottom: 12px; }
.inv-cabecera { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 22px 24px 20px; background: #fff; border: 1px solid #e6e8ec; border-radius: 3px; }
.inv-hero__etiqueta { display: block; font-size: 12.5px; color: #6b7483; }
.inv-hero__valor { display: block; margin: 4px 0 6px; font-size: 34px; font-weight: 650; letter-spacing: -.02em; color: #12161c; font-variant-numeric: tabular-nums; line-height: 1.05; }
.inv-hero__pie { display: block; font-size: 12.5px; color: #8b929c; }
.inv-datos { display: flex; gap: 28px; margin: 0; padding-left: 24px; border-left: 1px solid #eef0f3; }
.inv-datos div { margin: 0; }
.inv-datos dt { font-size: 12.5px; color: #6b7483; }
.inv-datos dd { margin: 3px 0 0; font-size: 17px; font-weight: 600; color: #12161c; font-variant-numeric: tabular-nums; }
.inv-datos dd i { font-style: normal; font-size: 12.5px; font-weight: 500; color: #8b929c; margin-left: 2px; }
.inventory-cat-table { width: 100%; margin-top: 14px; border-collapse: collapse; background: #fff; border: 1px solid #e6e8ec; border-radius: 3px; }
.inventory-cat-table th, .inventory-cat-table td { padding: 11px 16px; font-size: 13px; text-align: left; border-bottom: 1px solid #f1f2f4; }
.inventory-cat-table thead th { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #8b929c; background: none; border-bottom: 1px solid #e6e8ec; }
.inventory-cat-table tbody tr:last-child th, .inventory-cat-table tbody tr:last-child td { border-bottom: 0; }
.inventory-cat-table .num { text-align: right; font-variant-numeric: tabular-nums; color: #5b6472; white-space: nowrap; }
.inventory-cat-table .inv-fuerte { color: #12161c; font-weight: 600; }
.inventory-cat-table tbody th { font-weight: 500; color: #12161c; }
.inv-cat { display: block; }
.inv-barra { display: block; height: 2px; margin-top: 6px; background: #f1f2f4; max-width: 260px; }
.inv-barra i { display: block; height: 100%; background: #12161c; }
@media (max-width: 900px) {
  .inv-cabecera { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .inv-datos { padding-left: 0; border-left: 0; padding-top: 14px; border-top: 1px solid #eef0f3; }
}

/* ---- Enlaces por sucursal: una sola linea, todo a la misma altura ---- */
.cgc .cgc-enlace { display: block; padding: 14px 16px; }
.cgc .cgc-enlace__nombre { display: block; font-size: 14px; color: #1c2430; margin-bottom: 8px; }
.cgc .cgc-enlace__fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cgc .cgc-enlace__fila > code, .cgc .cgc-enlace__fila > .cgc-sin {
  flex: 1 1 260px; min-width: 0; height: 36px; display: flex; align-items: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: #475569; background: #fff; border: 1px solid #e3e6eb; border-radius: 8px; padding: 0 10px;
}
.cgc .cgc-enlace__fila > .cgc-sin { color: #8a93a3; background: #f7f8fa; font-style: normal; }
.cgc .cgc-enlace__acciones { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cgc .cgc-enlace__acciones .ghost-button,
.cgc .cgc-enlace__acciones .primary-button,
.cgc .cgc-enlace__acciones .cgc-link { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; white-space: nowrap; text-decoration: none; font-size: 13px; }
/* "Cambiar enlace" ahora es un boton, no un texto suelto. */
.cgc .cgc-enlace__acciones .cgc-link { border: 1px solid #e8c9c5; background: #fff; color: #b42318; font-weight: 600; }
.cgc .cgc-enlace__acciones .cgc-link:hover { background: #fdf4f3; border-color: #d9a49e; text-decoration: none; }
@media (max-width: 760px) {
  .cgc .cgc-enlace__fila > code, .cgc .cgc-enlace__fila > .cgc-sin { flex-basis: 100%; }
  .cgc .cgc-enlace__acciones { width: 100%; justify-content: flex-end; }
}

/* ---- Configuracion: que los paneles antiguos (Impresion, Correo) se vean
   igual que los nuevos: mismos margenes, alturas y alineaciones ---- */
.cfg-contenido .ci-estado:empty { display: none; }
.cfg-contenido > .cajagou-impresion:not(.cgc) { padding: 0 !important; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-head { padding: 16px 22px; margin: 0; border-bottom: 1px solid #eef0f3; align-items: center; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-switch,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-acciones,
.cfg-contenido > .cajagou-impresion:not(.cgc) > p,
.cfg-contenido > .cajagou-impresion:not(.cgc) > .cp-lista { margin: 0; padding: 16px 22px; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid { gap: 14px 16px; align-items: start; border-top: 1px solid #f1f2f4; }
/* Los campos van en columna (titulo arriba); los interruptores, en fila. */
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid > label:not(.ci-switch) { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3b4658; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-switch { flex-direction: row !important; justify-content: flex-start; text-align: left; font-size: 13.5px; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid input,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid select { height: 40px; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-grid .ci-switch { padding: 0; align-self: center; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-acciones { display: flex; gap: 8px; justify-content: flex-end; background: #fafbfc; border-top: 1px solid #eef0f3; }
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-acciones button,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-acciones .ghost-button,
.cfg-contenido > .cajagou-impresion:not(.cgc) .ci-acciones .primary-button { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; }

/* Aviso cuando el Excel de importacion no trae las columnas esperadas. */
.import-aviso {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid #e6e8ec;
  border-left: 3px solid #b42318;
  border-radius: 3px;
  background: #fff;
  font-size: 13px;
  color: #3b4250;
}
.import-aviso strong { display: block; color: #12161c; margin-bottom: 4px; }
.import-aviso p { margin: 4px 0 0; }
