:root {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --panel-2: #f7f5ef;
  --line: #e7e2d6;
  --text: #1d1b16;
  --muted: #847d70;
  --soft: #4a463d;
  --brand: #211f19;
  --brand-2: #45413a;
  --brand-3: #211f19;
  /* Acento estructural (no tematizable): estados activos, foco, detalles. */
  --accent: #0f6b5c;
  --accent-soft: #e4f0ec;
  --good: #0f766e;
  --warn: #b42318;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 14px 40px rgba(31, 27, 20, .09);
  --shadow-sm: 0 2px 10px rgba(31, 27, 20, .05);
  --font-display: "Familjen Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand strong, .metric strong, .receipt h2, .login-card h1 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
.metric strong, .total-row strong, .grand strong, .rt-grand, td, .receipt {
  font-variant-numeric: tabular-nums;
}
/* Numeros protagonistas en monoespaciada: se leen alineados como una terminal. */
.metric strong,
.total-row strong, .grand strong, .rt-grand, .rt-row strong,
.clock-pill, .recent-row b, .pay-row strong, .bar > strong,
.cc-kpi strong, .cash-close .cc-row strong, .pie-item strong,
.money-field input, #totGrand, #totSubtotal, #totTax, #totDiscount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #ffffff;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card img {
  width: 160px;
  height: 88px;
  object-fit: contain;
  justify-self: center;
}

.login-card h1 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}

/* ===== Anuncios del sistema (banners) — diseño premium unificado ===== */
.sys-banner {
  position: fixed; left: 0; right: 0; z-index: 1000;
  color: #fff; overflow: hidden;
  --sysb-a: #b45309; --sysb-b: #d97706; --sysb-c: #f59e0b;
  background: linear-gradient(100deg, var(--sysb-a), var(--sysb-b) 55%, var(--sysb-c));
}
.sys-banner.top { top: 0; box-shadow: 0 4px 20px rgba(0,0,0,.22); }
.sys-banner.bottom { bottom: 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25); animation: sysb-up .32s cubic-bezier(.22,.61,.36,1) both; }
.sys-banner.top { animation: sysb-down .32s cubic-bezier(.22,.61,.36,1) both; }
/* Brillo diagonal que recorre lentamente (toque premium, muy sutil). */
.sys-banner::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-18deg); animation: sysb-shine 6s ease-in-out infinite; pointer-events: none;
}
/* Textura de puntos muy tenue para dar profundidad. */
.sys-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1.4px);
  background-size: 13px 13px;
}
.sysb-inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 13px; padding: 8px 18px; min-height: 48px;
}
.sysb-badge {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(255,255,255,.20); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 2px 6px rgba(0,0,0,.15);
}
.sysb-msg { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.sysb-msg > b { font-size: 14px; font-weight: 800; letter-spacing: .2px; }
.sysb-sub { font-size: 12.5px; font-weight: 500; opacity: .92; }
.sysb-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.95); color: var(--sysb-a);
  font-size: 12.5px; font-weight: 800; padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.sysb-pill.warn { animation: sysb-pulse 1.6s ease-in-out infinite; }
.sysb-pill.danger { background: #fff; color: #b91c1c; }
.sysb-pill-ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sysb-cta {
  flex: none; background: rgba(255,255,255,.96); color: var(--sysb-a);
  border: 0; border-radius: 9px; padding: 7px 15px; font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .12s ease, box-shadow .18s ease;
}
.sysb-cta:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,.28); }
.sysb-cta:active { transform: translateY(0) scale(.97); }
/* Variantes de color */
.sys-banner.notice { --sysb-a: #0b5c4f; --sysb-b: #0f8a76; --sysb-c: #17b8a0; }
.sys-banner.support { --sysb-a: #9a3412; --sysb-b: #c2410c; --sysb-c: #ea580c; }
/* Empuje del layout cuando el banner de prueba esta arriba. */
body.has-trial-banner .app-shell { margin-top: 48px; }
body.has-trial-banner .sidebar { top: 48px; height: calc(100vh - 48px); }
@keyframes sysb-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes sysb-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sysb-shine { 0% { left: -55%; } 55%,100% { left: 130%; } }
@keyframes sysb-pulse { 0%,100% { box-shadow: 0 2px 8px rgba(0,0,0,.18); } 50% { box-shadow: 0 2px 14px rgba(255,255,255,.55); } }
@media (max-width: 640px) {
  .sysb-inner { gap: 10px; padding: 7px 12px; }
  .sysb-sub { display: none; }
  .sysb-badge { width: 30px; height: 30px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sys-banner::before, .sysb-pill.warn { animation: none; } }

/* ===== Aviso del proveedor como TOAST flotante (mensaje que sale del icono) ===== */
.notice-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 1200;
  display: flex; align-items: flex-start; max-width: 380px;
  animation: nt-in .34s cubic-bezier(.34,1.56,.64,1) both;
}
.notice-toast.nt-out { animation: nt-out .22s ease forwards; }
.nt-icon {
  flex: none; width: 48px; height: 48px; border-radius: 50%; margin-top: 8px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 6px 18px rgba(217,119,6,.5); animation: nt-ring 2s ease-in-out infinite;
}
.nt-alert { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nt-body {
  position: relative; margin-left: -10px; background: var(--panel, #fff);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.20); min-width: 250px;
}
/* Pico que conecta el bocadillo con el icono de alerta. */
.nt-body::before {
  content: ""; position: absolute; left: -7px; top: 18px; width: 13px; height: 13px;
  background: var(--panel, #fff); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.nt-title { font-weight: 800; font-size: 12.5px; color: #b45309; text-transform: uppercase; letter-spacing: .4px; }
.nt-close { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted, #847d70); cursor: pointer; padding: 0 2px; border-radius: 6px; }
.nt-close:hover { color: var(--text, #1d1b16); background: var(--panel-2, #f7f5ef); }
.nt-msg { margin: 0 0 11px; font-size: 13.5px; line-height: 1.45; color: var(--text, #1d1b16); }
.nt-ok {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; border: 0; border-radius: 9px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 10px rgba(217,119,6,.35); transition: transform .12s ease, box-shadow .18s ease;
}
.nt-ok i { width: 15px; height: 15px; }
.nt-ok:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(217,119,6,.5); }
.nt-ok:active { transform: translateY(0) scale(.97); }
@keyframes nt-in { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes nt-out { to { opacity: 0; transform: translateY(14px) scale(.92); } }
@keyframes nt-ring { 0%,100% { box-shadow: 0 6px 18px rgba(217,119,6,.5); } 50% { box-shadow: 0 6px 24px rgba(217,119,6,.78); } }
@media (max-width: 480px) { .notice-toast { right: 12px; left: 12px; bottom: 12px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .notice-toast, .nt-icon { animation: none; } }

/* Estado de lectura de avisos en el Panel Maestro */
.notice-status { margin-top: 12px; }
.ns-card { background: var(--panel-2, #f7f5ef); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; }
.ns-line { font-size: 13px; }
.ns-lbl { font-weight: 700; color: var(--muted, #847d70); }
.ns-txt { color: var(--text, #1d1b16); }
.nread { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.nread i { width: 13px; height: 13px; }
.nread.ok { background: #dcfce7; color: #166534; }
.nread.pending { background: #fef3c7; color: #92400e; }
.nread.none { background: #eef1f5; color: #5b6472; }

body.sidebar-collapsed .app-shell {
  grid-template-columns: 84px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 5;
  transition: width .18s ease, padding .18s ease;
}

.brand {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 9px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

body.sidebar-collapsed .sidebar {
  padding: 14px 12px;
  overflow-x: hidden;
}

body.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
}

body.sidebar-collapsed .brand img {
  width: 54px;
  height: 44px;
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-button span,
body.sidebar-collapsed .nav-button i:last-child,
body.sidebar-collapsed .shift-card {
  display: none;
}

.brand img {
  width: 86px;
  height: 58px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
}

.sidebar .brand span,
.sidebar .eyebrow,
.sidebar .small {
  color: var(--muted);
}

.brand span, .eyebrow, .small, label, .muted {
  color: var(--muted);
}

#nav {
  display: grid;
  gap: 7px;
  padding: 20px 0;
}

.nav-button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--soft);
  background: transparent;
  text-align: left;
}

body.sidebar-collapsed .nav-button {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 0;
}

.nav-button:hover, .nav-button.active {
  color: var(--text);
  background: #f3f4f6;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

/* Secciones del menu lateral (Operaciones, Comercial, ...). */
.nav-group {
  display: grid;
  gap: 2px;
}
.nav-group + .nav-group {
  margin-top: 12px;
}
body.sidebar-collapsed .nav-group + .nav-group { margin-top: 8px; }

.shift-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: var(--text);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

.top-actions, .row, .toolbar, .dialog-actions, .split-actions, .action-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none; /* el toggle vive en el sidebar (junto al nombre); en movil reaparece */
  flex: 0 0 auto;
}

.top-actions {
  justify-content: flex-end;
  max-width: 760px;
}

.action-cluster {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.action-cluster .ghost,
.action-cluster .primary {
  min-height: 36px;
}

.session-pill,
.clock-pill,
.sync-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.clock-pill {
  min-width: 196px;
  justify-content: center;
  color: var(--text);
}

.sync-pill {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sync-pill.offline {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.primary, .danger, .ghost, .icon-button, .chip{
  min-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--text);
}

.primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(17, 24, 39, .18);
}

.danger {
  background: #991b1b;
  color: #ffffff;
}

.ghost, .icon-button{
  background: #ffffff;
  border: 1px solid var(--line);
}

.icon-button {
  width: 40px;
  padding: 0;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  background: #f3f4f6;
  color: var(--soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 14px;
}
/* Los items de un grid tienen min-width:auto por defecto, lo que les impide encogerse
   por debajo del ancho de su contenido (p. ej. una tabla ancha) y desborda la pagina en
   el telefono. min-width:0 deja que se encojan y que el scroll interno (table-wrap) actue. */
.grid > * { min-width: 0; }

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel, .metric, .table-wrap, .form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel, .form-panel {
  padding: 16px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.metric small {
  color: var(--soft);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2, .section-title h3 {
  margin: 0;
  font-size: 19px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.info-strip strong,
.info-strip span {
  display: block;
}

.info-strip span {
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 12px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 78px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.inventory-table {
  min-width: 880px;
}

.inventory-table td:first-child {
  min-width: 200px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:hover td {
  background: #f9fafb;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 570px;
  overflow: auto;
  padding-right: 4px;
}

.product-tile {
  min-height: 118px;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  display: grid;
  align-content: space-between;
}

.product-tile strong {
  line-height: 1.15;
}

.product-tile span {
  color: var(--muted);
  font-size: 12px;
}

.brand-preview {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.brand-preview img {
  width: 96px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.logo-placeholder {
  width: 96px;
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-preview strong,
.brand-preview span {
  display: block;
}

.brand-preview strong {
  font-size: 20px;
}

.brand-preview span {
  color: var(--muted);
  margin-top: 4px;
}

.cart {
  position: sticky;
  top: 20px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.totals {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.payment-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--warn);
  font-weight: 800;
  font-size: 13px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.total-row.discount-row { align-items: center; }
.total-row.discount-row label { color: var(--muted); }
.total-row.discount-row input {
  width: 130px;
  text-align: right;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
}

.grand {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar {
  display: grid;
  grid-template-columns: 130px 1fr 92px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 13px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.low {
  color: var(--warn);
}

.receipt-dialog {
  width: min(620px, 96vw);
  max-height: 92vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  overflow: auto;
}

.receipt-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}

.receipt {
  width: min(100%, 440px);
  margin: 0;
  padding: 28px;
  color: #111827;
  background: #ffffff;
  font-size: 15px;
  line-height: 1.32;
}

.receipt h2, .receipt p {
  margin: 0;
}

.receipt h2 {
  font-size: 24px;
  line-height: 1.15;
}

.receipt-header,
.receipt-note,
.receipt-meta{
  text-align: center;
}

.receipt-meta{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.receipt-separator {
  border-top: 1px dashed #9ca3af;
  margin: 12px 0;
}

.receipt-code-box {
  color: #000;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-align: center;
  word-break: break-word;
}

.receipt-label-box {
  color: #000;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  margin-top: 8px;
  text-align: center;
  text-transform: uppercase;
  word-break: break-word;
}

/* Recibo mejorado: encabezado, badge fiscal y filas de totales limpias. */
.receipt-header h2 { letter-spacing: .5px; }
.receipt-slogan { font-style: italic; color: #6b7280; margin-bottom: 4px; }
.receipt-fiscal-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border: 1.5px solid #111827;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.receipt-void-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 2px solid #b91c1c;
  border-radius: 8px;
  color: #b91c1c;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}
.receipt-void-banner span { font-weight: 600; letter-spacing: 0; font-size: 12px; }
.receipt-voided { opacity: .92; }
.receipt .rt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
  text-align: left;
}
.receipt .rt-row span { color: #6b7280; }
.receipt .rt-row b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.receipt .rt-grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid #111827;
  font-size: 19px;
}
.receipt .rt-grand span { color: #111827; font-weight: 800; }
.receipt-note { margin: 2px 0; color: #6b7280; font-size: 13px; }

/* Check de facturacion fiscal (CAI) en el POS. */
.fiscal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.fiscal-check input { width: 16px; height: 16px; cursor: pointer; }

.order-draft {
  display: grid;
  gap: 8px;
}

.order-draft-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.order-draft-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.order-channel {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 32px;
  margin: 0 0 10px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: .4px;
}

.order-card {
  position: relative;
}

.kitchen-order-card {
  background: var(--order-bg, #f7f8fa);
  border-color: rgba(17, 24, 39, .18);
}

.kitchen-order-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 8px 0 0 8px;
  background: var(--order-accent, #dbeafe);
}

.kitchen-order-card > * {
  position: relative;
}

.order-highlight-wrap {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #fff7ed;
}

.order-code-box,
.order-label-box {
  color: #000;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  word-break: break-word;
}

.order-code-box {
  font-size: clamp(34px, 7vw, 62px);
  line-height: .95;
}

.order-label-box {
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1;
}

.receipt .receipt-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.receipt .receipt-line span {
  color: #4b5563;
}

.receipt .receipt-line strong {
  flex: 1 1 100%;
  max-width: 100%;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.receipt .receipt-line span + strong {
  flex-basis: 58%;
}

.report-chart {
  margin: 14px 0;
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 18px;
  align-items: center;
}

.pie-chart {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.receipt-total {
  margin-top: 8px;
  padding-top: 9px !important;
  border-top: 1px solid #111827;
  font-size: 18px;
}

.receipt-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 auto;
}

.receipt-table th,
.receipt-table td {
  padding: 7px 4px;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  font-size: 14px;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.receipt-table th {
  color: #4b5563;
  font-size: 12px;
}

.receipt-table th:first-child,
.receipt-table td:first-child {
  width: 13%;
  text-align: left;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
  width: 58%;
  text-align: left;
}

.receipt-table th:last-child,
.receipt-table td:last-child {
  width: 29%;
  text-align: right;
}

.dialog-actions {
  justify-content: flex-end;
  padding: 12px;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.mobile-only {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: 286px;
  }

  body.sidebar-collapsed .sidebar {
    padding: 18px;
  }

  body.sidebar-collapsed .brand {
    grid-template-columns: 86px 1fr;
    justify-items: stretch;
    gap: 12px;
  }

  body.sidebar-collapsed .brand img {
    width: 86px;
    height: 58px;
  }

  body.sidebar-collapsed .brand div,
  body.sidebar-collapsed .nav-button span,
  body.sidebar-collapsed .nav-button i:last-child,
  body.sidebar-collapsed .shift-card {
    display: block;
  }

  body.sidebar-collapsed .nav-button {
    grid-template-columns: 22px 1fr auto;
    justify-items: stretch;
    padding: 11px 12px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Panel de soporte (embed): el menu lateral se mantiene FIJO y visible aunque el
     iframe sea angosto (< 1080px), para poder navegar y colapsar como en escritorio,
     en vez de esconderse off-canvas. */
  body.embed .app-shell { grid-template-columns: 200px 1fr; }
  body.embed.sidebar-collapsed .app-shell { grid-template-columns: 84px 1fr; }
  body.embed .sidebar { position: sticky; transform: none; width: auto; }

  .menu-toggle {
    display: inline-flex;
  }

  .kpi-grid, .three-col, .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart {
    position: static;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px;
  }

  /* --- Barra superior COMPACTA en movil (antes cada boton ocupaba una fila) --- */
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
  }
  .topbar h1 { font-size: 22px; }
  .topbar .eyebrow { font-size: 10.5px; }
  /* Info secundaria y respaldos: no van en el encabezado del telefono. */
  .clock-pill, .sync-pill, .session-pill, #dbActions { display: none !important; }
  /* La campana queda arriba a la derecha, compacta. */
  .top-actions .alert-bell { order: -1; }
  /* Acciones en una fila horizontal que se ajusta, no pastillas de ancho completo. */
  .top-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 2px;
  }
  .action-cluster {
    width: auto;
    padding: 0;
    border: 0;
    background: none;
    gap: 8px;
    flex: 1 1 auto;
  }
  .action-cluster button,
  .top-actions > button:not(.alert-bell) {
    width: auto;
    flex: 1 1 auto;
    min-height: 42px;
    font-size: 13px;
    white-space: nowrap;
  }

  .field-grid, .field-grid.three, .search-row {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-only {
    display: inline-flex;
  }
}

@media print {
  @page {
    size: 100mm 148mm;
    margin: 0;
  }

  html,
  body {
    width: 100mm;
    min-height: 148mm;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  body.printing-receipt * {
    visibility: hidden !important;
    box-shadow: none !important;
  }

  body.printing-receipt #receiptContent,
  body.printing-receipt #receiptContent * {
    visibility: visible !important;
  }

  body.printing-receipt .receipt-dialog {
    position: static !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  body.printing-receipt #receiptContent {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  body.printing-receipt .receipt {
    width: 82mm !important;
    margin: 0 !important;
    padding: 4mm 7mm 4mm 3mm !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-size: 10pt !important;
    line-height: 1.25 !important;
    overflow: hidden !important;
  }

  body.printing-receipt .dialog-actions {
    display: none !important;
  }
}

/* ===========================================================================
   Animaciones e interacciones fluidas (capa aditiva). Respeta reduce-motion.
   =========================================================================== */
/* Animaciones leves: desplazamientos minimos y escalas muy cercanas a 1. */
@keyframes sf-fade-up { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes sf-pop-in { from { opacity: 0; transform: scale(.99); } to { opacity: 1; transform: none; } }
@keyframes sf-slide-in { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: none; } }
@keyframes sf-backdrop { from { opacity: 0; } to { opacity: 1; } }

/* Botones: hover con elevacion sutil y press tactil leve. */
.primary, .danger, .ghost, .icon-button, button, [data-view], [data-checkout], [data-add-cart] {
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease,
    border-color .18s ease, color .15s ease, opacity .15s ease;
}
.primary:hover, .danger:hover, .ghost:hover, .icon-button:hover{ transform: translateY(-1px); }
.primary:hover { box-shadow: 0 16px 30px rgba(17, 24, 39, .18); }
.ghost:hover, .icon-button:hover{ border-color: var(--brand); }
.primary:active, .danger:active, .ghost:active, .icon-button:active,
button:active { transform: translateY(0) scale(.985); }
button:disabled, .primary:disabled { transform: none; opacity: .55; cursor: not-allowed; }

/* Navegacion lateral: leve desplazamiento al pasar el cursor. */
.nav-button { transition: background-color .16s ease, color .16s ease, transform .14s ease, box-shadow .16s ease; }
.nav-button:hover { transform: translateX(2px); }
.nav-button.active { transform: none; }

/* Tarjetas y tiles: elevacion sutil al pasar el cursor. */
.product-tile { transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
.product-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(17, 24, 39, .09); border-color: var(--brand); }
.product-tile:active { transform: translateY(0) scale(.99); }
.metric, .order-card { transition: transform .16s ease, box-shadow .18s ease; }
.metric:hover, .order-card:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(17, 24, 39, .08); }

/* Inputs: anillo de foco suave. */
input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(17, 24, 39, .1); }
.fiscal-check { transition: border-color .15s ease, background-color .15s ease; }
.fiscal-check:hover { border-color: var(--brand); }

/* Filas de tabla: resaltado suave. */
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: rgba(17, 24, 39, .03); }

/* Entrada del panel al navegar (se dispara desde render() con .view-enter). */
#app.view-enter > * { animation: sf-fade-up .24s cubic-bezier(.22, .61, .36, 1) both; }
#app.view-enter .kpi-grid > * { animation: sf-pop-in .26s ease both; }
#app.view-enter .kpi-grid > *:nth-child(2) { animation-delay: .04s; }
#app.view-enter .kpi-grid > *:nth-child(3) { animation-delay: .08s; }
#app.view-enter .kpi-grid > *:nth-child(4) { animation-delay: .12s; }

/* Ordenes (cocina/mesas): entrada suave. El carrito NO se anima por linea para
   que agregar productos rapido se sienta instantaneo, no agitado. */
.order-card { animation: sf-fade-up .22s ease both; }

/* Dialogo del recibo: aparece con leve escala + fundido del fondo. */
.receipt-dialog[open] { animation: sf-pop-in .2s cubic-bezier(.22, .61, .36, 1) both; }
.receipt-dialog[open]::backdrop { animation: sf-backdrop .2s ease both; }

/* Pantalla de acceso y app: fundido leve al entrar. */
.login-card { animation: sf-fade-up .26s ease both; }
.app-shell:not([hidden]) .main { animation: sf-fade-up .24s ease both; }

/* Pildora de sincronizacion: latido al guardar correctamente. */
.sync-pill:not(.offline) { transition: background-color .2s ease, color .2s ease; }

/* Accesibilidad: si el usuario pidio menos movimiento, se desactiva todo. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ===========================================================================
   REDISEÑO 2026: identidad cálida-premium. Acordeon de modulos + componentes.
   Capa de refinamiento (sobrescribe por orden de fuente).
   =========================================================================== */
body { background:
  radial-gradient(1200px 480px at 12% -8%, rgba(15,107,92,.05), transparent 60%),
  radial-gradient(900px 420px at 105% 0%, rgba(33,31,25,.045), transparent 55%),
  var(--bg);
  background-attachment: fixed;
}

/* --- Barra lateral --- */
.sidebar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--bg)) , var(--panel));
  border-right: 1px solid var(--line);
  padding: 16px 14px;
}
.brand { padding-bottom: 14px; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand img { border-radius: 10px; }

#nav { gap: 1px; padding: 12px 0 8px; }

/* Inicio (Panel) como item principal aparte (no es un modulo colapsable). */
.nav-home {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
  transition: background-color .16s ease, color .16s ease;
}
.nav-home i {
  width: 30px; height: 30px; padding: 6px; border-radius: 9px; box-sizing: border-box;
  background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--soft);
}
.nav-home:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.nav-home.active { background: var(--accent-soft); color: var(--accent); }
.nav-home.active i { background: var(--accent); color: #fff; }
body.sidebar-collapsed .nav-home { grid-template-columns: 1fr; justify-items: center; }
body.sidebar-collapsed .nav-home span { display: none; }

/* Modulo (categoria colapsable) */
.nav-module + .nav-module { margin-top: 0; }
.nav-module-head {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color .16s ease, color .16s ease;
}
.nav-module-head:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.nav-mod-icon {
  width: 30px; height: 30px; padding: 6px; border-radius: 9px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--soft); display: inline-flex; box-sizing: border-box;
}
.nav-module.has-active .nav-mod-icon { background: var(--accent); color: #fff; }
.nav-mod-name { font-weight: 700; font-size: 13.5px; letter-spacing: .2px; }
.nav-mod-caret { width: 16px; height: 16px; color: var(--muted); transition: transform .24s ease; }
.nav-module.open .nav-mod-caret { transform: rotate(180deg); }

/* Contenedor colapsable (animacion suave de alto) */
.nav-module-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s cubic-bezier(.22,.61,.36,1); }
.nav-module.open .nav-module-items { grid-template-rows: 1fr; }
.nav-module-inner { overflow: hidden; display: grid; gap: 2px; padding: 3px 0 4px; }

/* Items dentro del modulo */
.nav-module .nav-button {
  grid-template-columns: 20px 1fr;
  gap: 11px;
  margin-left: 14px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  position: relative;
}
.nav-module .nav-button::before {
  content: ""; position: absolute; left: -2px; top: 50%; width: 3px; height: 0;
  background: var(--accent); border-radius: 3px; transform: translateY(-50%); transition: height .18s ease;
}
.nav-module .nav-button i { width: 18px; height: 18px; }
.nav-module .nav-button:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); transform: none; }
.nav-module .nav-button.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: none;
}
.nav-module .nav-button.active::before { height: 18px; }

/* Sidebar colapsada: mostrar iconos, sin acordeon */
body.sidebar-collapsed .nav-module-items { grid-template-rows: 1fr; }
body.sidebar-collapsed .nav-mod-name,
body.sidebar-collapsed .nav-mod-caret { display: none; }
body.sidebar-collapsed .nav-module-head { grid-template-columns: 1fr; justify-items: center; }
body.sidebar-collapsed .nav-module .nav-button { margin-left: 0; grid-template-columns: 1fr; justify-items: center; }

/* --- Barra superior --- */
.topbar { padding: 16px 22px; gap: 14px; }
.topbar h1 { font-size: 30px; line-height: 1.05; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.clock-pill, .sync-pill, .session-pill {
  border-radius: 999px; font-weight: 700; font-size: 12.5px;
}

/* --- Tarjetas y paneles --- */
.panel, .form-panel, .table-wrap, .metric {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.panel:hover, .form-panel:hover { box-shadow: var(--shadow-sm); }
.section-title h2 { font-size: 18px; letter-spacing: -.01em; }

/* --- KPIs --- */
.metric { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.metric::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); opacity: .7;
}
.metric span { font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.metric strong { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.metric small { font-size: 12px; }

/* --- Botones --- */
.primary, .danger, .ghost, .icon-button, .chip {
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.primary { background: var(--brand); box-shadow: 0 10px 24px rgba(31,27,20,.18); }
.primary:hover { box-shadow: 0 14px 30px rgba(31,27,20,.24); }
.chip { border-radius: 999px; }

/* --- Campos --- */
input, select, textarea {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent) !important;
  background: var(--panel);
}
label { font-size: 12.5px; font-weight: 600; }

/* --- Tablas --- */
table { border-collapse: separate; border-spacing: 0; }
thead th {
  font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 11px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.status { border-radius: 999px; font-weight: 700; font-size: 12px; padding: 3px 10px; }

/* --- Login: layout dividido (bienvenida teal + formulario), paleta clara --- */
.login-screen {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 20% 0%, var(--accent-soft), transparent 55%),
    radial-gradient(800px 480px at 100% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 55%),
    var(--bg);
}
/* Retícula de puntos interactiva del fondo (dibujada por canvas). */
.login-fx {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  display: block;
}

/* Tarjeta dividida: bienvenida (izq) + formulario (der). */
.login-split {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  width: min(1080px, 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 38px 90px rgba(31,27,20,.18), 0 0 0 1px color-mix(in srgb, var(--accent) 7%, transparent);
  transition: box-shadow .2s ease;
  animation: sf-fade-up .3s ease both;
}
.login-card { animation: none; }

/* Panel de bienvenida (degradado teal + círculos decorativos). */
.login-welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 60px 46px;
  color: #eafaf6;
  background: linear-gradient(150deg, #0c5a4d 0%, #0f6b5c 44%, #14a08f 100%);
}
.login-welcome::before,
.login-welcome::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-welcome::before {
  width: 380px; height: 380px; left: -140px; bottom: -150px;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.20), rgba(255,255,255,.02) 70%);
}
.login-welcome::after {
  width: 260px; height: 260px; right: -90px; top: -90px;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 68%);
}
.login-welcome-body { position: relative; z-index: 1; }
.login-welcome-eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: 2.4px;
  text-transform: uppercase; color: rgba(255,255,255,.72);
}
.login-welcome-title {
  margin: 0; font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px); line-height: 1.05; letter-spacing: -.01em; color: rgba(255,255,255,.86);
  font-weight: 600;
}
/* Nombre del negocio: protagonista del mensaje de bienvenida. */
.login-welcome-name {
  margin: 4px 0 18px; font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.025em;
  font-weight: 800; color: #ffffff; word-break: break-word;
}
.login-welcome-text {
  margin: 0; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.85); max-width: 34ch;
}

/* Formulario (der): sin borde/sombra propios; vive dentro de la tarjeta dividida. */
.login-card {
  width: auto;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 56px 48px;
  display: grid;
  gap: 16px;
  align-content: center;
}
.login-card img {
  width: 148px; height: 74px; justify-self: start; margin: 0 0 4px;
  filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--accent) 24%, transparent));
  animation: login-logo-float 5s ease-in-out infinite;
}
@keyframes login-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) { .login-card img { animation: none; } }
.login-card h1 { font-size: 30px; letter-spacing: -.02em; margin: 2px 0 0; }
.login-card .eyebrow { color: var(--accent); letter-spacing: 1.6px; }
.login-card .field input { min-height: 46px; }
/* Botón de acceso: degradado teal, ancho completo, con brillo. */
.login-card .primary {
  width: 100%; min-height: 52px; margin-top: 6px; font-size: 15.5px;
  background: linear-gradient(135deg, #0f6b5c 0%, #12988a 55%, #16b7a3 100%);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 14px 30px rgba(15, 107, 92, .32);
  letter-spacing: .2px;
}
.login-card .primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.24) inset, 0 18px 38px rgba(15,107,92,.44); }
.login-card .link-button { color: var(--accent); justify-self: start; padding-left: 0; }
.login-card .link-button:hover { color: #0c5447; }

/* Responsive: apilar bienvenida (arriba) + formulario (abajo) en pantallas angostas. */
@media (max-width: 760px) {
  .login-split { grid-template-columns: 1fr; width: min(440px, 100%); }
  .login-welcome { padding: 30px 28px 26px; }
  .login-welcome-title { font-size: 22px; }
  .login-welcome-name { font-size: 30px; margin-bottom: 10px; }
  .login-welcome-text { display: none; }
  .login-welcome::before { width: 240px; height: 240px; }
  .login-card { padding: 30px 26px 28px; }
}

/* Pildora de modo soporte ya existente: solo redondeo coherente */
#supportBanner { font-family: var(--font-body); }

/* ===========================================================================
   INTERFAZ COMPACTA: escala global (todo mas pequeño). Se compensan las
   alturas en vh para que las columnas sigan llenando la pantalla.
   =========================================================================== */
:root { --ui-scale: .85; }
.app-shell, .login-screen { zoom: var(--ui-scale); }
.app-shell, .login-screen { min-height: calc(100vh / var(--ui-scale)); }
.sidebar { height: calc(100vh / var(--ui-scale)); }

/* ===========================================================================
   PANEL + REPORTES (rediseño): aprovechar espacio, claridad y animaciones.
   =========================================================================== */
/* Panel: dos columnas que se apilan para no desperdiciar alto. */
.dash-main { grid-template-columns: minmax(0, 1.5fr) minmax(290px, .92fr); align-items: start; margin-top: 14px; }
.dash-col { display: grid; gap: 14px; align-content: start; }
.dash-actions { margin-top: 14px; }
.dash-col .panel, .dash-actions .panel { transition: transform .18s ease, box-shadow .2s ease; }
.dash-col .panel:hover, .dash-actions .panel:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Ventas recientes */
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 9px 4px; border-radius: 10px; transition: background-color .14s ease; }
.recent-row:hover { background: var(--panel-2); }
.recent-row + .recent-row { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.recent-row.voided { opacity: .55; }
.recent-row.voided b, .recent-row.voided .recent-main strong { text-decoration: line-through; }
.recent-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.recent-ico[data-m="Tarjeta"] { background: #f3ece1; color: #b2752a; }
.recent-ico[data-m="Transferencia"] { background: #eee9f3; color: #6f56a0; }
.recent-ico i { width: 17px; height: 17px; }
.recent-main { display: grid; gap: 1px; min-width: 0; }
.recent-main strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main span { font-size: 11.5px; color: var(--muted); }
.recent-row b { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 14.5px; }

/* Pagos del dia */
.pay-break { display: grid; gap: 13px; padding-top: 2px; }
.pay-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 11px; }
.pay-row > span { font-size: 13px; font-weight: 600; }
.pay-row .bar-track { height: 9px; }
.pay-row .bar-fill { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6fcfb4)); }
.pay-row strong { font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* Barras (panel y reportes) mas limpias */
.bar-chart { gap: 13px; }
.bar { grid-template-columns: 124px 1fr 96px; gap: 12px; }
.bar > span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.bar > strong { text-align: right; font-variant-numeric: tabular-nums; }

/* Cascada de entrada del Panel (mas agradable al entrar). */
#app.view-enter > .dash-main, #app.view-enter > .dash-actions { animation: none; }
#app.view-enter .dash-col > *,
#app.view-enter .dash-actions > * { animation: sf-fade-up .46s cubic-bezier(.22, .61, .36, 1) both; }
#app.view-enter .dash-col:nth-child(1) > *:nth-child(1) { animation-delay: .12s; }
#app.view-enter .dash-col:nth-child(1) > *:nth-child(2) { animation-delay: .20s; }
#app.view-enter .dash-col:nth-child(2) > *:nth-child(1) { animation-delay: .16s; }
#app.view-enter .dash-col:nth-child(2) > *:nth-child(2) { animation-delay: .24s; }
#app.view-enter .dash-col:nth-child(2) > *:nth-child(3) { animation-delay: .32s; }
#app.view-enter .dash-actions > *:nth-child(1) { animation-delay: .30s; }
#app.view-enter .dash-actions > *:nth-child(2) { animation-delay: .36s; }
#app.view-enter .dash-actions > *:nth-child(3) { animation-delay: .42s; }

/* Reportes: barra de filtros como tarjeta cohesiva. */
.report-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow-sm);
}
.report-toolbar > * { flex: 0 0 auto; width: auto; min-height: 38px; }
.report-toolbar select { min-width: 158px; }
.report-toolbar input[type="date"] { min-width: 148px; }
.report-toolbar .ghost { background: var(--panel-2); }

/* Graficas mas claras */
.report-chart { margin: 16px 0 6px; }
.pie-chart {
  border: none; box-shadow: var(--shadow-sm);
  -webkit-mask: radial-gradient(circle at center, transparent 40%, #000 41%);
  mask: radial-gradient(circle at center, transparent 40%, #000 41%);
}
.pie-layout .total-row { padding: 7px 2px; }

/* Apilar el panel en pantallas angostas. */
@media (max-width: 1080px) {
  .dash-main { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Botón de menú junto al nombre + paneles del tablero plegables + sidebar angosto
   =========================================================================== */
/* Sidebar mas angosto (menos espacio desperdiciado). */
.sidebar { padding: 14px 10px; }
.brand strong { font-size: 14.5px; }
.brand img { width: 40px; height: 34px; }

/* Boton de mostrar/ocultar menu, a la izquierda del nombre del negocio. */
.brand-toggle {
  width: 32px; height: 32px; min-height: 32px; padding: 0;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--soft);
}
.brand-toggle:hover { color: var(--text); border-color: var(--accent); }
.brand-toggle i { width: 17px; height: 17px; }

/* Sidebar colapsada: el boton y el logo quedan centrados y visibles. */
body.sidebar-collapsed .brand { grid-template-columns: 1fr; justify-items: center; gap: 8px; }

/* Acciones del encabezado de un panel (boton ojo + extras). */
.section-actions { display: inline-flex; align-items: center; gap: 8px; }
.dash-toggle { width: 34px; min-height: 34px; padding: 0; }

/* Paneles del tablero plegables (ocultos por defecto). */
.dash-panel > .section-title { margin: 0; }
.dash-panel .dash-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.22, .61, .36, 1); }
.dash-panel.open .dash-collapse { grid-template-rows: 1fr; }
.dash-collapse-inner { overflow: hidden; min-height: 0; }
.dash-panel.open .dash-collapse-inner { padding-top: 13px; }

/* Ocultar la hamburguesa del topbar en escritorio (gana a .icon-button por orden);
   en movil reaparece para abrir el cajon. */
.menu-toggle { display: none; }
@media (max-width: 1080px) { .menu-toggle { display: inline-flex; } }

/* ===========================================================================
   Modo embebido (panel flotante dentro del master) + modales del master.
   =========================================================================== */
/* Modo embebido (panel de soporte del master): se CONSERVA el menu lateral con su
   acordeon y el boton de colapsar, para poder navegar los modulos del negocio. Solo
   se ocultan las acciones de cuenta del topbar (usuario/logout), que se gestionan
   desde el propio panel maestro. */
body.embed .topbar .top-actions { display: none; }
body.embed .main { padding: 14px 18px; }

/* Modales del Panel Maestro */
.m-modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 24px; background: rgba(31, 27, 20, .42); backdrop-filter: blur(3px);
  animation: sf-backdrop .18s ease both;
}
.m-modal-card {
  width: min(640px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 22px;
  animation: sf-pop-in .22s cubic-bezier(.22, .61, .36, 1) both;
}
/* Panel del negocio (Permisos/Personalizar) a PANTALLA COMPLETA, no un cuadrito. */
.m-modal.m-modal-wide { padding: 0; }
.m-modal-wide .m-modal-card { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; border: 0; padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.m-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.m-modal-head h2 { margin: 2px 0 0; }
.m-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--soft); margin-bottom: 12px; }
.m-detail-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 14px; }
.m-detail-link span { font-size: 12.5px; word-break: break-all; flex: 1; min-width: 160px; }
.m-detail-link input { flex: 1; min-width: 180px; }
.m-detail-kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 6px; }
/* Modal de detalles del negocio: pestañas para separar por proposito. */
.m-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; }
.m-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted, #847d70); cursor: pointer; margin-bottom: -1px; }
.m-tab:hover { color: var(--text); }
.m-tab.active { color: var(--accent, #0f6b5c); border-bottom-color: var(--accent, #0f6b5c); }
.m-field-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #847d70); margin: 0 2px 6px; }
.m-actions-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.m-actions-main button { justify-content: center; }
.m-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px solid #f3c2c2; background: #fdf6f6; border-radius: 12px; }
.m-danger-zone strong { display: block; font-size: 13.5px; color: #8f1d1d; }
.m-danger-zone span { display: block; font-size: 12px; color: #a86868; }
.m-section { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.m-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.m-panel-head strong { font-family: var(--font-display); font-size: 16px; }
.m-panel-frame { width: 100%; height: 100%; border: 0; background: var(--bg); }

/* Campo de dinero con prefijo de moneda (L). */
.money-field {
  display: inline-flex; align-items: stretch; max-width: 190px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); overflow: hidden;
}
.money-field span {
  display: flex; align-items: center; padding: 0 11px;
  font-weight: 800; color: var(--muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-right: 1px solid var(--line);
}
.money-field input {
  border: 0 !important; background: transparent !important;
  box-shadow: none !important; border-radius: 0 !important;
  width: 100%; min-width: 0;
}
.money-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }

/* Inventario: cada producto es una fila clicable que despliega su editor debajo. */
.prod-row { cursor: pointer; transition: background .12s ease; }
.prod-row:hover { background: var(--surface-2, rgba(15,107,92,.05)); }
.prod-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.prod-row.open { background: var(--surface-2, rgba(15,107,92,.08)); }
.prod-row.open td { border-bottom-color: transparent; }
.prod-row .stock-low { color: var(--danger, #c0392b); font-weight: 700; }
.prod-edit-row > td { padding: 0; background: var(--surface-2, rgba(15,107,92,.04)); }
.prod-editor { padding: 16px 18px; display: grid; gap: 12px; animation: sf-fade-up .18s ease both; }
.prod-editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.prod-editor-actions .danger { margin-left: auto; }

/* Campo de codigo de barras con boton de escaneo por camara. */
.scan-field { display: flex; gap: 8px; align-items: stretch; }
.scan-field > input { flex: 1; min-width: 0; }
.scan-field .scan-btn { flex: 0 0 auto; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }
.scan-field .scan-btn i { margin: 0; }

/* Modal de escaneo por camara (overlay a pantalla completa). */
.scan-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 18, 16, .82);
  display: flex; align-items: center; justify-content: center;
  animation: sf-backdrop .18s ease both;
}
.scan-box {
  position: relative; width: min(92vw, 460px);
  background: var(--surface, #fff); border-radius: var(--radius, 16px);
  padding: 16px; display: grid; gap: 12px; justify-items: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: sf-pop-in .2s ease both;
}
.scan-video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; background: #000;
}
.scan-frame {
  position: absolute; top: 16px; left: 16px; right: 16px;
  height: calc(100% * 3 / 4 * 0 + 0px); /* placeholder, marco dibujado abajo */
  pointer-events: none;
}
.scan-box .scan-frame {
  top: 50%; left: 50%; transform: translate(-50%, -56%);
  width: 70%; height: 32%;
  border: 3px solid var(--accent, #0f6b5c); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.04);
}
.scan-hint { margin: 0; color: var(--muted, #667); font-size: 14px; text-align: center; }
.scan-cancel { width: 100%; justify-content: center; }
/* Escaner continuo (POS): contador, aviso flotante y boton Listo */
.scan-continuous .scan-done { width: 100%; justify-content: center; }
.scan-count { margin: -4px 0 0; font-weight: 800; font-size: 13px; color: var(--accent, #0f6b5c); text-align: center; letter-spacing: .01em; }
.scan-toast {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%) translateY(-8px);
  max-width: 84%; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: #fff; background: rgba(15, 23, 42, .9); box-shadow: 0 8px 24px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; z-index: 3;
}
.scan-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.scan-toast.ok { background: var(--accent, #0f6b5c); }
.scan-toast.bad { background: #b91c1c; }
/* Panel de alta rapida (codigo nuevo) sobre la camara */
.scan-create {
  position: absolute; inset: 8px; z-index: 4;
  background: var(--surface, #fff); border-radius: 14px;
  padding: 16px; display: grid; gap: 9px; align-content: start;
  box-shadow: 0 18px 44px rgba(0,0,0,.4); animation: sf-pop-in .16s ease both; overflow: auto;
}
.scan-create-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.scan-create-head i { width: 22px; height: 22px; color: var(--accent, #0f6b5c); flex: 0 0 auto; }
.scan-create-head b { display: block; font-size: 15px; }
.scan-create-head span { font-family: var(--font-mono, monospace); font-size: 12px; color: var(--muted, #667); word-break: break-all; }
.scan-create input { width: 100%; padding: 11px 12px; border: 1px solid var(--line, #dcdcdc); border-radius: 10px; font: inherit; box-sizing: border-box; }
.scan-create input:focus { outline: 2px solid var(--accent, #0f6b5c); outline-offset: -1px; border-color: transparent; }
.scan-create-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.scan-nc-err { color: #b91c1c; font-size: 12.5px; font-weight: 700; min-height: 15px; }
.scan-create-actions { display: flex; gap: 9px; margin-top: 2px; }
.scan-create-actions button { flex: 1; justify-content: center; }

/* Formulario compacto de producto: grilla densa que acomoda los campos en
   tantas columnas como quepan, en vez de una fila por par de campos. */
.compact-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px 12px;
  align-items: end;
}
.compact-form .span-2 { grid-column: span 2; }
.compact-form .full { grid-column: 1 / -1; margin-top: 2px; }
/* Modal "Producto nuevo (desde la compra)": mas ancho y respirado para dar cabida
   a todos los campos del alta de inventario sin apreturas. */
.app-modal:has(.product-modal-form) { width: min(920px, 96vw); }
.product-modal-form { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.product-modal-form .field label { font-weight: 600; }
.prod-editor.compact-form { padding: 16px 18px; }
@media (max-width: 560px) {
  .compact-form { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .compact-form .span-2 { grid-column: 1 / -1; }
}

/* Gestor de listas y catalogos (Configuracion). */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.catalog-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 11px);
  padding: 14px;
  background: var(--panel-2, #f7f5ef);
  display: grid;
  gap: 10px;
  align-content: start;
}
.catalog-block h3 { margin: 0; font-size: 14px; }
.catalog-items { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.catalog-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel, #fff); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}
.catalog-chip.locked { opacity: .7; }
.catalog-chip button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; min-height: 0; padding: 0;
  border-radius: 999px; font-size: 14px; line-height: 1;
  background: transparent; color: var(--warn, #b42318); border: 0;
}
.catalog-chip button:hover { background: var(--warn, #b42318); color: #fff; }
.catalog-add { display: flex; gap: 6px; }
.catalog-add input { flex: 1; min-width: 0; min-height: 36px; }
.catalog-add button { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }

/* Paneles de Configuracion plegables (clic en el titulo). */
.section-title.collapsible { cursor: pointer; user-select: none; }
.section-title .collapse-icon { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.form-panel.collapsed .section-title { margin-bottom: 0; }
.form-panel.collapsed .collapse-icon { transform: rotate(-90deg); }
.form-panel.collapsed > *:not(.section-title) { display: none; }

/* Master: editar el codigo/URL de un negocio en el modal de detalles. */
.m-slug-edit { display: flex; gap: 8px; margin: 4px 0 2px; }
.m-slug-edit input { flex: 1; min-width: 0; min-height: 38px; }
.m-slug-edit button { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }

/* Campo de vencimiento: fecha normal + check "Sin vencimiento" debajo (no altera
   la altura de los demas campos del formulario). */
.expiry-check { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted, #847d70); cursor: pointer; user-select: none; }
.expiry-check input { width: 16px; height: 16px; flex: none; accent-color: var(--accent, #0f6b5c); }
.expiry-check:has(input:checked) { color: var(--accent, #0f6b5c); }
.field input[type="date"]:disabled { opacity: .45; }
.field-grid.align-start { align-items: start; }
.field-grid.align-start .field { align-content: start; }
.compact-form { align-items: start; }
.compact-form .field { align-content: start; }

/* Bloque de tipos de producto: al final y ocupando 2 columnas (mas aire). */
.catalog-block-wide { grid-column: span 2; }
.catalog-block-wide .ptype-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 14px; }
@media (max-width: 720px) { .catalog-block-wide { grid-column: auto; } }
/* Ajustes: bloque de tipos de producto (etiqueta editable + comportamiento). */
.ptype-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.ptype-row { display: flex; align-items: center; gap: 7px; }
.ptype-label { flex: 1; min-width: 0; padding: 6px 9px; }
.ptype-kind { flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.ptype-kind.sale { background: color-mix(in srgb, var(--accent, #0f6b5c) 14%, #fff); color: var(--accent, #0f6b5c); }
.ptype-kind.ingredient { background: #f3ede0; color: #8a6d1c; }
.ptype-row .ghost.sm { min-height: 0; padding: 6px 8px; }
.ptype-del { min-height: 0; width: 30px; height: 30px; padding: 0; border-radius: 8px; background: transparent; border: 1px solid var(--line); color: var(--warn, #b42318); display: inline-flex; align-items: center; justify-content: center; }
.ptype-lock { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--muted); }
.ptype-lock i, .ptype-del i { width: 15px; height: 15px; }
.ptype-add { display: flex; gap: 7px; }
.ptype-add input { flex: 1; min-width: 0; }
.ptype-add select { flex: none; max-width: 130px; }

/* Compras: miniaturas de recibos (fotos). */
.receipt-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.receipt-thumb { position: relative; display: inline-block; }
.receipt-thumb img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; transition: transform .12s; display: block; }
.receipt-thumb img:hover { transform: scale(1.05); border-color: var(--accent, #0f6b5c); }
.receipt-thumb .rc-del { position: absolute; top: -7px; right: -7px; width: 21px; height: 21px; min-height: 0; padding: 0; border-radius: 50%; background: #b91c1c; color: #fff; border: 2px solid #fff; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Inventario: franja de productos por vencer. */
.expiry-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid #f0d9a8; background: #fdf6e3; color: #7a5410; margin-bottom: 12px; font-size: 13.5px; }
.expiry-banner i { width: 18px; height: 18px; flex: none; }
.expiry-banner.danger { border-color: #f3c2c2; background: #fdf1f1; color: #8f1d1d; }
.expiry-banner button { margin-left: auto; white-space: nowrap; }

/* Modulo Mis negocios: barras de utilidad y tabla comparativa. */
.mb-range-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mb-bars { display: flex; flex-direction: column; gap: 10px; }
.mb-bar-row { display: grid; grid-template-columns: 200px 1fr 120px; align-items: center; gap: 12px; }
.mb-bar-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-bar-track { height: 22px; background: var(--panel-2, #f7f5ef); border-radius: 7px; overflow: hidden; }
.mb-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent, #0f6b5c), color-mix(in srgb, var(--accent, #0f6b5c) 60%, #4bbfa8)); border-radius: 7px; transition: width .5s cubic-bezier(.22,.61,.36,1); }
.mb-bar-fill.neg { background: linear-gradient(90deg, #b91c1c, #e07575); }
.mb-bar-val { font-family: var(--font-num); font-weight: 700; text-align: right; }
.mb-bar-val.neg { color: #b91c1c; }
.mb-current { background: color-mix(in srgb, var(--accent, #0f6b5c) 6%, transparent); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent, #0f6b5c); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }
@media (max-width: 640px) { .mb-bar-row { grid-template-columns: 110px 1fr 90px; gap: 7px; } .mb-bar-name { font-size: 12px; } }

/* Resumen en palabras del comparativo. */
.mb-summary { display: flex; align-items: flex-start; gap: 10px; background: color-mix(in srgb, var(--accent, #0f6b5c) 7%, var(--panel, #fff)); border: 1px solid color-mix(in srgb, var(--accent, #0f6b5c) 20%, transparent); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.mb-summary i { width: 18px; height: 18px; color: var(--accent, #0f6b5c); flex: none; margin-top: 2px; }
.mb-summary p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.mb-summary b { color: var(--accent, #0f6b5c); }

/* Selector de metrica del comparador de barras. */
.mb-mtabs { display: inline-flex; gap: 4px; background: var(--panel-2, #f7f5ef); border-radius: 10px; padding: 4px; margin: 4px 0 14px; flex-wrap: wrap; }
.mb-mtab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.mb-mtab i { width: 14px; height: 14px; }
.mb-mtab:hover { color: var(--text); }
.mb-mtab.on { background: var(--panel, #fff); color: var(--accent, #0f6b5c); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Podio de tarjetas por negocio. */
.mb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mb-card { display: flex; flex-direction: column; gap: 12px; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.mb-card.current { border-color: color-mix(in srgb, var(--accent, #0f6b5c) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #0f6b5c) 30%, transparent); }
.mb-card-top { display: flex; align-items: center; gap: 10px; }
.mb-rank { font-size: 24px; line-height: 1; }
.mb-card-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.mb-card-hero { display: flex; flex-direction: column; }
.mb-card-hero-val { font-family: var(--font-num); font-weight: 800; font-size: 24px; letter-spacing: -.5px; }
.mb-card-hero-lbl { font-size: 12px; color: var(--muted); }
.mb-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.mb-card-stats > div { display: flex; flex-direction: column; }
.mb-card-stats .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.mb-card-stats .v { font-family: var(--font-num); font-weight: 700; font-size: 15px; }
.mb-card-stats .v.pos { color: #166534; }
.mb-card-stats .v.neg { color: #b91c1c; }
.mb-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.mb-badge.rev { background: #dbeafe; color: #1e40af; }
.mb-badge.prof { background: #dcfce7; color: #166534; }
.mb-badge.marg { background: #fef3c7; color: #92400e; }
.mb-badge.tick { background: #f3e8ff; color: #6b21a8; }
.mb-card-go { align-self: flex-start; }
.mb-card-foot { margin-top: auto; }
.mb-details > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent, #0f6b5c); padding: 6px 0; }
@media (max-width: 480px) { .mb-cards { grid-template-columns: 1fr; } }

/* ===== Modulo oculto Cajas (Administrador financiero) ===== */
.fin-note { display: flex; align-items: flex-start; gap: 10px; background: color-mix(in srgb, #6b21a8 8%, var(--panel, #fff)); border: 1px solid color-mix(in srgb, #6b21a8 22%, transparent); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; color: var(--text); }
.fin-note i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #6b21a8; }
.caja-cai-status { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 10px 13px; margin-bottom: 14px; font-size: 13px; }
.caja-cai-status i { width: 17px; height: 17px; flex: none; }
.caja-cai-status.ok { background: #dcfce7; color: #166534; }
.caja-cai-status.off { background: #fef3c7; color: #92400e; }
.caja-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.caja-mode { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.caja-mode.on { border-color: var(--accent, #0f6b5c); background: color-mix(in srgb, var(--accent, #0f6b5c) 7%, var(--panel)); }
.caja-mode input { width: 17px; height: 17px; min-width: 17px; margin: 2px 0 0; padding: 0; accent-color: var(--accent, #0f6b5c); flex: 0 0 auto; }
.caja-mode > div { flex: 1 1 auto; min-width: 0; }
.caja-mode b { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.caja-mode b i { width: 14px; height: 14px; }
.caja-mode span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* Modo bloqueado que ve el administrador (no puede elegir CAI/normal). */
.caja-mode-locked { display: flex; gap: 9px; align-items: flex-start; border: 1px dashed var(--line); border-radius: 10px; padding: 11px 12px; background: color-mix(in srgb, var(--muted, #847d70) 6%, var(--panel)); }
.caja-mode-locked > i { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.caja-mode-locked b { display: block; font-size: 13px; }
.caja-mode-locked span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.caja-list { display: flex; flex-direction: column; gap: 8px; }
.caja-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.caja-item-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.caja-item-main > i { width: 18px; height: 18px; color: var(--accent, #0f6b5c); flex: none; }
.caja-item-main b { font-size: 14px; }
.caja-badge { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.caja-badge.cai { background: #ede9fe; color: #6b21a8; }
.caja-badge.normal { background: #eef1f5; color: #5b6472; }
.caja-item-actions { display: inline-flex; gap: 5px; flex: none; }
@media (max-width: 560px) { .caja-modes { grid-template-columns: 1fr; } }
/* Aviso del modo de facturacion de la caja en el POS */
.caja-pos-note { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 8px 11px; border-radius: 9px; margin-top: 8px; }
.caja-pos-note i { width: 15px; height: 15px; flex: none; }
.caja-pos-note.cai { background: #ede9fe; color: #6b21a8; }
.caja-pos-note.normal { background: #eef1f5; color: #5b6472; }
.caja-pos-note.off { background: #fef3c7; color: #92400e; }

/* ===== Modulo Cotizaciones ===== */
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex: 0 0 auto; }
.icon-btn:hover { color: var(--accent, #0f6b5c); border-color: var(--accent, #0f6b5c); }
.icon-btn.danger:hover { color: #c0392b; border-color: #c0392b; }
.icon-btn i { width: 16px; height: 16px; }
.quote-results { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.quote-result { display: grid; grid-template-columns: 1fr auto 34px; grid-template-areas: "name price plus" "meta price plus"; align-items: center; gap: 0 10px; text-align: left; background: var(--panel-2, #f7f5ef); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.quote-result:hover { border-color: var(--accent, #0f6b5c); background: color-mix(in srgb, var(--accent, #0f6b5c) 7%, var(--panel)); }
.quote-result .qr-name { grid-area: name; font-weight: 600; font-size: 14px; }
.quote-result .qr-meta { grid-area: meta; color: var(--muted); font-size: 12px; }
.quote-result .qr-price { grid-area: price; font-family: var(--font-num); font-weight: 700; font-size: 14px; }
.quote-result .qr-plus { grid-area: plus; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent, #0f6b5c); color: #fff; }
.quote-result .qr-plus i { width: 16px; height: 16px; }
.quote-line { display: grid; grid-template-columns: 1fr auto auto 34px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quote-line:last-child { border-bottom: none; }
.ql-info { min-width: 0; }
.ql-name { font-weight: 600; font-size: 14px; }
.ql-price { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; margin-top: 3px; }
.ql-price-input { width: 84px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-family: var(--font-num); }
.ql-stepper { display: flex; align-items: center; gap: 5px; }
.ql-stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2, #f7f5ef); font-size: 17px; font-weight: 700; cursor: pointer; color: var(--text); line-height: 1; }
.ql-stepper button:hover { border-color: var(--accent, #0f6b5c); color: var(--accent, #0f6b5c); }
.ql-stepper input { width: 44px; text-align: center; padding: 6px 2px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: var(--font-num); }
.ql-total { font-family: var(--font-num); font-weight: 700; font-size: 14px; text-align: right; min-width: 76px; }
.quote-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.quote-actions .primary, .quote-actions .ghost { justify-content: center; width: 100%; }
.quote-row-actions { display: flex; gap: 5px; justify-content: flex-end; align-items: center; }
.quote-bill-btn { color: var(--accent, #0f6b5c); border-color: color-mix(in srgb, var(--accent, #0f6b5c) 40%, var(--line)); font-weight: 700; white-space: nowrap; }
.quote-bill-btn i { width: 15px; height: 15px; }
/* Cabecera y layout del rediseno de cotizaciones (grid de productos + resumen) */
.quote-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.quote-summary-panel { align-self: flex-start; position: sticky; top: 12px; }
.quote-extra { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.quote-extra > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent, #0f6b5c); display: flex; align-items: center; gap: 7px; list-style: none; }
.quote-extra > summary::-webkit-details-marker { display: none; }
.quote-extra > summary i { width: 15px; height: 15px; }
@media (max-width: 900px) { .quote-summary-panel { position: static; } }
@media (max-width: 640px) { .quote-line { grid-template-columns: 1fr auto 34px; } .quote-line .ql-total { grid-column: 1 / -1; text-align: left; } }

/* Selector de negocio en el encabezado (multi-negocio). */
.biz-switch { position: relative; }
.biz-switch-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #847d70); }
.biz-switch-btn i { width: 13px; height: 13px; }
.biz-switch-btn:hover { color: var(--accent, #0f6b5c); }
.biz-switch-menu { position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 220px; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.16); z-index: 70; padding: 6px; }
.biz-switch-cap { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 4px; }
.biz-switch-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 8px 9px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 600; }
.biz-switch-item:hover { background: var(--panel-2, #f7f5ef); }
.biz-switch-item.on { color: var(--accent, #0f6b5c); }
.biz-switch-item i { width: 15px; height: 15px; }
.biz-switch-item .biz-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line2, #cfdbe4); margin: 0 4px; }
/* Casillas de acceso a negocios (crear/editar usuario). */
.biz-access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 7px; margin-top: 4px; }
.biz-access { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; background: var(--panel-2, #f7f5ef); }
.biz-access input { width: 16px; height: 16px; flex: none; accent-color: var(--accent, #0f6b5c); }
.biz-access:has(input:checked) { border-color: var(--accent, #0f6b5c); background: color-mix(in srgb, var(--accent, #0f6b5c) 8%, var(--panel, #fff)); color: var(--accent, #0f6b5c); }
.biz-access:has(input:disabled) { opacity: .85; cursor: default; }

/* Campana de alertas inteligentes (topbar). */
.alert-bell { position: relative; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 12px; background: var(--panel, #fff); border: 1px solid var(--line); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.alert-bell i { width: 19px; height: 19px; }
.alert-bell.urgent { border-color: #b91c1c; color: #b91c1c; animation: bellPulse 2.4s ease-in-out infinite; }
@keyframes bellPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .25); } 50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); } }
.alert-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border-radius: 10px; background: #b91c1c; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.alert-panel { position: fixed; top: 74px; right: 18px; width: min(440px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.18); z-index: 60; padding: 12px; }
.alert-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; gap: 10px; padding: 9px 11px; border-radius: 11px; background: var(--panel-2, #f7f5ef); border-left: 4px solid var(--line); }
.alert-item i { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--muted); }
.alert-item p { margin: 2px 0 0; font-size: 12.5px; color: var(--soft, #4a463d); line-height: 1.45; }
.alert-item.sev-alta { border-left-color: #b91c1c; }
.alert-item.sev-alta i { color: #b91c1c; }
.alert-item.sev-media { border-left-color: #b45309; }
.alert-item.sev-media i { color: #b45309; }
.alert-item.sev-baja { border-left-color: #166534; }
.alert-item.sev-baja i { color: #166534; }
.alert-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 13.5px; }
.alert-foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Compras: buscador de productos, simulador y filas anuladas. */
.pc-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); display: flex; flex-direction: column; gap: 4px; padding: 6px; max-height: 320px; overflow-y: auto; }
.pc-results button { text-align: left; background: var(--panel-2, #f7f5ef); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; min-height: 0; color: var(--text); }
.pc-results button:hover { border-color: var(--accent, #0f6b5c); background: var(--panel, #fff); }
.prod-row.voided { opacity: .55; }
.sim-result { margin-top: 10px; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.sim-grid > div { background: var(--panel-2, #f7f5ef); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sim-grid span { font-size: 11px; color: var(--muted, #847d70); text-transform: uppercase; letter-spacing: .03em; }

/* Permisos: paneles compactos por seccion del menu (Operaciones, Comercial...),
   acomodados lado a lado; dentro, cada modulo es una fila con su checkbox y sus
   submodulos desplegables. Ocupa mucho menos espacio que tarjetas sueltas. */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2, #f7f5ef); padding: 8px 10px; }
.perm-group-title { display: flex; align-items: center; gap: 7px; padding: 2px 4px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #847d70); border-bottom: 1px solid var(--line); margin-bottom: 4px; cursor: pointer; user-select: none; }
.perm-group-title input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--accent, #0f6b5c); }
.perm-group-title i { width: 13px; height: 13px; opacity: .8; }
.perm-mod-icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted, #847d70); }
.perm-card.on .perm-mod-icon { color: var(--accent, #0f6b5c); }
.perm-grid { display: flex; flex-direction: column; gap: 1px; }
.perm-card { border-radius: 8px; padding: 3px 4px; transition: background .12s; }
.perm-card.on .perm-check strong { color: var(--accent, #0f6b5c); }
.perm-head { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.perm-head:hover { background: color-mix(in srgb, var(--text, #1d1b16) 4%, transparent); border-radius: 7px; }
.perm-check { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 2px 4px; }
.perm-check input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent, #0f6b5c); }
.perm-check strong { font-weight: 600; }
.perm-exp { flex: 0 0 auto; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 7px; background: transparent; border: 0; color: var(--muted, #847d70); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.perm-exp:hover { background: color-mix(in srgb, var(--text, #1d1b16) 7%, transparent); }
.perm-exp i { width: 15px; height: 15px; transition: transform .2s ease; }
.perm-card.open .perm-exp i { transform: rotate(180deg); }
.perm-items { display: none; flex-direction: column; gap: 3px; margin: 2px 0 4px 14px; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.perm-card.open .perm-items { display: flex; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--soft, #4a463d); cursor: pointer; padding: 1px 2px; }
.perm-item input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--accent, #0f6b5c); }


/* Ventana flotante de la app (crear usuario / rol / administrar roles). */
.app-modal { width: min(760px, 94vw); max-height: 90vh; border: 0; border-radius: 18px; padding: 0; background: var(--panel); box-shadow: var(--shadow); color: var(--text); overflow: hidden; }
.app-modal::backdrop { background: rgba(31, 27, 20, .45); backdrop-filter: blur(3px); }
.app-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.app-modal-head strong { font-family: var(--font-display); font-size: 18px; }
.app-modal-head .ghost { width: 38px; min-height: 38px; padding: 0; }
#appModalBody { padding: 18px; overflow: auto; max-height: calc(90vh - 62px); }
/* Acordeon por rol en "Administrar roles". */
.perm-role { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.perm-role-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; background: var(--panel-2); user-select: none; }
.perm-role-head strong { flex: 1; }
.perm-role-exp { transition: transform .2s ease; color: var(--muted); }
.perm-role.open .perm-role-exp { transform: rotate(180deg); }
.role-del { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 8px; background: transparent; border: 1px solid var(--line); color: var(--warn); display: inline-flex; align-items: center; justify-content: center; }
.perm-role-body { display: none; padding: 14px; }
.perm-role.open .perm-role-body { display: block; }

/* Listas y catalogos: titulo con icono de ayuda (?) y globo flotante. */
.catalog-block .catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.catalog-block .catalog-head h3 { margin: 0; }
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--muted, #847d70); cursor: help; outline: none; }
.help-tip i { width: 17px; height: 17px; }
.help-tip:hover, .help-tip:focus-visible { color: var(--accent, #0f6b5c); }
.help-bubble {
  position: absolute; top: calc(100% + 7px); right: 0; width: 230px;
  background: var(--text, #1d1b16); color: #fff; font-size: 12px; font-weight: 500;
  line-height: 1.45; text-align: left; padding: 9px 11px; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28); z-index: 30;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease;
}
.help-bubble::after { content: ""; position: absolute; bottom: 100%; right: 6px; border: 6px solid transparent; border-bottom-color: var(--text, #1d1b16); }
.help-tip:hover .help-bubble, .help-tip:focus .help-bubble, .help-tip:focus-within .help-bubble { opacity: 1; visibility: visible; transform: translateY(0); }

/* Modal de detalles del negocio mas grande (tiene muchas secciones). */
.m-modal-lg .m-modal-card { width: min(920px, 96vw); }

/* Branding por negocio: logo en login y en el recibo. */
#loginLogo { max-width: 160px; max-height: 90px; object-fit: contain; margin: 0 auto 4px; display: block; }
.receipt-logo { max-width: 150px; max-height: 70px; object-fit: contain; display: block; margin: 0 auto 6px; }

/* Cobros: filas expandibles con el ciclo de facturacion. */
.billing-row { cursor: pointer; }
.billing-row:hover { background: var(--panel-2, #f3efe6); }
.bill-caret { transition: transform .15s ease; width: 18px; height: 18px; color: var(--muted); }
.billing-detail > td { background: var(--panel-2, #f7f4ec); padding: 14px 16px; }
.billing-panel { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.billing-panel .bill-kpis { display: flex; gap: 24px; flex-wrap: wrap; }
.billing-panel .row { flex-wrap: wrap; gap: 8px; align-items: center; }
.pay-history { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pay-history .pay-row { display: flex; gap: 10px; align-items: baseline; }

/* Bitacora del negocio (panel maestro). */
.events-box { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.event-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px dashed var(--line, #e7e2d6); }
.event-row i { width: 15px; height: 15px; color: var(--brand, #0f6b5c); flex: none; }
.event-row .event-when { color: var(--muted, #847d70); min-width: 96px; font-variant-numeric: tabular-nums; }

/* Cobranza pendiente (tablero del master): info a la izquierda, acciones a la derecha. */
.cob-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 4px; border-radius: 10px; transition: background-color .14s ease; }
.cob-row:hover { background: var(--panel-2); }
.cob-row + .cob-row { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.cob-info { min-width: 0; flex: 1 1 240px; }
.cob-info strong { font-size: 14px; display: block; }
.cob-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.cob-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* Reportes: pestañas por grupo (Ventas, Caja, Inventario, ...). */
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line, #e7e2d6); padding-bottom: 0; }
.report-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted, #847d70); font-weight: 600; font-size: 14px; padding: 9px 14px; cursor: pointer; border-radius: 8px 8px 0 0; transition: color .14s, background-color .14s, border-color .14s; }
.report-tab:hover { color: var(--text, #1d1b16); background: var(--panel-2, #f3efe6); }
.report-tab.active { color: var(--accent, #0f6b5c); border-bottom-color: var(--accent, #0f6b5c); }

/* Reportes: etiqueta del rango de fechas (Desde / Hasta). */
.report-range { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; }
.report-range > span { font-size: 12.5px; font-weight: 600; color: var(--muted, #847d70); letter-spacing: .02em; white-space: nowrap; }


/* Master: funciones personalizadas por negocio (interruptores). */
.features-box { display: flex; flex-direction: column; gap: 8px; }
.feature-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line, #e7e2d6); border-radius: 10px; cursor: pointer; }
.feature-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }

/* Cajas de facturacion en el detalle del negocio (Panel Maestro). */
.cajas-box { display: flex; flex-direction: column; gap: 8px; }
.cajas-list { display: flex; flex-direction: column; gap: 8px; }
.caja-row { display: flex; align-items: center; gap: 8px; }
.caja-row .caja-name { flex: 1 1 auto; min-width: 0; }
.caja-row .caja-mode { flex: 0 0 auto; width: 140px; }
.caja-row .caja-del { flex: 0 0 auto; padding: 8px; color: #b91c1c; }
.cajas-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* Detalle del negocio: Exportar e Importar van juntos (estan relacionados). */
.m-action-group { display: inline-flex; gap: 4px; padding: 3px; border: 1px dashed var(--line, #e7e2d6); border-radius: 11px; }


/* --- Cierre de caja: resumen del dia con impresion/PDF --- */
.cash-close { display: flex; flex-direction: column; gap: 14px; }
.cash-close .cc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cash-close .cc-kpi { background: var(--panel2, #f7f5ef); border: 1px solid var(--line, #e7e2d6); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cash-close .cc-kpi span { font-size: 11px; color: var(--muted, #847d70); text-transform: uppercase; letter-spacing: .03em; }
.cash-close .cc-kpi strong { font-size: 18px; color: var(--text, #1d1b16); }
.cash-close .cc-kpi.cc-ok { border-color: #16653455; }
.cash-close .cc-kpi.cc-ok strong { color: #166534; }
.cash-close .cc-kpi.cc-low { border-color: #b91c1c55; }
.cash-close .cc-kpi.cc-low strong { color: #b91c1c; }
.cash-close .cc-kpi.cc-warn { border-color: #b4530955; }
.cash-close .cc-kpi.cc-warn strong { color: #b45309; }
.cash-close .cc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cash-close .cc-block { border: 1px solid var(--line, #e7e2d6); border-radius: 12px; padding: 10px 12px; }
.cash-close .cc-block h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--brand, #0f6b5c); }
.cash-close .cc-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line, #eee); }
.cash-close .cc-row:last-child { border-bottom: 0; }
.cash-close .cc-row.muted span { color: var(--muted, #847d70); }
.cash-close .cc-row.cc-total { font-weight: 700; border-top: 2px solid var(--brand, #0f6b5c); border-bottom: 0; margin-top: 2px; padding-top: 8px; }
.cash-close .cc-arqueo { background: var(--panel2, #f7f5ef); border-radius: 12px; padding: 8px 14px; }
.cash-close .cc-arqueo .cc-row { border-bottom: 1px dashed var(--line, #e7e2d6); }
.cash-close .cc-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 640px) {
  .cash-close .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-close .cc-cols { grid-template-columns: 1fr; }
  .cash-close .cc-actions { justify-content: stretch; }
  .cash-close .cc-actions button { flex: 1; justify-content: center; }
}

/* --- Graficas de reportes: linea SVG, pastel con % y barras con % --- */
.bar-pct { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted, #847d70); font-style: normal; margin-top: 1px; }
.report-chart.line-chart { width: 100%; background: var(--panel2, #f7f5ef); border: 1px solid var(--line, #e7e2d6); border-radius: 14px; padding: 10px 12px; }
.report-chart.line-chart svg { width: 100%; height: auto; display: block; }
.report-chart.line-chart .lc-grid { stroke: color-mix(in srgb, var(--text, #1d1b16) 10%, transparent); stroke-width: 1; stroke-dasharray: 3 4; }
.report-chart.line-chart .lc-ytick { fill: var(--muted, #847d70); font-size: 10px; text-anchor: end; font-variant-numeric: tabular-nums; }
.report-chart.line-chart .lc-xtick { fill: var(--muted, #847d70); font-size: 10px; text-anchor: middle; }
.report-chart.line-chart .lc-dot { fill: #fff; stroke: var(--brand, #0f6b5c); stroke-width: 2; }
.pie-layout .pie-wrap { display: flex; align-items: center; justify-content: center; }
.pie-layout .pie-chart { max-width: 210px; box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--panel, #fff) 80%, transparent); }
.pie-legend { display: flex; flex-direction: column; gap: 4px; }
.pie-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line, #eee); font-size: 13px; }
.pie-item:last-child { border-bottom: 0; }
.pie-item .pie-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.pie-item .pie-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-item .pie-pct { color: var(--muted, #847d70); font-variant-numeric: tabular-nums; font-size: 12px; }
.pie-item strong { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .pie-layout { grid-template-columns: 1fr; }
  .pie-layout .pie-wrap .pie-chart { max-width: 170px; margin: 0 auto; }
  .bar { grid-template-columns: 96px 1fr 84px; gap: 8px; }
}

/* ============================================================
   Panel Maestro: chips tintados + responsive (telefonos) + estetica
   (styles.css es compartido; estos ajustes mejoran ambas apps)
   ============================================================ */

/* Chips de estado con fondo tintado derivado de su propio color (currentColor).
   STATUS_CHIP fija el color inline; el fondo/borde se tintan solos. */
.status {
  background: color-mix(in srgb, currentColor 13%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-radius: 999px;
}

/* KPIs a 2 columnas en telefono (evita columna unica larguisima con 6 metricas) */
@media (max-width: 680px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-detail-kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .metric strong { font-size: 20px; }
}

/* Tablas densas: scroll horizontal contenido (la pagina nunca desborda) con inercia */
.table-wrap { -webkit-overflow-scrolling: touch; }
@media (max-width: 680px) {
  .table-wrap table { min-width: 560px; }
  .table-wrap { border-radius: 12px; }
  /* Sombras de scroll (patron Lea Verou): avisan que la tabla se desliza a los lados
     en el telefono. La sombra derecha aparece cuando hay columnas ocultas y desaparece
     al llegar al final; las celdas son transparentes, asi que se ven sobre el contenido. */
  .table-wrap {
    background-color: var(--panel, #fff);
    background-image:
      linear-gradient(to right, var(--panel, #fff) 30%, rgba(255,255,255,0)),
      linear-gradient(to left, var(--panel, #fff) 30%, rgba(255,255,255,0)),
      radial-gradient(farthest-side at 0 50%, rgba(15,107,92,.22), rgba(15,107,92,0)),
      radial-gradient(farthest-side at 100% 50%, rgba(15,107,92,.22), rgba(15,107,92,0));
    background-position: left center, right center, left center, right center;
    background-size: 34px 100%, 34px 100%, 16px 100%, 16px 100%;
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
}

/* Modales del master: en telefono ocupan casi toda la pantalla, sin padding que ahogue */
@media (max-width: 680px) {
  .m-modal { padding: 10px; align-items: flex-start; }
  .m-modal-card { width: 100%; max-height: 92vh; padding: 16px; }
  .m-modal-lg .m-modal-card { width: 100%; }
  .m-modal-head h2 { font-size: 18px; }
  .toolbar { gap: 8px; }
  .toolbar > input, .toolbar > select { width: 100%; min-width: 0; }
}

/* Cuotas (billing): mini-tarjetas para los KPIs en vez de lista plana */
.billing-panel .bill-kpis { gap: 10px; }
.billing-panel .bill-kpis > * { background: var(--panel2, #f7f5ef); border: 1px solid var(--line, #e7e2d6); border-radius: 10px; padding: 8px 12px; }
@media (max-width: 640px) {
  .cob-row { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Panel Maestro · Cobros: bloque de cobro simplificado (un solo Guardar)
   ============================================================ */
.billing-panel { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px; }
.bill-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.bill-summary .bs-item { flex: 1; min-width: 120px; background: var(--panel2, #f7f5ef); border: 1px solid var(--line, #e7e2d6); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.bill-summary .bs-item span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #847d70); font-weight: 700; }
.bill-summary .bs-item b { font-size: 16px; }
.bill-summary .bs-item b.num { font-family: var(--font-num); }
.bill-pay { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bill-pay .primary { font-size: 15px; padding: 12px 20px; }
.bill-config { background: var(--card, #fff); border: 1px solid var(--line, #e7e2d6); border-radius: 14px; padding: 16px; }
.bill-config .bc-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.bc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bc-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted, #847d70); text-transform: none; letter-spacing: 0; }
.bc-grid input, .bc-grid select { font-family: inherit; }
.bc-grid .money-field { margin: 0; }
.bc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.bc-actions .bc-hint { flex: 1; min-width: 180px; }
.primary-soft { background: color-mix(in srgb, var(--brand, #0f6b5c) 12%, #fff); color: var(--brand, #0f6b5c); border: 1px solid color-mix(in srgb, var(--brand, #0f6b5c) 35%, transparent); border-radius: 10px; padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .14s; }
.primary-soft:hover { background: color-mix(in srgb, var(--brand, #0f6b5c) 20%, #fff); }
.bill-history { border-top: 1px dashed var(--line, #e7e2d6); padding-top: 10px; }
@media (max-width: 720px) { .bc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .bc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Panel Maestro · Navegacion siempre visible (secciones expandidas)
   ============================================================ */
/* Lista de negocios: badge de cadena (matriz / sucursal). */
.chain-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; vertical-align: middle; white-space: nowrap; }
.chain-badge i { width: 12px; height: 12px; }
.chain-badge.matriz { background: color-mix(in srgb, var(--accent, #0f6b5c) 15%, #fff); color: var(--accent, #0f6b5c); }
.chain-badge.sucursal { background: #eef2f7; color: #4a6274; }
.chain-filter { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted, #847d70); cursor: pointer; white-space: nowrap; }
.chain-filter input { width: 16px; height: 16px; accent-color: var(--accent, #0f6b5c); }

/* Acordeon de cadenas en el Panel Maestro (viewBusinesses) */
.biz-section-title { font-size: 15px; margin: 18px 0 10px; display: flex; align-items: center; gap: 7px; }
.biz-section-title i { width: 17px; height: 17px; }
.biz-section-title .muted { color: var(--muted, #847d70); font-weight: 400; }
#chainList { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.chain-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel, #fff); }
.chain-block.open { border-color: color-mix(in srgb, var(--accent, #0f6b5c) 40%, var(--line)); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.chain-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.chain-head:hover { background: var(--panel-2, #f7f5ef); }
.chain-chevron { flex: none; display: inline-flex; transition: transform .18s ease; color: var(--muted, #847d70); }
.chain-block.open .chain-chevron { transform: rotate(90deg); }
.chain-chevron i { width: 18px; height: 18px; }
.chain-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; flex: 1; min-width: 0; }
.chain-title > i { width: 16px; height: 16px; color: var(--accent, #0f6b5c); flex: none; }
.chain-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-count { font-size: 12px; font-weight: 600; color: var(--muted, #847d70); background: var(--panel-2, #f7f5ef); border-radius: 999px; padding: 2px 9px; flex: none; }
.chain-summary { display: inline-flex; gap: 6px; flex-wrap: wrap; flex: none; }
.chain-summary .status { font-size: 11px; }
.chain-body { border-top: 1px solid var(--line); overflow-x: auto; }
.chain-body table { width: 100%; }
@media (max-width: 760px) { .chain-summary { display: none; } }
/* Crear negocio: eleccion desde cero / copiar de existente. */
.start-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.start-opt { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: var(--panel-2, #f7f5ef); transition: border-color .15s, background .15s; }
.start-opt input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--accent, #0f6b5c); }
.start-opt i { width: 18px; height: 18px; color: var(--accent, #0f6b5c); }
.start-opt strong { display: block; font-size: 14px; margin: 1px 0 2px; }
.start-opt span { display: block; font-size: 12px; color: var(--muted, #847d70); line-height: 1.4; }
.start-opt > div { display: flex; flex-direction: column; }
.start-opt > div i { margin-bottom: 3px; }
.start-opt:has(input:checked) { border-color: var(--accent, #0f6b5c); background: color-mix(in srgb, var(--accent, #0f6b5c) 7%, var(--panel, #fff)); }
.start-opt.disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 620px) { .start-choice { grid-template-columns: 1fr; } }
.nav-section { margin-top: 14px; }
.nav-section:first-of-type { margin-top: 8px; }
/* Atajo destacado al pie del menu maestro (crear negocio). */
.nav-help { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: color-mix(in srgb, var(--accent, #0f6b5c) 8%, var(--panel, #fff)); border: 1px solid color-mix(in srgb, var(--accent, #0f6b5c) 25%, var(--line)); border-radius: 12px; padding: 11px 13px; cursor: pointer; color: var(--text); transition: border-color .15s, background .15s; }
.nav-help:hover { border-color: var(--accent, #0f6b5c); background: color-mix(in srgb, var(--accent, #0f6b5c) 13%, var(--panel, #fff)); }
.nav-help i { width: 22px; height: 22px; color: var(--accent, #0f6b5c); flex: none; }
.nav-help strong { display: block; font-size: 13.5px; }
.nav-help span { display: block; font-size: 11.5px; color: var(--muted, #847d70); }
.nav-section-title { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #847d70); }
.nav-section-title i { width: 14px; height: 14px; opacity: .8; }
.nav-section .nav-button { width: 100%; }
/* Menu colapsado: ocultar los titulos de seccion (quedarian como iconos sueltos
   mezclados con los items) y separar cada grupo con una linea sutil. */
body.sidebar-collapsed .nav-section-title { display: none; }
body.sidebar-collapsed .nav-section { margin-top: 0; padding-top: 8px; border-top: 1px solid var(--line, #e7e2d6); }
body.sidebar-collapsed .nav-section:first-of-type { border-top: 0; padding-top: 4px; }
body.sidebar-collapsed .nav-help { display: none; }

/* --- Facturacion con CAI (config fiscal + estado) --- */
.fiscal-status { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.fiscal-status i { width: 17px; height: 17px; flex: none; }
.fiscal-status.fs-ok { background: color-mix(in srgb, #166534 12%, #fff); color: #166534; border: 1px solid color-mix(in srgb, #166534 28%, transparent); }
.fiscal-status.fs-warn { background: color-mix(in srgb, #b45309 12%, #fff); color: #b45309; border: 1px solid color-mix(in srgb, #b45309 28%, transparent); }
.fiscal-status.fs-bad { background: color-mix(in srgb, #b91c1c 12%, #fff); color: #b91c1c; border: 1px solid color-mix(in srgb, #b91c1c 28%, transparent); }
.fiscal-status.fs-off { background: var(--panel2, #f7f5ef); color: var(--muted, #847d70); border: 1px solid var(--line, #e7e2d6); }
.fiscal-toggle { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; padding: 4px 0 6px; cursor: pointer; }
.fiscal-toggle input { width: 17px; height: 17px; }
.fiscal-warn-inline { color: #b45309; font-size: 12px; font-weight: 600; display: block; margin-top: 2px; }
.fiscal-check-off { opacity: .8; cursor: not-allowed; }
.fiscal-check-off input { cursor: not-allowed; }
.receipt-fiscal-foot { font-size: 11px; text-align: center; color: var(--text, #1d1b16); }
.receipt-fiscal-foot p { margin: 2px 0; }
.receipt-fiscal-foot .receipt-letras { font-weight: 700; }
.receipt-fiscal-foot .receipt-legal { font-style: italic; margin-top: 6px; }

/* --- Onboarding / primeros pasos del negocio nuevo --- */
.onboard { background: linear-gradient(135deg, color-mix(in srgb, var(--brand, #0f6b5c) 8%, #fff), var(--card, #fff)); border: 1px solid color-mix(in srgb, var(--brand, #0f6b5c) 22%, var(--line, #e7e2d6)); border-radius: 18px; padding: 20px 22px; margin-bottom: 16px; }
.onboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.onboard-head h2 { margin: 2px 0 4px; font-family: var(--font-display); }
.onboard-head .eyebrow { color: var(--brand, #0f6b5c); }
.onboard-steps { display: grid; gap: 8px; }
.onboard-step { display: flex; align-items: center; gap: 12px; background: var(--card, #fff); border: 1px solid var(--line, #e7e2d6); border-radius: 12px; padding: 10px 14px; }
.onboard-step .os-check { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--panel2, #f7f5ef); color: var(--muted, #847d70); border: 1px solid var(--line, #e7e2d6); }
.onboard-step .os-check i { width: 15px; height: 15px; }
.onboard-step.done .os-check { background: var(--brand, #0f6b5c); color: #fff; border-color: var(--brand, #0f6b5c); }
.onboard-step .os-label { flex: 1; font-weight: 600; }
.onboard-step.done .os-label { color: var(--muted, #847d70); text-decoration: line-through; }
.onboard-step .os-done { color: #166534; font-weight: 700; font-size: 13px; }
@media (max-width: 640px) { .onboard-head .primary { width: 100%; justify-content: center; } .onboard-step { flex-wrap: wrap; } }
.link-button { background: none; border: 0; color: var(--brand, #0f6b5c); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; margin-top: 2px; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--brand-2, #0c5447); }

/* --- Animaciones de entrada de las gráficas de reportes --- */
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lc-draw { to { stroke-dashoffset: 0; } }
@keyframes lc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pie-in { from { transform: scale(.6) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dot-pop { from { transform: scale(0); } to { transform: scale(1); } }
.bar-chart .bar-fill { transform-origin: left center; animation: bar-grow .7s cubic-bezier(.2,.8,.2,1) both; }
.bar-chart .bar:nth-child(2) .bar-fill { animation-delay: .05s; }
.bar-chart .bar:nth-child(3) .bar-fill { animation-delay: .1s; }
.bar-chart .bar:nth-child(4) .bar-fill { animation-delay: .15s; }
.bar-chart .bar:nth-child(5) .bar-fill { animation-delay: .2s; }
.bar-chart .bar:nth-child(n+6) .bar-fill { animation-delay: .25s; }
.report-chart.line-chart path[stroke] { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: lc-draw 1.3s ease forwards; }
.report-chart.line-chart path[fill^="url"] { animation: lc-fade 1.1s ease .3s both; }
.report-chart.line-chart .lc-dot { animation: dot-pop .3s ease both; transform-origin: center; }
.report-chart.pie-layout .pie-chart { animation: pie-in .6s cubic-bezier(.2,.9,.3,1.2) both; }
@media (prefers-reduced-motion: reduce) { .bar-chart .bar-fill, .report-chart.line-chart path[stroke], .report-chart.line-chart path[fill^="url"], .report-chart.line-chart .lc-dot, .report-chart.pie-layout .pie-chart { animation: none !important; stroke-dashoffset: 0 !important; } }

/* Descuentos: config en Ajustes + botones rapidos en el POS */
.disc-presets { display: flex; flex-direction: column; gap: 8px; }
.disc-preset-row { display: flex; gap: 8px; align-items: center; }
.disc-preset-row input[name^="preset_label_"] { flex: 1; }
.disc-pct { display: flex; align-items: center; gap: 4px; }
.disc-pct input { width: 80px; }
.disc-pct span { color: var(--muted); font-weight: 600; }
.disc-preset-row .icon-btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex: 0 0 auto; }
.disc-preset-row .icon-btn:hover { color: #c0392b; border-color: #c0392b; }
.disc-preset-row .icon-btn i { width: 16px; height: 16px; }
.disc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.disc-chip { border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.disc-chip:hover { border-color: var(--brand); }
.disc-chip-clear { color: var(--muted); }
.discount-reason { margin: 4px 0 2px; }

/* ===== Pedidos en linea / encargos (catalogo virtual + notificaciones) ===== */
.order-link-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.order-link-box.muted-box { opacity: .6; }
.order-link-box > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.order-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-link-row input { flex: 1; min-width: 180px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: var(--panel); font-family: "JetBrains Mono", monospace; }
.order-link-row button { white-space: nowrap; }
.count-pill { display: inline-block; background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 9px; margin-left: 4px; vertical-align: middle; }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 600; cursor: pointer; font-size: 12px; }

.preorder-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.preorder-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; transition: box-shadow .3s ease; border-left: 4px solid var(--line); }
.preorder-card.st-pendiente { border-left-color: #e0a800; }
.preorder-card.st-confirmado { border-left-color: #2b7de9; }
.preorder-card.st-listo { border-left-color: #0f6b5c; }
.preorder-card.st-entregado { border-left-color: #7a8; opacity: .72; }
.preorder-card.st-cancelado { border-left-color: #c0392b; opacity: .62; }
.preorder-card.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
.preorder-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.preorder-top strong { font-size: 15px; }
.preorder-code { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); margin-left: 6px; }
.preorder-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: color-mix(in srgb, currentColor 14%, var(--panel)); }
.preorder-badge.st-pendiente { color: #a67c00; }
.preorder-badge.st-confirmado { color: #2b7de9; }
.preorder-badge.st-listo { color: #0f6b5c; }
.preorder-badge.st-entregado { color: #5a7; }
.preorder-badge.st-cancelado { color: #c0392b; }
.preorder-reserved { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: 12px; font-weight: 700; color: #0f6b5c; background: color-mix(in srgb, #0f6b5c 10%, var(--panel)); border: 1px solid color-mix(in srgb, #0f6b5c 25%, transparent); border-radius: 7px; padding: 3px 9px; }
.preorder-reserved i { width: 14px; height: 14px; }
.preorder-contact { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.preorder-contact i { width: 14px; height: 14px; vertical-align: -2px; }
.wa-link { color: #128c7e; font-weight: 600; text-decoration: none; }
.preorder-note { margin: 0; font-style: italic; color: var(--text); font-size: 13px; }
.preorder-lines { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.pl-row { display: flex; justify-content: space-between; font-size: 13px; }
.pl-row b { font-family: "JetBrains Mono", monospace; }
.pl-row.pl-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; font-weight: 700; }
.preorder-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.preorder-actions button { font-size: 12px; padding: 7px 11px; }
.preorder-actions button.danger { color: #c0392b; }

/* Notificaciones (campana) tipo encargo */
.alert-item.notif { cursor: pointer; }
.alert-item.notif:hover { background: var(--panel2); }
.alert-item.notif.unread { background: color-mix(in srgb, var(--brand) 8%, var(--panel)); }
.alert-item.notif.unread strong::before { content: "● "; color: var(--brand); font-size: 10px; vertical-align: 2px; }

/* ===== Cambio de negocio en el menu lateral (junto al nombre) ===== */
.brand-name { min-width: 0; }
.brand-switch-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2, #f7f5ef); color: var(--muted); cursor: pointer; padding: 0; }
.brand-switch-btn:hover { color: var(--accent, #0f6b5c); border-color: var(--accent, #0f6b5c); }
.brand-switch-btn i { width: 16px; height: 16px; }
body.sidebar-collapsed .brand-switch-btn { display: none; }
.brand-switch-menu { position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,.18); z-index: 80; padding: 6px; max-height: 60vh; overflow: auto; }
.brand-switch-cap { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 4px; }
.brand-switch-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 9px 9px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 600; }
.brand-switch-item:hover { background: var(--panel-2, #f7f5ef); }
.brand-switch-item.on { color: var(--accent, #0f6b5c); }
.brand-switch-item i { width: 15px; height: 15px; }
.brand-switch-item .biz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }

/* ===== Mis negocios: pestañas y comparacion por producto ===== */
.mb-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.mb-tab { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.mb-tab i { width: 15px; height: 15px; }
.mb-tab:hover { color: var(--text); }
.mb-tab.on { color: var(--accent, #0f6b5c); border-bottom-color: var(--accent, #0f6b5c); }
.mb-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mb-top-list { list-style: none; margin: 0; padding: 0; counter-reset: mbt; }
.mb-top-list li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.mb-top-list li:last-child { border-bottom: none; }
.mb-top-list li::before { counter-increment: mbt; content: counter(mbt); color: var(--muted); font-weight: 700; font-size: 12px; min-width: 16px; }
.mb-top-name { flex: 1; }
.mb-top-meta { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.mb-top-meta b { color: var(--text); font-family: "JetBrains Mono", monospace; }

/* ===== Pedidos en linea: switch en encabezado + gestion de enlaces ===== */
.ot-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hdr-switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.hdr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.hdr-switch-track { width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s ease; flex: 0 0 auto; }
.hdr-switch-knob { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.hdr-switch.on .hdr-switch-track { background: var(--accent, #0f6b5c); }
.hdr-switch.on .hdr-switch-knob { transform: translateX(17px); }
.hdr-switch-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hdr-switch.on .hdr-switch-label { color: var(--accent, #0f6b5c); }
.order-link-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.order-link-actions i { width: 13px; height: 13px; vertical-align: -2px; }
.link-history { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.link-hist-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.link-hist-row .lh-name { flex: 1; font-weight: 600; }
.link-hist-row .lh-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.link-hist-row.active .lh-status { color: var(--accent, #0f6b5c); }
.link-hist-row.revoked { opacity: .6; }
.link-hist-row.revoked .lh-status { color: #c0392b; }
.link-btn.danger { color: #c0392b; }

/* Aviso de pausa y bloqueo de generacion de enlaces */
.online-paused-note { display: flex; align-items: flex-start; gap: 10px; background: #fdf6e3; border: 1px solid #e6d3a3; border-radius: 12px; padding: 11px 14px; margin: 12px 0; font-size: 13.5px; color: #7a5b13; }
.online-paused-note i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #b45309; }
.online-paused-note b { color: #8a4b0a; }
.link-disabled-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 4px 0 2px; }
.link-disabled-note i { width: 15px; height: 15px; }
.link-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.link-summary-counts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lk-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.lk-chip.active { background: color-mix(in srgb, var(--accent, #0f6b5c) 14%, transparent); color: var(--accent, #0f6b5c); }
.lk-chip.used { background: #eef1f5; color: #5b6472; }
.lk-chip.revoked { background: #fdecea; color: #c0392b; }

/* Mini-lista de enlaces activos (visible directo, sin abrir el modal) */
.active-links-inline { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.ali-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 6px; }
.ali-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ali-row:last-child { border-bottom: none; }
.ali-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ali-actions { display: inline-flex; gap: 5px; }
@media (max-width: 560px) { .ali-row { grid-template-columns: 1fr auto; } .ali-when { display: none; } }

/* ===== Gestor de enlaces (ventana flotante) ===== */
.lk-mgr .lk-tabs { display: flex; gap: 4px; background: var(--panel-2, #f7f5ef); border-radius: 10px; padding: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.lk-tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.lk-tab:hover { color: var(--text); }
.lk-tab.on { background: var(--panel, #fff); color: var(--accent, #0f6b5c); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.lk-tab-n { font-family: var(--font-num); font-size: 11px; background: color-mix(in srgb, currentColor 14%, transparent); border-radius: 999px; padding: 1px 7px; }
.lk-mgr .search { margin-bottom: 10px; }
.lk-list { display: flex; flex-direction: column; max-height: 52vh; overflow: auto; }
.lk-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.lk-row:last-child { border-bottom: none; }
.lk-row.st-revocado { opacity: .62; }
.lk-row-main { min-width: 0; }
.lk-row-name { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-row-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.lk-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lk-badge.activo { background: color-mix(in srgb, var(--accent, #0f6b5c) 14%, transparent); color: var(--accent, #0f6b5c); }
.lk-badge.usado { background: #eef1f5; color: #5b6472; }
.lk-badge.revocado { background: #fdecea; color: #c0392b; }
.lk-row-actions { display: inline-flex; gap: 5px; }
.icon-btn.warn:hover { color: #b45309; border-color: #b45309; }
@media (max-width: 560px) { .lk-row { grid-template-columns: 1fr auto; } .lk-row-actions { grid-column: 1 / -1; justify-content: flex-end; } }

/* ===== Control de impuesto en Ajustes ===== */
.tax-field .tax-onoff { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0 8px; cursor: pointer; }
.tax-field .tax-onoff input { width: 17px; height: 17px; }
.tax-pct { display: flex; align-items: center; gap: 6px; max-width: 160px; }
.tax-pct input { flex: 1; }
.tax-pct input:disabled { background: var(--panel-2, #f1efe9); color: var(--muted); }
.tax-pct span { font-weight: 700; color: var(--muted); }

/* ===== Recuperar contraseña (guía + solicitud, flujo sin correo) ===== */
.forgot-wrap { display: grid; gap: 16px; }
.forgot-guide { display: grid; gap: 10px; }
.forgot-case { display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.forgot-case > i { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.forgot-case strong { display: block; font-size: 14px; }
.forgot-case span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.forgot-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.forgot-done > i { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.forgot-done strong { display: block; font-size: 15px; }
.forgot-done span { display: block; font-size: 13px; color: var(--soft); margin-top: 3px; line-height: 1.5; }

/* ===== Panel Maestro: solicitudes de contraseña + badge del menú ===== */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: #b42318; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; }
.pwr-list { display: grid; gap: 10px; }
.pwr-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.pwr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.pwr-role { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }
.pwr-badge { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.pwr-badge.provider { background: #fef3c7; color: #92400e; }
.pwr-badge.admin { background: var(--accent-soft); color: var(--accent); }
.pwr-sub { font-size: 13px; color: var(--soft); margin-top: 4px; }
.pwr-when { margin-top: 3px; }
.pwr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pwr-actions .pwr-pass { flex: 1 1 200px; min-width: 0; }
.pwr-actions .sm { min-height: 38px; }
.pwr-msg { margin: 0; font-weight: 700; }

/* ===== Permisos: módulos/items bloqueados (no autorizados por el proveedor) ===== */
.perm-card.locked { opacity: .62; background: repeating-linear-gradient(135deg, var(--panel-2) 0 8px, color-mix(in srgb, var(--muted) 6%, var(--panel-2)) 8px 16px); }
.perm-card.locked .perm-check { cursor: not-allowed; }
.perm-lock { display: inline-flex; align-items: center; color: var(--muted); }
.perm-lock i { width: 15px; height: 15px; }
.perm-item.locked { opacity: .6; }
.perm-item-lock { width: 12px; height: 12px; color: var(--muted); vertical-align: -1px; }

/* ===== Reportes: botón y ventana "¿Qué genera?" ===== */
.report-explain-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.report-explain-btn i { width: 16px; height: 16px; }
.rx-wrap { display: grid; gap: 14px; }
.rx-head { display: flex; align-items: center; gap: 12px; }
.rx-head > i { width: 30px; height: 30px; color: var(--accent); flex: 0 0 auto; }
.rx-eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.rx-head strong { font-size: 19px; font-family: var(--font-display); }
.rx-desc { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.rx-params { display: grid; gap: 8px; }
.rx-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.rx-row > i { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.rx-row b { display: block; font-size: 13px; }
.rx-row span { display: block; font-size: 12.5px; color: var(--soft); margin-top: 2px; line-height: 1.5; }
.rx-foot { margin: 2px 0 0; }

/* ===== Aviso ROJO cuando la app NO está guardando (visible para todos) ===== */
.sys-banner.offline-banner { --sysb-a: #7f1d1d; --sysb-b: #b91c1c; --sysb-c: #ef4444; }
.sync-pill.offline { background: #b91c1c !important; color: #fff !important; font-weight: 800; }
/* La pastilla "Sin guardar" SÍ se ve en móvil (el aviso de guardado no se oculta). */
@media (max-width: 680px) {
  #syncStatus.offline { display: inline-flex !important; }
}

/* ===== Nota de crédito / devolución (modal) ===== */
.cn-items { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.cn-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.cn-item-main { min-width: 0; }
.cn-item-main b { display: block; font-size: 14px; }
.cn-item-main span { display: block; }
.cn-item .cn-qty { width: 84px; flex: 0 0 auto; text-align: center; }
.cn-total { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cn-total b { font-family: var(--font-num); font-size: 18px; }

/* ===== Panel Maestro: asistente de creación de negocio ===== */
.wiz-steps { display: flex; align-items: center; gap: 4px; margin: 2px 0 18px; }
.wiz-step { display: flex; align-items: center; gap: 8px; opacity: .5; }
.wiz-step.active, .wiz-step.done { opacity: 1; }
.wiz-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1.5px solid var(--line); color: var(--muted); flex: 0 0 auto; }
.wiz-step.active .wiz-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.wiz-step.done .wiz-dot { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border-color: var(--accent); color: var(--accent); }
.wiz-dot i { width: 15px; height: 15px; }
.wiz-lbl { font-size: 13px; font-weight: 700; }
.wiz-sep { flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 12px; }
@media (max-width: 560px) { .wiz-lbl { display: none; } }
.wiz-cards { display: grid; gap: 10px; }
.wiz-cards.two { grid-template-columns: 1fr 1fr; }
.wiz-cards.niche { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.wiz-card { text-align: left; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s, transform .1s; }
.wiz-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.wiz-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); box-shadow: inset 0 0 0 1px var(--accent); }
.wiz-card.disabled { opacity: .45; pointer-events: none; }
.wiz-card > i { width: 22px; height: 22px; color: var(--accent); }
.wiz-card strong { font-size: 14px; }
.wiz-card span { font-size: 12px; color: var(--muted); }
.wiz-cards.niche .wiz-card { flex-direction: row; align-items: center; gap: 9px; padding: 11px 12px; }
.wiz-cards.niche .wiz-card > i { width: 18px; height: 18px; }
.wiz-cards.niche .wiz-card span { font-size: 13px; color: var(--text); font-weight: 600; }
.wiz-slug { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); }
.wiz-slug-pre { padding: 0 4px 0 12px; color: var(--muted); font-weight: 700; }
.wiz-slug input { border: 0 !important; background: transparent; flex: 1; box-shadow: none !important; }
.wiz-pass { display: flex; gap: 8px; }
.wiz-pass input { flex: 1; }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wiz-chips .chip { cursor: pointer; }
.wiz-chips .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Selector de PLAN en el asistente (paso Cobro) */
.plan-toggle { display: inline-flex; gap: 3px; padding: 3px; background: var(--panel-2, #f1f5f9); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 14px; }
.plan-toggle button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.plan-toggle button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.plan-toggle .save-pill { background: #16a34a; color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; letter-spacing: .3px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan-card { position: relative; text-align: left; display: grid; gap: 3px; align-content: start; padding: 14px 13px 13px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.plan-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); }
.plan-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card.pop { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.plan-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .3px; }
.plan-card .plan-name { font-weight: 800; font-size: 14px; color: var(--text); }
.plan-card .plan-price { font-family: var(--font-mono, monospace); line-height: 1; margin-top: 2px; }
.plan-card .plan-price b { font-size: 26px; color: var(--text); }
.plan-card .plan-price small { color: var(--muted); font-size: 12px; font-weight: 600; }
.plan-card .plan-sub { font-size: 11px; color: var(--muted); }
.plan-card .plan-blurb { font-size: 12px; color: var(--text); font-weight: 600; margin-top: 6px; }
.plan-card .plan-hl { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.plan-card .plan-hl li { font-size: 11.5px; color: var(--muted); padding-left: 15px; position: relative; line-height: 1.35; }
.plan-card .plan-hl li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.wiz-trial { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--text); cursor: pointer; }
.wiz-trial input { width: 16px; height: 16px; }

/* ===== Aviso de LÍMITE de plan (upsell) ===== */
.lim-overlay { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 18px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); animation: limFade .18s ease; }
@keyframes limFade { from { opacity: 0 } to { opacity: 1 } }
.lim-card { position: relative; width: min(460px, 96vw); max-height: 92vh; overflow: auto; background: var(--panel); border-radius: 22px; box-shadow: 0 30px 80px rgba(2, 6, 23, .45); animation: limPop .24s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes limPop { from { transform: translateY(14px) scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
.lim-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; display: grid; place-items: center; cursor: pointer; border: 0; }
.lim-x:hover { background: rgba(255, 255, 255, .32); }
.lim-x i { width: 17px; height: 17px; }
.lim-hero { position: relative; overflow: hidden; padding: 30px 26px 24px; text-align: center; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6d28d9)); }
.lim-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120px 120px at 80% -10%, rgba(255, 255, 255, .28), transparent 70%); pointer-events: none; }
.lim-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.lim-ico i { width: 32px; height: 32px; color: #fff; }
.lim-spark { position: absolute; top: 18px; left: 22px; opacity: .8; animation: limSpark 2.4s ease-in-out infinite; }
.lim-spark i { width: 20px; height: 20px; color: #fff; }
@keyframes limSpark { 0%, 100% { transform: scale(1) rotate(0); opacity: .55 } 50% { transform: scale(1.2) rotate(12deg); opacity: 1 } }
.lim-hero h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; position: relative; }
.lim-hero p { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .92); position: relative; }
.lim-body { padding: 20px 22px 6px; }
.lim-scale-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.lim-plans { display: grid; gap: 8px; }
.lim-plan { position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--panel); }
.lim-plan.cur { border-color: color-mix(in srgb, var(--muted) 40%, var(--line)); background: color-mix(in srgb, var(--muted) 8%, var(--panel)); }
.lim-plan.rec { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lim-tag { position: absolute; top: -9px; left: 12px; font-size: 10px; font-weight: 800; letter-spacing: .3px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; }
.lim-tag.cur { background: var(--muted); }
.lim-pn { font-weight: 700; font-size: 14px; color: var(--text); }
.lim-pv { font-family: var(--font-mono, monospace); font-weight: 800; font-size: 16px; color: var(--accent); min-width: 62px; text-align: right; }
.lim-plan.cur .lim-pv { color: var(--muted); }
.lim-pp { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 56px; text-align: right; }
.lim-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--accent-soft); font-size: 12.5px; color: var(--text); line-height: 1.45; }
.lim-note i { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.lim-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.lim-actions .primary { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 420px) { .lim-plan { grid-template-columns: 1fr auto; } .lim-pp { display: none; } }
.wiz-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); background: var(--accent-soft); border-radius: 12px; }
.wiz-note > i { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.wiz-review { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wiz-rev-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.wiz-rev-row:last-child { border-bottom: 0; }
.wiz-rev-row > span { color: var(--muted); font-size: 13px; }
.wiz-rev-row > b { text-align: right; }
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.wiz-success { text-align: center; padding: 12px 6px; display: grid; gap: 4px; justify-items: center; }
.wiz-success-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); margin-bottom: 6px; }
.wiz-success-ico i { width: 30px; height: 30px; }
.wiz-cred { width: 100%; margin: 12px 0 4px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wiz-cred-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.wiz-cred-row:last-child { border-bottom: 0; }
.wiz-cred-row > span { color: var(--muted); font-size: 13px; width: 92px; flex: 0 0 auto; text-align: left; }
.wiz-cred-row > b { flex: 1; text-align: left; word-break: break-all; }
.wiz-success-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
