/* ═══════════════════════════════════════════════════════════════════════════
   FQSoft POS — Design System v1.1
   Estructura:
     1. Tokens primitivos (paleta, sombras, radii, transiciones, tipografía)
     2. Tokens semánticos (surface, border, text, brand, status)
     3. Reset / base
     4. Layout shell (sidebar, topbar, content)
     5. Navegación
     6. Componentes: KPI, Panel, Tabla, Modal, Form, Inventario, POS, Auth
     7. Utilidades
     8. Responsive
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. TOKENS PRIMITIVOS ────────────────────────────────────────────────── */
:root {
  /* Paleta navy */
  --color-navy-950: #020d1f;
  --color-navy-900: #062b55;
  --color-navy-800: #0a3d78;
  --color-navy-700: #0f5299;
  --color-navy-600: #165cae;
  --color-navy-500: #2172c9;
  --color-navy-400: #4d91d9;
  --color-navy-300: #93bceb;
  --color-navy-200: #c8ddf4;
  --color-navy-100: #e2eef9;
  --color-navy-50:  #f4f8fe;

  /* Paleta slate */
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50:  #f8fafc;

  /* Semáforo */
  --color-green-700: #15803d;
  --color-green-600: #16a34a;
  --color-green-500: #22c55e;
  --color-green-100: #dcfce7;
  --color-green-50:  #f0fdf4;

  --color-amber-600: #d97706;
  --color-amber-500: #f59e0b;
  --color-amber-100: #fef3c7;
  --color-amber-50:  #fffbeb;

  --color-red-700:   #b91c1c;
  --color-red-600:   #dc2626;
  --color-red-500:   #ef4444;
  --color-red-100:   #fee2e2;
  --color-red-50:    #fef2f2;

  /* Sombras */
  --shadow-xs:  0 1px 2px rgba(15,23,42,.05);
  --shadow-sm:  0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 8px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:  0 10px 24px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.05);
  --shadow-xl:  0 20px 40px rgba(15,23,42,.14), 0 8px 16px rgba(15,23,42,.06);
  --shadow-2xl: 0 32px 64px rgba(15,23,42,.20);

  /* Radii */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-full: 9999px;

  /* Transiciones */
  --transition-fast:   80ms ease;
  --transition-base:   150ms ease;
  --transition-smooth: 250ms cubic-bezier(.4,0,.2,1);

  /* Tipografía */
  --font-sans: 'Inter', 'Segoe UI', system-ui, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   18px;
  --text-2xl:  22px;
  --text-3xl:  28px;

  /* Espaciado (base 4px) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Z-index */
  --z-sticky:  20;
  --z-overlay: 200;
  --z-modal:   300;
}

/* ── 2. TOKENS SEMÁNTICOS ────────────────────────────────────────────────── */
:root {
  /* Superficies */
  --surface-app:      var(--color-slate-50);
  --surface-base:     #ffffff;
  --surface-inset:    var(--color-slate-100);
  --surface-highlight:var(--color-navy-50);
  --surface-overlay:  rgba(15,23,42,.5);

  /* Bordes */
  --border-subtle:  var(--color-slate-100);
  --border-default: var(--color-slate-200);
  --border-strong:  var(--color-slate-300);

  /* Texto */
  --text-primary:   var(--color-slate-900);
  --text-secondary: var(--color-slate-500);
  --text-tertiary:  var(--color-slate-400);
  --text-inverse:   #ffffff;

  /* Brand */
  --brand-nav:    var(--color-navy-900);
  --brand-deep:   var(--color-navy-950);
  --brand-accent: var(--color-green-500);
  --brand-primary:var(--color-navy-600);

  /* Status */
  --status-success-text:   var(--color-green-700);
  --status-success-bg:     var(--color-green-50);
  --status-warning-text:   var(--color-amber-600);
  --status-warning-bg:     var(--color-amber-50);
  --status-error-text:     var(--color-red-600);
  --status-error-bg:       var(--color-red-50);
  --status-info-text:      var(--color-navy-600);
  --status-info-bg:        var(--color-navy-50);

  /* Aliases legacy — compatibilidad con código existente */
  --fq-nav:     var(--brand-nav);
  --fq-nav-dark:var(--brand-deep);
  --fq-green:   var(--color-green-600);
  --fq-blue:    var(--color-navy-600);
  --fq-red:     var(--color-red-500);
  --fq-orange:  var(--color-amber-500);
  --fq-bg:      var(--surface-app);
  --fq-card:    var(--surface-base);
  --fq-border:  var(--border-default);
  --fq-text:    var(--text-primary);
  --fq-muted:   var(--text-secondary);
}

/* ── 3. RESET / BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--surface-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── 4. LAYOUT SHELL ─────────────────────────────────────────────────────── */
.fq-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.fq-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-3);
  color: var(--text-inverse);
  background: linear-gradient(180deg, var(--brand-nav) 0%, var(--brand-deep) 100%);
  border-right: 1px solid rgba(255,255,255,.05);
  z-index: var(--z-sticky);
  transition: width var(--transition-smooth);
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Main area */
.fq-main {
  flex: 1;
  min-width: 0;
  margin-left: 252px;
  transition: margin-left var(--transition-smooth);
}

/* Topbar */
.fq-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.fq-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.fq-topbar h1 {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: 900;
  letter-spacing: -.02em;
}

.fq-context {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: .01em;
}

.fq-topbar-back {
  color: var(--text-secondary) !important;
  margin-left: -2px;
}

.fq-page-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fq-page-context h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.01em;
}

.fq-page-context span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fq-topbar-breadcrumb { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; }
.fq-topbar-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.fq-topbar-breadcrumb a:hover { color: var(--brand-primary); }
.fq-topbar-breadcrumb .mud-icon-root { width: 14px; height: 14px; color: var(--text-tertiary); }
.fq-topbar-breadcrumb strong { overflow: hidden; color: var(--text-primary); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.fq-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.fq-search,
.fq-search--desktop { width: min(300px, 26vw); }

/* Content */
.fq-content {
  padding: var(--space-6) var(--space-7) var(--space-10);
}

/* Collapsed sidebar */
.fq-shell--collapsed .fq-sidebar { width: 64px; }

.fq-shell--collapsed .fq-brand span:last-child,
.fq-shell--collapsed .fq-nav-section,
.fq-shell--collapsed .fq-nav-link span:last-child,
.fq-shell--collapsed .fq-store-card { opacity: 0; pointer-events: none; overflow: hidden; width: 0; }

.fq-shell--collapsed .fq-nav-link { justify-content: center; padding: var(--space-3); }
.fq-shell--collapsed .fq-brand    { justify-content: center; gap: 0; }
.fq-shell--collapsed .fq-main     { margin-left: 64px; }

/* ── 5. NAVEGACIÓN ───────────────────────────────────────────────────────── */
.fq-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: -.01em;
  transition: gap var(--transition-smooth);
}

.fq-brand strong { color: var(--brand-accent); }

.fq-brand-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.14);
  font-size: var(--text-sm);
  font-weight: 900;
  letter-spacing: .02em;
}

.fq-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.fq-nav-section {
  margin: var(--space-4) var(--space-2) var(--space-1);
  color: rgba(255,255,255,.30);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.fq-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,.60);
  font-size: var(--text-base);
  font-weight: 600;
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.fq-nav-link:hover {
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.07);
}

.fq-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.11);
  font-weight: 700;
}

/* Indicator pill izquierda en item activo */
.fq-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  background: var(--brand-accent);
}

.fq-store-card {
  margin-top: auto;
  padding: var(--space-4) var(--space-2);
  border-top: 1px solid rgba(255,255,255,.08);
}

.fq-store-card strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
}

.fq-store-card span {
  display: block;
  margin-top: var(--space-1);
  color: rgba(255,255,255,.40);
  font-size: var(--text-sm);
}

.fq-menu-btn { margin-right: var(--space-2); }

/* Los drawers temporales opt-in no deben ampliar el ancho documental mientras
   MudBlazor los mantiene montados fuera del borde derecho. */
.fq-contained-temporary-drawer.mud-drawer-temporary.mud-drawer--closed {
  left: auto !important;
  right: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  visibility: hidden;
  pointer-events: none;
}

/* Avatar y user dropdown */
.fq-avatar {
  cursor: pointer;
  font-size: var(--text-sm) !important;
  font-weight: 800 !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}

.fq-user-dropdown { position: relative; }

.fq-avatar-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 50%;
}

.fq-avatar-button:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.fq-user-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  border: 0;
  background: transparent;
  cursor: default;
}

.fq-user-dropdown-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownIn var(--transition-base) ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fq-user-menu-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.fq-user-menu-header strong { display: block; font-size: var(--text-base); font-weight: 700; }
.fq-user-menu-header small  { color: var(--text-secondary); font-size: var(--text-sm); }

.fq-menu-divider { margin: 0; border: none; border-top: 1px solid var(--border-subtle); }

.fq-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.fq-menu-item:hover           { background: var(--surface-inset); }
.fq-menu-item--danger         { color: var(--color-red-600); }
.fq-menu-item--danger:hover   { background: var(--color-red-50); }

/* ── 6. COMPONENTES ──────────────────────────────────────────────────────── */

/* Page header */
.fq-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.fq-page-header p {
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.fq-page-header h2 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.fq-page-header--title-first h2 { margin-bottom: var(--space-1); }
.fq-page-header--title-first p { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Panel */
.fq-panel {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

/* Variante compacta — menos padding y controles más bajos (ej. toolbar de filtros) */
.fq-panel--compact {
  padding: 12px 16px;
}
.fq-panel--compact .mud-input-control {
  margin-top: 0;
}
.fq-panel--compact .mud-input-control .mud-input-slot {
  padding-top: 4px;
  padding-bottom: 4px;
}

.fq-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.fq-panel-title h3,
.fq-cart-panel h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
}

/* KPI cards */
.fq-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.fq-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.fq-kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Barra de acento superior por tono */
.fq-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.fq-kpi.success::before { background: var(--color-green-500); }
.fq-kpi.info::before    { background: var(--color-navy-500); }
.fq-kpi.warning::before { background: var(--color-amber-500); }
.fq-kpi.danger::before  { background: var(--color-red-500); }

.fq-kpi p, .fq-kpi small { margin: 0; }

.fq-kpi p {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.fq-kpi strong {
  display: block;
  margin: var(--space-1) 0;
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.fq-kpi small { color: var(--text-tertiary); font-size: var(--text-sm); }

.fq-kpi-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
}

.fq-kpi-icon.success { color: var(--color-green-600); background: var(--color-green-50); }
.fq-kpi-icon.info    { color: var(--color-navy-600);  background: var(--color-navy-100); }
.fq-kpi-icon.warning { color: var(--color-amber-600); background: var(--color-amber-50); }
.fq-kpi-icon.danger  { color: var(--color-red-600);   background: var(--color-red-50);   }

/* Toolbar */

/* ── COMPONENTES CONTINUACIÓN ────────────────────────────────────────────── */

/* Tabla */
.fq-table th {
  font-size: var(--text-xs) !important;
  font-weight: 700 !important;
  color: var(--text-tertiary) !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--color-slate-50) !important;
  border-bottom: 1px solid var(--border-default) !important;
}
/* Fondo de filas — se aplica al contenedor y a las filas, NO con !important en td
   para no interferir con colores de texto heredados de MudBlazor */
.fq-table .mud-table-container { background: var(--surface-base); }
.fq-table .mud-table-row > td,
.fq-table .mud-table-row > .mud-table-cell {
  background: var(--surface-base);
  color: var(--text-primary);
}
.fq-table .mud-table-pagination,
.fq-table tfoot td,
.fq-table .mud-table-pagination .mud-toolbar {
  background: var(--color-slate-50) !important;
  border-top: 1px solid var(--border-default) !important;
  color: var(--text-secondary) !important;
}
.fq-table .mud-table-row:hover > td,
.fq-table .mud-table-row:hover > .mud-table-cell { background: var(--surface-highlight) !important; }

.fq-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--surface-inset);
  color: var(--text-secondary);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  letter-spacing: .01em;
}

.fq-empty {
  padding: var(--space-10);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-md);
}

/* Toolbar */
.fq-toolbar { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.fq-toolbar-search { flex: 1; min-width: 220px; }
.fq-toolbar-filter { width: 150px; }

/* Modal */
.fq-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: overlayIn var(--transition-base) ease;
  backdrop-filter: blur(4px);
}
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }

.fq-modal {
  background: var(--surface-base);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--border-subtle);
  animation: modalIn var(--transition-smooth) cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }

.fq-modal--sm { max-width: 420px; }
.fq-modal--lg { max-width: 800px; }

.fq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.fq-modal-header h3 { margin: 0; font-size: var(--text-lg); font-weight: 800; letter-spacing: -.01em; }
.fq-modal-body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.fq-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-inset);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex-shrink: 0;
}

/* Formularios */
.fq-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.fq-form-span2 { grid-column: span 2; }

/* Secciones de formulario */
.fq-form-section {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.fq-form-section--last { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.fq-form-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* Margen de ganancia automático */
.fq-form-margen {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.fq-form-margen--ok  { background: var(--color-green-50); color: var(--color-green-700); border: 1px solid var(--color-green-200); }
.fq-form-margen--neg { background: var(--color-red-50);   color: var(--color-red-700);   border: 1px solid var(--color-red-200); }

/* Lista genérica */
.fq-list { display: grid; gap: var(--space-3); }
.fq-list > div { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.fq-list > div:last-child { border-bottom: 0; }
.fq-list span { color: var(--text-secondary); font-size: var(--text-sm); }
.fq-list b { grid-row: span 2; align-self: center; }

/* Lista items modales */
.fq-list-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-base); border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.fq-list-item:last-child { border-bottom: 0; }
.fq-list-item:hover { background: var(--surface-inset); }

/* Inventario */
.fq-inv-lines-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0 var(--space-3); margin-bottom: var(--space-2); font-weight: 700; font-size: var(--text-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border-subtle); }
.fq-inv-line { display: grid; grid-template-columns: 1fr 110px 110px auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border-subtle); border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.fq-inv-line:hover { background: var(--surface-inset); }
.fq-detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-4); background: var(--surface-inset); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.fq-detail-meta div { display: flex; flex-direction: column; gap: var(--space-1); }
.fq-detail-meta small { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fq-detail-meta strong { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }

/* Dashboard */
.fq-dashboard-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: var(--space-5); margin-top: var(--space-5); align-items: stretch; }

/* ── POS LAYOUT ──────────────────────────────────────────────────────────── */
.fq-pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-4); height: calc(100vh - 60px - var(--space-10)); min-height: 0; }
.fq-pos-catalog { display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; overflow: hidden; }
.fq-pos-search-bar { flex-shrink: 0; }

/* Tabs categoría */
.fq-pos-cats { display: flex; gap: var(--space-2); flex-wrap: wrap; flex-shrink: 0; overflow-x: auto; padding-bottom: 2px; }
.fq-pos-cat { padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); border: 1.5px solid var(--border-default); background: var(--surface-base); font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
.fq-pos-cat:hover { border-color: var(--color-navy-400); color: var(--text-primary); }
.fq-pos-cat--active { background: var(--color-navy-600); border-color: var(--color-navy-600); color: #fff; }

/* Grid productos POS */
.fq-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: var(--space-3); overflow-y: auto; padding-right: var(--space-1); align-content: start; }
.fq-pos-loading { display: flex; justify-content: center; padding: var(--space-8); }

/* Tarjeta producto POS */
.fq-pos-product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-base);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.fq-pos-product-card:hover:not(:disabled) { border-color: var(--color-navy-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fq-pos-product-card:disabled, .fq-pos-product-card--empty { opacity: .45; cursor: not-allowed; }
.fq-pos-product-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--color-navy-100); color: var(--color-navy-700); font-size: var(--text-sm); font-weight: 900; }
.fq-pos-product-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fq-pos-product-name { font-size: var(--text-base); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-pos-product-footer { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-1); }
.fq-pos-product-price { font-size: var(--text-md); font-weight: 900; }
.fq-pos-stock-ok   { font-size: var(--text-xs); color: var(--text-tertiary); }
.fq-pos-stock-warn { font-size: var(--text-xs); color: var(--color-amber-600); font-weight: 700; }
.fq-pos-stock-out  { font-size: var(--text-xs); color: var(--color-red-500); font-weight: 700; }

/* Panel carrito */
.fq-pos-cart { display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface-base); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); min-height: 0; overflow: hidden; }
.fq-pos-cart-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.fq-pos-cart-header h3 { margin: 0; font-size: var(--text-lg); font-weight: 800; }
.fq-pos-customer { flex-shrink: 0; }
.fq-pos-cart-items { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.fq-pos-cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-8) 0; color: var(--text-tertiary); text-align: center; flex: 1; }
.fq-pos-cart-empty p { margin: 0; font-size: var(--text-md); font-weight: 600; }
.fq-pos-cart-empty small { font-size: var(--text-sm); }
.fq-pos-cart-item { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-1); border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.fq-pos-cart-item:hover { background: var(--surface-inset); }
.fq-pos-cart-item-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fq-pos-cart-item-name { font-size: var(--text-base); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-pos-cart-item-price { font-size: var(--text-xs); color: var(--text-tertiary); }
.fq-pos-cart-item-qty { display: flex; align-items: center; gap: 2px; }
.fq-pos-qty-num { min-width: 24px; text-align: center; font-size: var(--text-base); font-weight: 700; }
.fq-pos-cart-item-total { font-size: var(--text-base); font-weight: 700; white-space: nowrap; }

/* Totales carrito */
.fq-pos-cart-totals { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0 var(--space-2); border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.fq-pos-total-row { display: flex; justify-content: space-between; font-size: var(--text-base); color: var(--text-secondary); }
.fq-pos-total-row--total { font-size: var(--text-lg); color: var(--text-primary); padding-top: var(--space-2); border-top: 1px solid var(--border-default); }
.fq-pos-total-row--discount { color: var(--color-green-600); }
.fq-pos-total-row--change { color: var(--color-green-700); font-size: var(--text-lg); }
.fq-pos-charge-btn { flex-shrink: 0; height: 48px !important; font-size: var(--text-md) !important; font-weight: 800 !important; letter-spacing: .02em; }

/* Modal cobro */
/* ── Modal cobro rediseñado ───────────────────────────────────────────────── */

/* Header dark con total */
.pos-pay-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--color-navy-900);
  color: white;
  padding: 20px 20px 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.pos-pay-header-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(255,255,255,.6);
  margin-bottom: 4px;
}
.pos-pay-header-total {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 4px;
}
.pos-pay-pending-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.pos-pay-pending-chip--pending { background: rgba(239,68,68,.2); color: #fca5a5; }
.pos-pay-pending-chip--ok      { background: rgba(34,197,94,.2); color: #86efac; }

/* Label sección */
.pos-pay-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Lista de métodos */
.fq-pos-payment-methods { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }

/* Bloque por método */
.pos-pay-method {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .15s;
}
.pos-pay-method--active { border-color: var(--brand-primary); }

.pos-pay-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-base);
}
.pos-pay-method--active .pos-pay-method-header { background: var(--surface-inset); }

.pos-pay-method-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pos-pay-method-icon--cash  { background: #dcfce7; color: #16a34a; }
.pos-pay-method-icon--card  { background: #dbeafe; color: #2563eb; }
.pos-pay-method-icon--yape  { background: #ede9fe; color: #7c3aed; }
.pos-pay-method-icon--plin  { background: #fce7f3; color: #db2777; }
.pos-pay-method-icon--default { background: var(--surface-inset); color: var(--text-secondary); }

.pos-pay-method-name { font-weight: 600; font-size: var(--text-sm); }

/* Body expandido */
.pos-pay-method-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-base);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Grid 2 columnas para efectivo y digitales */
.pos-pay-cash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 360px) { .pos-pay-cash-grid { grid-template-columns: 1fr; } }

.pos-pay-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Botón TODO */
.pos-pay-todo-btn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--brand-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pos-pay-todo-btn:hover { text-decoration: underline; }

/* Botones rápidos de efectivo */
.pos-pay-quick-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pos-pay-quick-btn {
  flex: 1;
  min-width: 52px;
  padding: 6px 4px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.pos-pay-quick-btn:hover { background: var(--surface-hover); border-color: var(--brand-primary); color: var(--brand-primary); }
.pos-pay-quick-btn--exact { background: var(--color-navy-900); color: white; border-color: var(--color-navy-900); }
.pos-pay-quick-btn--exact:hover { background: var(--color-navy-800); border-color: var(--color-navy-800); color: white; }

/* Fila vuelto */
.pos-pay-vuelto {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-secondary);
}
.pos-pay-vuelto--ok   { color: var(--color-green-600); font-size: 15px; }
.pos-pay-vuelto--zero { color: var(--text-tertiary); font-size: 15px; }

/* Confirmación TODO */
.pos-pay-todo-confirm {
  padding: 10px 12px;
  background: var(--color-amber-50, #fffbeb);
  border: 1px solid var(--color-amber-300, #fcd34d);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-amber-900, #78350f);
}
.pos-pay-todo-confirm-yes {
  padding: 5px 12px;
  background: var(--color-navy-900);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pos-pay-todo-confirm-yes:hover { background: var(--color-navy-800); }
.pos-pay-todo-confirm-no {
  padding: 5px 12px;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}
.pos-pay-todo-confirm-no:hover { background: var(--surface-inset); }

/* Mantener backwards compat */
.fq-pos-payment-total { display:none; }
.fq-pos-pm-label { display: flex; align-items: center; gap: var(--space-1); min-width: 120px; font-weight: 600; }
.fq-pos-payment-summary { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); background: var(--surface-inset); border-radius: var(--radius-md); }

/* ── Módulo Productos ────────────────────────────────────────────────────── */

/* Avatar / imagen en tabla */
.prod-avatar-img {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.prod-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--color-navy-700);
  flex-shrink: 0;
}

/* Badges de stock */
.prod-stock-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.prod-stock-badge--ok  { background: #dcfce7; color: #15803d; }
.prod-stock-badge--low { background: #fef9c3; color: #a16207; }
.prod-stock-badge--out { background: #fee2e2; color: #b91c1c; }

/* KPI cards abajo */
.prod-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .prod-kpi-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 500px) { .prod-kpi-row { grid-template-columns: 1fr; } }

/* KPI cards — variante de 5 columnas (Productos) */
.prod-kpi-row-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.prod-kpi-row-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1280px) { .prod-kpi-row-6 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px)  { .prod-kpi-row-6 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px)  { .prod-kpi-row-6 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .prod-kpi-row-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px)  { .prod-kpi-row-5 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px)  { .prod-kpi-row-5 { grid-template-columns: 1fr; } }

.prod-kpi-card {
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.prod-kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prod-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.prod-kpi-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}

/* Modal producto 2 columnas */
.prod-modal-body { padding-top: 0 !important; }

.prod-modal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: 0;
}
@media (max-width: 640px) { .prod-modal-layout { grid-template-columns: 1fr; } }

.prod-modal-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.prod-modal-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* Placeholder imagen */
.prod-img-placeholder {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-inset);
  margin-bottom: 16px;
  cursor: default;
}
.prod-img-avatar {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  color: var(--color-navy-700);
}
.prod-img-hint {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-tertiary);
}

/* ── Upload de imagen de producto ───────────────────────────────────────── */
.prod-img-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.prod-img-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-inset);
}
.prod-img-actions { display: flex; gap: 8px; }
.prod-img-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1.5px dashed var(--color-navy-400);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-navy-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.prod-img-upload-btn:hover { background: var(--color-navy-50, #eff6ff); }
.prod-img-upload-btn.disabled { opacity: .6; cursor: not-allowed; pointer-events: none; }

.prod-name-link { cursor: pointer; }
.prod-name-link:hover { color: var(--color-navy-600, #2563eb); text-decoration: underline; }

/* Toggle de estado en modal */
.prod-status-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-inset);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* Stock actual readonly */
.prod-stock-readonly {
  background: var(--surface-inset);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
}
.prod-stock-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Página "Crear Nuevo Producto" (/products/new)
   ═══════════════════════════════════════════════════════════════════════════ */
.prod-new-header { margin-bottom: var(--space-4) !important; }
.prod-new-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.prod-new-back {
  color: var(--text-secondary) !important;
  margin-left: -6px;
}
.prod-new-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
/* Blazor enfoca el <h1> tras navegar (accesibilidad, ver Routes.razor
   <FocusOnNavigate Selector="h1">) — se mantiene el foco programático
   pero se quita el recuadro negro por defecto del navegador. */
.prod-new-header h1:focus,
.prod-new-header h1:focus-visible {
  outline: none;
}
.prod-new-header p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.prod-new-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.prod-new-layout > div { min-width: 0; }

.prod-new-side {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.prod-new-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: var(--space-4);
  color: var(--text-primary, #1a1a2e);
}
.prod-new-card-title .mud-icon-root { color: var(--color-navy-500, #64748b); }

.prod-name-hint { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; }
.prod-name-hint.ok  { color: var(--color-green-700, #15803d); }
.prod-name-hint.bad { color: var(--color-red-700, #b91c1c); }
.prod-name-hint.checking { color: var(--text-tertiary); }

.prod-img-dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1.5px dashed var(--color-navy-300, #93c5fd);
  border-radius: var(--radius-lg);
  background: var(--color-navy-50, #eff6ff);
  color: var(--color-navy-600, #2563eb);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}
.prod-img-dropzone:hover { background: var(--color-navy-100, #dbeafe); }
.prod-img-dropzone small { color: var(--text-tertiary); font-weight: 400; }
.prod-img-dropzone-preview {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.prod-summary-card { position: relative; overflow: hidden; padding-top: calc(var(--space-5) + 3px); }
.prod-summary-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--color-navy-500, #2563eb);
}
.prod-summary-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.prod-summary-row:last-of-type { border-bottom: none; }
.prod-summary-row span:first-child { color: var(--text-secondary); }
.prod-summary-row span:last-child { font-weight: 600; text-align: right; }

/* ── Resumen 2x2 (Presentaciones/Códigos/Principal/Duplicados) ──────────────── */
.prod-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prod-summary-cell { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 10px; }
.prod-summary-cell small { display: block; font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.prod-summary-cell strong { font-size: 16px; font-weight: 700; }
.prod-summary-cell strong.danger { color: #dc2626; }

/* ── Cola de impresión de etiquetas ──────────────────────────────────────── */
.prod-print-queue { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-inset); color: var(--text-secondary); }
.prod-print-queue.pending { background: var(--color-amber-50, #fffbeb); color: var(--color-amber-700, #b45309); }
.prod-print-queue strong { display: block; font-size: 13px; }
.prod-print-queue small { display: block; font-size: 11px; opacity: .85; }

/* ── Últimos cambios (timeline) ──────────────────────────────────────────── */
.prod-changelog-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.prod-changelog-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-navy-500, #3b82f6); margin-top: 5px; flex-shrink: 0; }
.prod-changelog-item span { display: block; color: var(--text-primary); }
.prod-changelog-item small { display: block; color: var(--text-tertiary); margin-top: 1px; }

/* ── Tab Códigos de Barras (tarjetas agrupadas) ──────────────────────────── */
.prod-bc-stats { display: flex; align-items: stretch; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.prod-bc-stat { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 14px; min-width: 90px; }
.prod-bc-stat small { display: block; font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .03em; }
.prod-bc-stat strong { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; }
.prod-bc-stat strong.danger { color: #dc2626; }
.prod-bc-stat--total { min-width: 160px; }
.prod-bc-stat--total strong { font-size: 15px; }
.prod-bc-search { flex: 1; min-width: 200px; align-self: center; }

.prod-bc-group-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 8px; display: flex; justify-content: space-between; }
.prod-bc-group-title:first-of-type { margin-top: 0; }
.prod-bc-group-title span { font-weight: 400; text-transform: none; color: var(--text-tertiary); }

.prod-bc-row { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; }
.prod-bc-row.duplicate { border-color: #fca5a5; background: #fef2f2; }
.prod-bc-row-icon { color: var(--text-tertiary); flex-shrink: 0; padding-top: 2px; }
.prod-bc-row.duplicate .prod-bc-row-icon { color: #dc2626; }
.prod-bc-row-main { flex: 1; min-width: 0; }
.prod-bc-row-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.prod-bc-badge { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; background: var(--surface-inset); color: var(--text-secondary); }
.prod-bc-badge.success { background: #dcfce7; color: #15803d; }
.prod-bc-badge.muted { background: var(--surface-inset); color: var(--text-tertiary); }
.prod-bc-badge.danger { background: #fee2e2; color: #b91c1c; }
.prod-bc-flag { font-size: 11px; font-weight: 600; color: #15803d; }
.prod-bc-code { font-family: var(--font-mono, monospace); font-size: 14px; font-weight: 700; }
.prod-bc-row-side { flex-shrink: 0; text-align: right; }
.prod-bc-row-tags { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.prod-bc-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-secondary); background: var(--surface-inset); padding: 2px 7px; border-radius: 999px; }
.prod-bc-row-meta { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--text-tertiary); }
.prod-bc-qr-link { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--color-navy-600, #2563eb); text-decoration: none; }
.prod-bc-qr-link:hover { text-decoration: underline; }

/* Vista expandida de Códigos de Barras */
.prod-detail-layout--codes .prod-bc-stats { gap: 0; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-base); }
.prod-detail-layout--codes .prod-bc-stat { min-width: 82px; padding: 5px 12px; border-width: 0 1px 0 0; border-radius: 0; }
.prod-detail-layout--codes .prod-bc-stat--total { min-width: 135px; }
.prod-detail-layout--codes .prod-bc-search { min-width: 180px; margin: 0 8px; }
.prod-detail-layout--codes .prod-bc-group-title { align-items: center; justify-content: flex-start; gap: 10px; color: var(--text-primary); font-weight: 800; text-transform: none; }
.prod-detail-layout--codes .prod-bc-group-title::after { content: ""; height: 1px; flex: 1; background: var(--border-subtle); }
.prod-detail-layout--codes .prod-bc-group-title span { order: 3; font-size: 9px; font-weight: 600; }
.prod-detail-layout--codes .prod-bc-row { align-items: center; gap: 16px; padding: 12px 14px; margin-bottom: 9px; background: var(--surface-base); }
.prod-detail-layout--codes .prod-bc-row-icon { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: var(--brand-primary); border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--surface-inset); }
.prod-detail-layout--codes .prod-bc-row.duplicate .prod-bc-row-icon { color: #dc2626; }
.prod-detail-layout--codes .prod-bc-code { font-size: 17px; font-weight: 800; letter-spacing: .08em; }
.prod-detail-layout--codes .prod-bc-row-side { display: flex; align-items: center; gap: 18px; }
.prod-barcode-summary h2 { margin: 0 0 15px; font-size: 15px; font-weight: 800; }
.prod-barcode-health-note { margin: 8px 0 14px; color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.prod-barcode-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prod-barcode-summary-grid > div { padding: 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.prod-barcode-summary-grid small { display: block; color: var(--text-tertiary); font-size: 9px; }
.prod-barcode-summary-grid strong { display: block; margin-top: 3px; font-size: 19px; }
.prod-barcode-summary-grid strong.primary { color: var(--brand-primary); }
.prod-barcode-summary-grid strong.danger { color: #dc2626; }

@media (max-width: 1050px) {
  .prod-detail-layout.prod-detail-layout--codes { grid-template-columns: 1fr; }
  .prod-detail-layout--codes > div:last-child { display: none; }
  .prod-detail-layout--codes .prod-bc-row { align-items: flex-start; flex-wrap: wrap; }
  .prod-detail-layout--codes .prod-bc-row-side { width: 100%; justify-content: space-between; padding-left: 58px; }
}

/* ── Drawer Nuevo/Editar Código ──────────────────────────────────────────── */
.prod-bc-hint { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; }
.prod-bc-hint.ok { color: #15803d; }
.prod-bc-hint.warn { color: #b45309; }
.prod-bc-originbox { display: flex; justify-content: space-between; gap: 12px; background: var(--surface-inset); border-radius: var(--radius-md); padding: 10px 14px; }
.prod-bc-originbox small { display: block; font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.prod-bc-originbox > div > div { font-size: 13px; font-weight: 600; }
.prod-bc-originbox-status { display: flex; align-items: center; gap: 5px; }
.prod-bc-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prod-bc-dot.ok { background: #16a34a; }
.prod-bc-dot.off { background: #9ca3af; }

/* ── Tab Precios (tarjetas agrupadas + promociones) ──────────────────────── */
.prod-price-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.prod-price-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prod-price-search { min-width: 220px; }

.prod-detail-layout--prices .prod-price-toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; }
.prod-detail-layout--prices .prod-price-toolbar-actions { justify-content: flex-end; }
.prod-detail-layout--prices .prod-price-search { flex: 1; margin-right: auto; }

.prod-price-stats { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.prod-price-stat { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 14px; min-width: 90px; }
.prod-detail-layout--prices .prod-price-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prod-detail-layout--prices .prod-price-stat { min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--surface-base); }
.prod-detail-layout--prices .prod-price-stat > .mud-icon-root { width: 30px; height: 30px; padding: 7px; border-radius: 5px; color: var(--brand-primary); background: #dbeafe; }
.prod-price-stat strong { display: block; font-size: 18px; font-weight: 700; }
.prod-price-stat small { display: block; font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }

.prod-price-filter-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-navy-700, #1d4ed8); background: var(--color-navy-50, #eff6ff); border-radius: 999px; padding: 3px 6px 3px 12px; margin-bottom: 14px; }

.prod-empty-hint { padding: 24px 12px; text-align: center; color: var(--text-tertiary); font-size: 13px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); }

.prod-price-group-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 18px 0 10px; }
.prod-price-group-title::after { content: ""; height: 1px; flex: 1; background: var(--border-subtle); }
.prod-price-group-title button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--brand-primary); font-size: 10px; cursor: pointer; }
.prod-price-group-title button:hover { text-decoration: underline; }
.prod-price-group-title:first-of-type { margin-top: 0; }

.prod-price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; max-width: 900px; }

/* Tarjeta de precio / promoción */
.pcard { position: relative; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px 12px; background: var(--surface-card, #fff); overflow: hidden; }
.pcard.promo { border-color: #fed7aa; background: #fffbf5; }

.pcard-ribbon { position: absolute; top: 10px; right: -28px; transform: rotate(45deg); background: #f97316; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 3px 32px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pcard-label { font-size: 10px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.pcard-title { font-size: 15px; font-weight: 700; margin-top: 1px; }
.pcard-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.pcard-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--surface-inset); color: var(--text-secondary); white-space: nowrap; }
.pcard-badge.ok { background: #dcfce7; color: #15803d; }
.pcard-badge.warn { background: #fef3c7; color: #b45309; }
.pcard-badge.danger { background: #fee2e2; color: #b91c1c; }
.pcard-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.pcard-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.pcard-metrics small { display: block; font-size: 10px; color: var(--text-tertiary); margin-bottom: 2px; }
.pcard-metrics strong { display: block; font-size: 15px; font-weight: 700; }
.pcard-metrics strong.ok { color: #15803d; }
.pcard-metrics strong.warn { color: #b45309; }
.pcard-metrics strong.danger { color: #b91c1c; }

.pcard-subline { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }

.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; flex-wrap: wrap; }
.pcard-foot > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.pcard-foot-meta { color: var(--text-tertiary); }
.pcard-warnlabel { font-size: 10px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 2px 7px; border-radius: 999px; }

.pcard-bar { height: 5px !important; border-radius: 3px; margin: 0 -16px -12px; width: calc(100% + 32px) !important; }

/* Composición por lista (sidebar) */
.prod-price-composition { display: flex; flex-direction: column; gap: 8px; }
.prod-price-composition-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.prod-price-composition-row span { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); }
.prod-price-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Próximos cambios (sidebar) */
.prod-price-upcoming { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.prod-price-upcoming strong { display: block; color: var(--text-primary); font-weight: 600; }
.prod-price-upcoming small { display: block; color: var(--text-tertiary); margin-top: 1px; }

.prod-price-import-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 12px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); color: var(--text-tertiary); font-size: 12px; text-align: center; cursor: not-allowed; }

.prod-price-alert { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-inset); color: var(--text-secondary); }
.prod-price-alert.warning { background: #fef3c7; color: #b45309; }
.prod-price-alert.danger { background: #fee2e2; color: #b91c1c; }
.prod-price-alert.info { background: var(--color-navy-50, #eff6ff); color: var(--color-navy-700, #1d4ed8); }
.prod-price-analysis-panel .prod-new-card-title { font-size: 15px; }

/* ── Pestaña Precios: listas = vía normal, promociones = excepción temporal, ─────
   precio base = respaldo técnico. Ver revisión de reorganización (jul-2026). ── */
.prod-price-section { margin: 20px 0 28px; }
.prod-price-section:first-of-type { margin-top: 0; }
.prod-price-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
.prod-price-section-title { font-size: 15px; font-weight: 700; }
.prod-price-section-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.prod-price-section-meta strong { color: var(--text-primary); }
.prod-price-section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-price-compare-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--brand-primary); font-size: 12px; cursor: pointer; }
.prod-price-compare-link:hover { text-decoration: underline; }

.prod-price-table { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; background: var(--surface-card, #fff); }
.prod-price-table-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr 40px; gap: 8px; align-items: center; padding: 9px 12px; font-size: 13px; border-top: 1px solid var(--border-subtle); }
.prod-price-table-row:first-child { border-top: none; }
.prod-price-table-row.head { background: var(--surface-inset); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-tertiary); }
.prod-price-table-row.scheduled { background: #fffdf5; }
.prod-price-table-row .ok { color: #15803d; font-weight: 600; }
.prod-price-table-row .warn { color: #b45309; font-weight: 600; }
.prod-price-table-row .danger { color: #b91c1c; font-weight: 600; }
.prod-price-table-actions { display: flex; justify-content: flex-end; }

.prod-price-promo-section { background: #fffbf5; border: 1px solid #fed7aa; border-radius: var(--radius-md); padding: 12px 14px 10px; margin-bottom: 8px; }
.prod-price-promo-section .prod-price-table { margin-bottom: 12px; border-color: #fed7aa; }
.prod-price-promo-section .prod-price-table-row.head { background: #fff4e6; color: #9a3412; }
.prod-price-subsection-title { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #9a3412; text-transform: uppercase; margin-bottom: 8px; }
.prod-price-promo-group-label { font-size: 11px; font-weight: 600; color: #9a3412; margin: 6px 0 4px; }

.prod-price-table.promo.history { opacity: .85; }
.prod-price-history-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: transparent; color: #9a3412; font-size: 12px; font-weight: 600; cursor: pointer; }
.prod-price-history-toggle:hover { text-decoration: underline; }

.prod-price-source-badge { display: inline-block; font-size: 10px; font-weight: 600; color: var(--text-tertiary); background: var(--surface-inset); border-radius: 999px; padding: 1px 8px; margin-left: 2px; }

.prod-empty-hint--action { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.prod-baseprice-footer { margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--border-subtle); }
.prod-baseprice-footer .fq-form-section-title { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 8px; }
.prod-baseprice-footer strong.price { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.prod-baseprice-badge { background: #fef3c7; color: #b45309; }

@media (max-width: 720px) {
  .prod-price-table-row { grid-template-columns: 1.4fr 1fr 1fr 40px; }
  .prod-price-table-row span:nth-child(3),
  .prod-price-table-row span:nth-child(4) { display: none; }
  .prod-price-table-row.head span:nth-child(3),
  .prod-price-table-row.head span:nth-child(4) { display: none; }
}

@media (max-width: 900px) {
  .prod-detail-layout--prices .prod-price-stats { grid-template-columns: 1fr 1fr; }
  .prod-detail-layout--prices .prod-price-toolbar-actions { justify-content: stretch; }
  .prod-detail-layout--prices .prod-price-search { width: 100%; min-width: 100%; }
}

/* ── Drawer "Configurar Precio y Estrategia" (dos columnas) ──────────────── */
.price-edit-overlay { position: fixed; inset: 0; z-index: 1400; display: flex; justify-content: flex-end; background: rgba(15,23,42,.42); }
.price-edit-shell { width: min(390px, 100vw); height: 100%; overflow: hidden; background: #fff; box-shadow: -12px 0 32px rgba(15,23,42,.22); animation: price-edit-slide-in .18s ease-out; }
@keyframes price-edit-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.price-edit-drawer { display: flex; flex-direction: column; height: 100%; background: var(--surface-page, #fff); }
.price-edit-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.price-edit-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.price-edit-header small { display: block; margin-top: 2px; color: var(--color-navy-600, #2563eb); font-size: 11px; }
.price-edit-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 17px; padding: 18px 20px; }
.price-edit-cost-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.price-edit-cost-row small { display: block; margin-bottom: 4px; color: var(--text-tertiary); font-size: 9px; font-weight: 700; }
.price-edit-cost-row strong { display: block; font-size: 14px; }
.price-edit-cost-row button { border: 0; padding: 0; background: none; color: var(--color-navy-600, #2563eb); font-size: 10px; text-decoration: underline; cursor: pointer; }
.price-edit-margin { padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-inset); }
.price-edit-margin.ok { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.price-edit-margin.warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.price-edit-margin.danger { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.price-edit-margin > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; }
.price-edit-margin-track { height: 4px; margin: 7px 0 5px; overflow: hidden; border-radius: 999px; background: rgba(100,116,139,.18); }
.price-edit-margin-track span { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.price-edit-margin small { font-size: 9px; }
.price-edit-advanced-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); font-size: 10px; font-weight: 800; letter-spacing: .04em; cursor: pointer; }
.price-edit-advanced { display: flex; flex-direction: column; gap: 16px; }
.price-edit-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-edit-switch-row strong { display: block; font-size: 12px; }
.price-edit-switch-row small { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 9px; }
.price-edit-channels { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 4px; }
.price-edit-channels button { min-width: 0; padding: 7px 3px; border: 0; border-right: 1px solid var(--border-subtle); background: #fff; color: var(--text-secondary); font-size: 9px; cursor: pointer; }
.price-edit-channels button:last-child { border-right: 0; }
.price-edit-channels button.active { background: var(--color-navy-50, #eff6ff); color: var(--color-navy-700, #1d4ed8); font-weight: 800; box-shadow: inset 0 -2px var(--color-navy-600, #2563eb); }
.price-edit-footer { flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 20px 18px; border-top: 1px solid var(--border-color); background: #fff; }
.price-edit-delete { display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; padding: 7px; border: 0; background: transparent; color: #dc2626; font-size: 11px; font-weight: 700; cursor: pointer; }
.price-edit-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-inset); font-size: 11px; }
.price-edit-status-row span { color: var(--text-secondary); }
.price-compare-modal { width: min(760px, 96vw); }
.price-compare-modal .fq-modal-header h3 { margin: 0; }
.price-compare-modal .fq-modal-header small { color: var(--text-secondary); }
.price-compare-table { display: flex; flex-direction: column; min-width: 620px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.price-compare-table > div { display: grid; grid-template-columns: minmax(150px, 1.5fr) repeat(4, minmax(80px, 1fr)); gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 11px; }
.price-compare-table > div:last-child { border-bottom: 0; }
.price-compare-table > div.head { background: var(--surface-inset); color: var(--text-secondary); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.price-compare-table span.ok { color: #15803d; font-weight: 800; }
.price-compare-table span.warn { color: #b45309; font-weight: 800; }
.price-compare-table span.danger { color: #b91c1c; font-weight: 800; }

.pconfig-body { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 300px; gap: 24px; padding: 20px 24px; align-content: start; }
.pconfig-col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pconfig-col-side { display: flex; flex-direction: column; gap: 14px; }

.pconfig-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pconfig-strategy-option.active { background: var(--color-navy-50, #eff6ff) !important; color: var(--color-navy-700, #1d4ed8) !important; font-weight: 800 !important; box-shadow: inset 0 -3px var(--color-navy-600, #2563eb); }

.pconfig-status { background: var(--surface-inset); border-radius: var(--radius-md); padding: 14px 16px; }
.pconfig-status-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--text-tertiary); margin-bottom: 8px; }
.pconfig-status-head strong { font-size: 12px; color: #b45309; }
.pconfig-status-head strong.ok { color: #15803d; }
.pconfig-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pconfig-checklist > div { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); }
.pconfig-checklist > div.ok { color: #15803d; }

.pconfig-simulator { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pconfig-sim-box { position: relative; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; text-align: center; }
.pconfig-sim-box.highlight { border-color: var(--color-navy-300, #93c5fd); background: var(--color-navy-50, #eff6ff); }
.pconfig-sim-box.ok { border-color: #86efac; background: #f0fdf4; }
.pconfig-sim-box.warn { border-color: #fde68a; background: #fffbeb; }
.pconfig-sim-box.danger { border-color: #fca5a5; background: #fef2f2; }
.pconfig-sim-box small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .03em; color: var(--text-tertiary); margin-bottom: 4px; }
.pconfig-sim-box strong { display: block; font-size: 15px; font-weight: 800; }
.pconfig-sim-tag { display: block; font-size: 9px; font-weight: 700; color: var(--text-tertiary); margin-top: 2px; }

/* Indicador competitivo de 4 estados (Muy Competitivo / Competitivo / Precio Alto / Margen Bajo) */
.pconfig-competitiveness { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; }
.pconfig-competitiveness.ok { color: #15803d; background: #f0fdf4; border: 1px solid #86efac; }
.pconfig-competitiveness.warn { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
.pconfig-competitiveness.danger { color: #b91c1c; background: #fef2f2; border: 1px solid #fca5a5; }

.pconfig-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.pconfig-compare-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 10px; text-align: center; }
.pconfig-compare-item small { display: block; font-size: 9px; font-weight: 700; color: var(--text-tertiary); letter-spacing: .03em; margin-bottom: 3px; }
.pconfig-compare-item strong { font-size: 14px; font-weight: 700; }

.pconfig-box { border-radius: var(--radius-md); padding: 14px 16px; font-size: 12px; }
.pconfig-box-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.pconfig-box-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.pconfig-box-row span { color: var(--text-secondary); }
.pconfig-box-row strong.up { color: #b45309; }
.pconfig-box-row strong.down { color: #15803d; }

.pconfig-box.impact { background: var(--color-navy-50, #eff6ff); color: var(--color-navy-900, #1e3a8a); }
.pconfig-box.suggestion { background: #fffbeb; color: #78350f; }
.pconfig-box.suggestion p { margin: 0 0 10px; line-height: 1.4; }
.pconfig-box.commercial { background: #fff7ed; color: #7c2d12; }
.pconfig-box.conflict { background: #fef2f2; color: #b91c1c; display: flex; align-items: flex-start; gap: 8px; }

@media (max-width: 860px) {
  .pconfig-body { grid-template-columns: 1fr; }
  .pconfig-row-2, .pconfig-simulator { grid-template-columns: 1fr 1fr; }
}

.prod-summary-tip {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: var(--space-3);
  padding: 10px 12px;
  background: var(--color-navy-50, #eff6ff);
  border: 1px solid var(--color-navy-100, #dbeafe);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-navy-700, #1d4ed8);
  line-height: 1.5;
}
.prod-summary-tip .mud-icon-root { color: var(--color-navy-500, #2563eb); flex-shrink: 0; margin-top: 1px; }

.prod-steps-list { display: flex; flex-direction: column; gap: 2px; }
.prod-steps-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}
.prod-steps-item.clickable { color: var(--text-primary, #1a1a2e); cursor: pointer; }
.prod-steps-item.clickable:hover { background: var(--surface-inset); }
.prod-steps-item .mud-icon-root.step-check { color: var(--border-subtle); }
.prod-steps-item.clickable .mud-icon-root.step-check { color: var(--color-navy-500, #2563eb); }

@media (max-width: 900px) {
  .prod-new-layout { grid-template-columns: 1fr; }
  .prod-new-side { position: static; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Página "Detalle de Producto" (/products/{id})
   ═══════════════════════════════════════════════════════════════════════════ */
.prod-detail-breadcrumb { font-size: 12px; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
.prod-detail-breadcrumb a { color: var(--color-navy-600, #2563eb); text-decoration: none; }
.prod-detail-breadcrumb a:hover { text-decoration: underline; }

.prod-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prod-detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prod-detail-title-row h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.prod-detail-sku-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-inset); color: var(--text-secondary);
}

.prod-detail-badges { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 100%; }
.prod-detail-badges > div { flex-wrap: wrap; min-width: 0; }
.prod-detail-badges.compact { justify-content: flex-start; gap: 5px; margin-top: 5px; }
.prod-detail-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-inset); color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.prod-detail-badge.clickable { cursor: pointer; }
.prod-detail-badge.clickable:hover { background: var(--color-navy-50, #eff6ff); border-color: var(--color-navy-200, #bfdbfe); }
.prod-detail-badge.ok   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.prod-detail-badge.off  { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.prod-detail-badge.completo   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.prod-detail-badge.incompleto { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.prod-detail-badge.pendiente  { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.prod-detail-badge.critico    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.prod-detail-noimg {
  display: flex; align-items: center; justify-content: center;
  height: 140px; border-radius: var(--radius-md);
  background: var(--surface-inset); color: var(--text-tertiary);
}

.prod-detail-media-card img {
  aspect-ratio: 1 / 1;
  max-height: none !important;
  background: var(--surface-inset);
}

.prod-general-view { display: flex; flex-direction: column; gap: 22px; }
.prod-general-view .prod-detail-section-title { margin-bottom: 10px; color: var(--text-secondary); font-size: 11px; letter-spacing: .04em; }
.prod-general-basic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prod-general-classification-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prod-general-commercial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prod-general-value { min-width: 0; }
.prod-general-value.full { grid-column: 1 / -1; }
.prod-general-value.provider { grid-column: span 2; }
.prod-general-value > small { display: block; margin-bottom: 4px; color: var(--text-tertiary); font-size: 10px; }
.prod-general-value > div {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface-inset);
  color: var(--text-primary);
  font-size: 12px;
}
.prod-general-value > div.strong { font-weight: 700; }
.prod-general-value > div.mono { font-family: var(--font-mono, monospace); }
.prod-general-value > div.mono .mud-icon-root { width: 14px; height: 14px; color: var(--text-tertiary); }
.prod-general-value > div.description { min-height: 68px; align-items: flex-start; line-height: 1.45; }
.prod-general-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px -16px -16px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-inset);
}
.prod-general-footer > span { color: var(--text-tertiary); font-size: 10px; font-style: italic; }
.prod-general-summary h2 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.prod-general-health { margin-bottom: 12px; }
.prod-general-health > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 10px; }
.prod-general-summary-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 2px; font-size: 11px; }
.prod-general-summary-rows strong.ok { color: #16a34a; }
.prod-general-summary-rows strong.off { color: #64748b; }
.prod-general-summary-rows strong.stock { color: var(--brand-primary); }
.prod-general-actions-card { display: flex; flex-direction: column; gap: 7px; border-color: #fde68a !important; }
.prod-general-actions-card .mud-button-root { justify-content: flex-start; width: 100%; min-height: 38px; }
.prod-general-navigation-hint {
  position: fixed;
  right: 28px;
  bottom: 18px;
  z-index: var(--z-sticky);
  width: 190px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  line-height: 1.35;
}
.prod-general-navigation-hint .mud-icon-root { flex: 0 0 auto; width: 14px; height: 14px; }

.prod-detail-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: var(--space-4);
  align-items: start;
}
.prod-detail-layout > div { min-width: 0; }
.prod-detail-layout.prod-detail-layout--stock { grid-template-columns: minmax(0, 1fr); }
.prod-detail-layout--stock > div:first-child,
.prod-detail-layout--stock > div:last-child { display: none; }
.prod-detail-layout.prod-detail-layout--codes { grid-template-columns: minmax(0, 1fr) 300px; }
.prod-detail-layout--codes > div:first-child { display: none; }
.prod-detail-layout.prod-detail-layout--codes > div:last-child { grid-column: auto; }
.prod-detail-layout.prod-detail-layout--prices { grid-template-columns: minmax(0, 1fr) 300px; }
.prod-detail-layout--prices > div:first-child { display: none; }
.prod-detail-layout.prod-detail-layout--prices > div:last-child { grid-column: auto; }
@media (max-width: 1440px) {
  /* Antes el corte era en 1200px: entre 1200 y 1440px las 3 columnas (240 + centro + 300)
     seguían compitiendo por el mismo ancho, dejando muy poco espacio real a las pestañas
     (General/Presentaciones/Códigos de Barras/Precios/Inventario) — MudTabs terminaba
     mostrando las flechas de desplazamiento en vez de las 5 pestañas completas, aun en
     pantallas de laptop normales (~1366-1440px). Subir el corte le da a la columna central
     el ancho completo (menos el panel izquierdo) antes de llegar a ese punto. */
  .prod-detail-layout { grid-template-columns: 220px 1fr; }
  .prod-detail-layout > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .prod-detail-layout { grid-template-columns: 1fr; }
  .prod-detail-layout.prod-detail-layout--codes { grid-template-columns: 1fr; }
  .prod-detail-layout--codes > div:last-child { display: none; }
  .prod-detail-layout.prod-detail-layout--prices { grid-template-columns: 1fr; }
  .prod-detail-layout--prices > div:last-child { display: none; }
  .prod-general-classification-grid, .prod-general-commercial-grid { grid-template-columns: 1fr; }
  .prod-general-value.provider { grid-column: auto; }
  .prod-general-basic-grid { grid-template-columns: 1fr; }
}

/* SaaS Billing Control — B5 */
.billing-admin { display: flex; flex-direction: column; gap: 18px; max-width: 1500px; margin: 0 auto; }
.billing-heading { display: flex; align-items: center; gap: 14px; }
.billing-heading h1 { margin: 1px 0; font-size: 24px; }
.billing-heading small,.billing-heading span { color: var(--text-secondary); }
.billing-heading__actions { display: flex; gap: 8px; margin-left: auto; }
.billing-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border-subtle); }
.billing-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 11px 14px; background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.billing-tabs button.active { color: var(--text-primary); border-bottom-color: #111827; }
.billing-summary-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(260px,.7fr); gap: 16px; }
.billing-decision,.billing-balance-card { padding: 22px; border: 1px solid var(--border-subtle); border-radius: 8px; background: white; }
.billing-decision { border-left: 5px solid #64748b; }
.billing-decision--allowed { border-left-color: #059669; }
.billing-decision--grace,.billing-decision--exceptional { border-left-color: #d97706; }
.billing-decision--restricted,.billing-decision--suspended { border-left-color: #dc2626; }
.billing-decision > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.billing-decision h2 { margin: 20px 0 5px; font-size: 22px; }
.billing-summary-line { color: var(--text-secondary); font-weight: 700; }
.billing-balance-card { display: flex; flex-direction: column; gap: 8px; }
.billing-balance-card > strong { margin: 12px 0; font-size: 30px; }
.billing-balance-card span,.billing-balance-card p { color: var(--text-secondary); font-size: 11px; }
.billing-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 18px 0 0; }
.billing-metrics div { padding: 10px; background: #f8fafc; }
.billing-metrics dt { color: var(--text-tertiary); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.billing-metrics dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.billing-source-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px; }
.billing-source-list div { display: flex; flex-direction: column; padding: 10px; background: #f8fafc; }
.billing-source-list span,.billing-source-list small { color: var(--text-secondary); font-size: 10px; overflow-wrap: anywhere; }
.billing-attention { margin: 14px 0 0; color: #b45309; font-weight: 700; }
.billing-table-wrap { overflow-x: auto; }
.billing-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.billing-table th { padding: 9px; background: #f8fafc; color: var(--text-tertiary); font-size: 9px; text-align: left; text-transform: uppercase; }
.billing-table td { padding: 12px 9px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; font-size: 11px; }
.billing-table td > strong,.billing-table td > span,.billing-table td > small { display: block; }
.billing-table td > small { margin-top: 4px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.billing-table--compact { min-width: 650px; }
.billing-row--legacy { background: #fffbeb; }
.billing-row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.billing-row-actions button,.billing-link-danger { min-height: 30px; border: 1px solid #93c5fd; border-radius: 5px; padding: 5px 9px; background: #eff6ff; color: #1e40af; font-size: 10px; font-weight: 800; cursor: pointer; }
.billing-row-actions button:hover,.billing-row-actions button:focus-visible { border-color: #2563eb; background: #dbeafe; outline: 2px solid transparent; }
.billing-row-actions button.danger,.billing-link-danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.billing-link-danger:hover,.billing-link-danger:focus-visible { border-color: #dc2626; background: #fee2e2; }
.billing-charge { margin-top: 12px; border: 1px solid var(--border-subtle); border-radius: 7px; overflow: hidden; }
.billing-charge > header { display: flex; justify-content: space-between; gap: 10px; padding: 14px; background: #f8fafc; }
.billing-charge > header > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.billing-charge__totals { display: flex; justify-content: flex-end; gap: 18px; padding: 10px 14px; }
.billing-empty { display: flex; flex-direction: column; gap: 4px; padding: 28px; text-align: center; color: var(--text-secondary); }
.billing-empty-inline { padding: 12px 14px; color: var(--text-secondary); }
.billing-override { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.billing-override div { display: flex; flex-direction: column; gap: 3px; }
.billing-override > .billing-link-danger { align-self: flex-start; flex: 0 0 auto; }
.billing-override p { margin: 5px 0; }
.billing-override span,.billing-override small { color: var(--text-secondary); font-size: 10px; }
.billing-timeline article { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); }
.billing-timeline time,.billing-timeline small { color: var(--text-secondary); font-size: 10px; overflow-wrap: anywhere; }
.billing-timeline p { margin: 4px 0; }
.billing-field { display: flex; flex-direction: column; gap: 5px; margin: 11px 0; font-size: 11px; font-weight: 700; }
.billing-field input,.billing-field select,.billing-field textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: white; color: var(--text-primary); font: inherit; font-weight: 500; }
.billing-field textarea { min-height: 75px; resize: vertical; }
.billing-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.billing-dialog-note { padding: 9px; background: #fffbeb; color: #92400e; font-size: 11px; }
.billing-section-help { max-width: 780px; margin: -8px 0 16px; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.billing-technical { margin-top: 7px; color: var(--text-secondary); font-size: 10px; }
.billing-technical summary { width: fit-content; cursor: pointer; color: #475569; font-weight: 700; }
.billing-technical code { display: block; margin-top: 5px; padding: 6px 8px; border-radius: 4px; background: #f1f5f9; color: #334155; overflow-wrap: anywhere; white-space: normal; }

.fq-commercial-banner { display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-bottom: 1px solid; font-size: 12px; font-weight: 650; }
.fq-commercial-banner--grace { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.fq-commercial-banner--exceptional { border-color: #d97706; background: #fff7ed; color: #9a3412; }
.commercial-access-page { width: min(680px, calc(100% - 32px)); margin: 56px auto; padding: 36px; border: 1px solid var(--border-subtle); border-top: 5px solid #dc2626; border-radius: 10px; background: white; text-align: center; box-shadow: 0 16px 40px rgba(15,23,42,.08); }
.commercial-access-page__icon { font-size: 44px; color: #dc2626; }
.commercial-access-page__eyebrow { display: block; margin-top: 10px; color: #b91c1c; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.commercial-access-page h1 { margin: 8px 0; font-size: 28px; }
.commercial-access-page__reason { color: var(--text-secondary); font-size: 14px; }
.commercial-access-page__facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 24px 0; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--border-subtle); text-align: left; }
.commercial-access-page__facts div { padding: 14px; background: white; }
.commercial-access-page__facts dt { color: var(--text-tertiary); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.commercial-access-page__facts dd { margin: 5px 0 0; font-weight: 700; }
.commercial-access-page__help { padding: 16px; border-radius: 7px; background: #f8fafc; text-align: left; }
.commercial-access-page__help p { margin: 5px 0 0; color: var(--text-secondary); }
.commercial-access-page__logout { display: inline-block; margin-top: 20px; color: #475569; font-weight: 700; }

@media(max-width:900px) {
    .billing-summary-grid { grid-template-columns: 1fr; }
    .billing-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 700px) {
    .commercial-access-page { margin: 20px auto; padding: 24px 18px; }
    .commercial-access-page__facts { grid-template-columns: 1fr; }
    .fq-commercial-banner { padding-inline: 14px; align-items: flex-start; }
}
@media(max-width:600px) {
    .billing-heading { align-items: flex-start; flex-wrap: wrap; }
    .billing-heading__actions { width: 100%; margin-left: 0; }
    .billing-metrics,.billing-form-grid { grid-template-columns: 1fr; }
    .billing-charge > header,.billing-override { flex-direction: column; }
    .billing-row-actions { width: 100%; }
    .billing-row-actions button { flex: 1 1 auto; }
    .billing-timeline article { grid-template-columns: 1fr; gap: 4px; }
}

.prod-detail-tabs .mud-tabs-toolbar {
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
}
/* Margen de seguridad adicional: aun con más ancho disponible (ver breakpoint 1440px arriba),
   las 5 pestañas con el padding por defecto de MudBlazor quedan justas en pantallas medianas.
   Achicar el padding/tamaño de letra de cada pestaña reduce el ancho total necesario sin tener
   que truncar ningún texto — así se evitan las flechas de desplazamiento en más resoluciones. */
.prod-detail-tabs .mud-tab {
  padding: 0 14px;
  font-size: 13px;
  min-width: 0;
}

.prod-detail-section-title { display: flex; align-items: center; gap: 6px; }
.prod-detail-section-title .mud-icon-root { color: var(--color-navy-500, #64748b); width: 15px; height: 15px; }

/* Tablero de stock del producto */
.product-stock-page { padding: 14px; background: var(--surface-inset); }
.product-stock-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.product-stock-kpi {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-base);
}
.product-stock-kpi small,
.product-stock-presentations small {
  display: block;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.product-stock-kpi strong { display: block; margin-top: 4px; font-size: 18px; }
.product-stock-kpi strong span,
.product-stock-presentations strong span { font-size: 11px; font-weight: 500; }
.product-stock-kpi.available strong { color: #166534; }
.product-stock-kpi.reserved strong { color: #d97706; }
.product-stock-kpi.transit strong { color: #0284c7; }
.product-stock-kpi.committed strong { color: #7c3aed; }

.product-stock-dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.product-stock-main,
.product-stock-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.product-stock-card { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-base); }
.product-stock-card.compact { padding: 12px; }
.product-stock-card.compact > h4 { margin: 0 0 12px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.product-stock-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-inset);
}
.product-stock-card-head.no-border { margin: -12px -12px 6px; }
.product-stock-card-head h3,
.product-stock-section-title {
  display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 800;
}
.product-stock-card-head .mud-icon-root,
.product-stock-section-title .mud-icon-root { color: var(--brand-primary); }
.product-stock-status { padding: 3px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.product-stock-status.ok, .product-stock-health-row strong.ok { background: #dcfce7; color: #15803d; }
.product-stock-status.warning, .product-stock-health-row strong.warning { background: #fef3c7; color: #b45309; }
.product-stock-status.danger, .product-stock-health-row strong.danger { background: #fee2e2; color: #b91c1c; }

.product-stock-analysis-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px; }
.product-stock-capacity-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--text-secondary); font-size: 11px; }
.product-stock-capacity-label strong { color: var(--text-primary); }
.product-stock-rules { margin-top: 12px; }
.product-stock-rules > div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 11px; }
.product-stock-rules > div:last-child { border: 0; }
.product-stock-rules .reorder strong { color: var(--brand-primary); }
.product-stock-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product-stock-metrics > div { padding: 12px; border-radius: 5px; background: var(--surface-inset); }
.product-stock-metrics small { display: block; color: var(--text-tertiary); font-size: 10px; }
.product-stock-metrics strong { display: block; margin-top: 4px; color: #166534; font-size: 16px; }
.product-stock-metrics .reserved strong { color: #d97706; }
.product-stock-metrics .transit strong { color: #0284c7; }
.product-stock-metrics .committed strong { color: #7c3aed; }

.product-stock-section-title { margin: 0 0 8px; }
.product-stock-warehouses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.product-stock-warehouse { padding: 12px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-base); }
.product-stock-warehouse.active { border-color: #93c5fd; }
.product-stock-warehouse.unavailable { opacity: .65; }
.product-stock-warehouse-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.product-stock-warehouse-title .mud-icon-root { color: var(--brand-primary); }
.product-stock-warehouse > div:not(.product-stock-warehouse-title) { display: flex; justify-content: space-between; padding: 3px 0; font-size: 11px; }
.product-stock-warehouse p { margin: 14px 0 0; color: var(--text-secondary); font-size: 11px; }

.product-stock-presentations { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 12px; }
.product-stock-presentations > div { padding: 12px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--surface-inset); }
.product-stock-presentations > div.primary { border-color: #93c5fd; background: #eff6ff; }
.product-stock-presentations strong { display: block; margin-top: 3px; font-size: 17px; }

.product-stock-health-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 11px; }
.product-stock-health-row > span { color: var(--text-secondary); }
.product-stock-health-row small { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 9px; }
.product-stock-health-row strong { padding: 3px 6px; border-radius: 4px; font-size: 10px; }
.product-stock-risk { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 11px; }
.product-stock-risk.ok .mud-icon-root { color: #16a34a; }
.product-stock-risk.warning .mud-icon-root { color: #d97706; }
.product-stock-risk.danger .mud-icon-root { color: #dc2626; }
.product-stock-suggestion { padding: 12px; border-radius: 8px; background: #155eef; color: #fff; }
.product-stock-suggestion h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 11px; text-transform: uppercase; }
.product-stock-suggestion p { margin: 0; font-size: 11px; line-height: 1.5; }
.product-stock-trend { height: 72px; display: flex; align-items: end; gap: 3px; margin: 8px 0 12px; }
.product-stock-trend span { flex: 1; min-height: 6px; border-radius: 2px 2px 0 0; background: #2563eb; opacity: .35; }
.product-stock-trend span:last-child { opacity: 1; }
.product-stock-projection { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10px; }
.product-stock-projection.warning strong { color: #d97706; }
.product-stock-recent > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: 10px; }
.product-stock-recent > div:last-child { border: 0; }
.product-stock-recent small { display: block; color: var(--text-tertiary); font-size: 9px; }
.product-stock-recent strong.positive { color: #16a34a; }
.product-stock-recent strong.negative { color: #dc2626; }

@media (max-width: 1050px) {
  .product-stock-dashboard { grid-template-columns: 1fr; }
  .product-stock-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .product-stock-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-stock-analysis-body, .product-stock-warehouses, .product-stock-side { grid-template-columns: 1fr; }
}

.prod-detail-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.prod-detail-field {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.prod-detail-field small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.prod-detail-field div { font-size: 14px; color: var(--text-primary, #1a1a2e); }

/* ── Tarjetas de Presentaciones (tab de detalle) ─────────────────────────── */
.prod-pres-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
.prod-pres-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--text-tertiary); font-size: 10px; }
.prod-pres-overview > strong { color: var(--text-primary); font-size: 11px; }
.prod-pres-overview b { color: var(--brand-primary); }
.prod-pres-filter { display: flex; align-items: center; gap: 4px; padding: 10px 0 12px; color: var(--text-tertiary); font-size: 9px; font-style: italic; }
.prod-pres-filter button { padding: 0; border: 0; background: transparent; color: var(--text-tertiary); font: inherit; cursor: pointer; }
.prod-pres-filter button:hover, .prod-pres-filter button.active { color: var(--brand-primary); text-decoration: underline; }
.prod-pres-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prod-pres-card { min-height: 220px; display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px; background: var(--surface-base); }
.prod-pres-card.primary { border-color: var(--color-navy-400, #60a5fa); border-left: 4px solid var(--brand-primary); background: #f8fbff; box-shadow: none; }
.prod-pres-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prod-pres-card-header strong { font-size: 14px; }
.prod-pres-badge { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; }
.prod-pres-badge.primary { background: #dbeafe; color: #1d4ed8; }
.prod-pres-badge.warn { background: #fef3c7; color: #92400e; }
.prod-pres-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; flex-wrap: wrap; }
.prod-pres-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prod-pres-dot.ok { background: #16a34a; }
.prod-pres-dot.off { background: #9ca3af; }
.prod-pres-tag { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; background: var(--surface-inset); color: var(--text-secondary); }
.prod-pres-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.prod-pres-body small { display: block; font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.prod-pres-body > div > div { font-size: 13px; font-weight: 600; }
.prod-pres-noprice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.prod-pres-noprice > span { font-size: 12px; font-weight: 600; color: var(--color-amber-600, #b45309); }
.prod-pres-configure-link { padding: 0; border: 0; background: transparent; color: var(--brand-primary); font-size: 11px; font-weight: 600; cursor: pointer; }
.prod-pres-configure-link:hover { text-decoration: underline; }
.prod-pres-uso { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-secondary); padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.prod-pres-uso span { display: flex; align-items: center; gap: 4px; }
.prod-pres-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.prod-pres-footer small { font-size: 11px; color: var(--text-tertiary); }
.prod-pres-footer > div { display: flex; align-items: center; gap: 5px; }
.prod-pres-footer > div strong { font-size: 9px; color: #16a34a; }
.prod-pres-audit-footer { margin-top: 16px; }
.prod-pres-last-change { display: block; margin-top: 5px; color: var(--text-tertiary); font-size: 9px; font-style: italic; }
.prod-side-navigation-hint { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 14px; padding: 8px 10px; border: 1px solid #dbeafe; border-radius: 5px; background: #eff6ff; color: #1d4ed8; font-size: 9px; line-height: 1.35; }
.prod-side-navigation-hint .mud-icon-root { flex: 0 0 auto; width: 13px; height: 13px; }

@media (max-width: 1050px) {
  .prod-pres-grid { grid-template-columns: 1fr; }
}

.prod-quickinfo { display: flex; flex-direction: column; gap: 0; }
.prod-quickinfo > div { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.prod-quickinfo > div:last-child { border-bottom: 0; }
.prod-quickinfo > div:nth-child(5) { display: grid; grid-template-columns: 1fr auto; align-items: start; }
.prod-quickinfo > div:nth-child(5) .prod-quickinfo-stock-detail { grid-column: 1 / -1; }
.prod-quickinfo span { font-size: 12px; color: var(--text-tertiary); }
.prod-quickinfo strong { font-size: 13px; font-weight: 600; color: var(--text-primary, #1a1a2e); text-align: right; }
.prod-quickinfo-stock { font-size: 17px !important; font-weight: 700 !important; }
.prod-quickinfo-stock-detail { display: flex; gap: 14px; margin-top: 2px; }
.prod-quickinfo-stock-detail span { font-size: 11px; color: var(--text-tertiary); display: flex; gap: 3px; }
.prod-quickinfo-stock-detail strong { font-size: 11px; font-weight: 700; color: var(--text-secondary); }

/* Ticket */
.fq-ticket { display: flex; flex-direction: column; gap: var(--space-4); }
.fq-ticket-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.fq-ticket-header h4 { margin: 0; font-size: var(--text-lg); font-weight: 800; }
.fq-ticket-num { margin: 0; font-size: var(--text-md); color: var(--text-secondary); }
.fq-ticket-customer { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); color: var(--text-secondary); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
.fq-ticket-items { display: flex; flex-direction: column; gap: var(--space-2); max-height: 180px; overflow-y: auto; padding: var(--space-2) 0; }
.fq-ticket-line { display: flex; justify-content: space-between; font-size: var(--text-base); }
.fq-ticket-line small { color: var(--text-tertiary); }
.fq-ticket-totals { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.fq-auth-shell { min-height: 100vh; background: linear-gradient(135deg, var(--color-navy-950) 0%, var(--color-navy-900) 55%, var(--color-navy-700) 100%); display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.fq-login-bg { width: 100%; display: grid; place-items: center; }
.fq-login-card { width: 100%; max-width: 420px; background: var(--surface-base); border-radius: var(--radius-2xl); padding: var(--space-10) var(--space-8) var(--space-8); box-shadow: var(--shadow-2xl); }
.fq-branch-card { max-width: 460px; }
.fq-login-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-7); font-size: var(--text-xl); font-weight: 900; color: var(--brand-nav); }
.fq-login-brand strong { color: var(--color-green-600); }
.fq-login-brand-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--brand-nav); color: #fff; font-size: var(--text-sm); font-weight: 900; }
.fq-login-title { margin: 0 0 var(--space-1); font-size: var(--text-2xl); font-weight: 900; letter-spacing: -.02em; }
.fq-login-sub { margin: 0 0 var(--space-5); color: var(--text-secondary); font-size: var(--text-md); }
.fq-login-field { margin-bottom: var(--space-4); }
.fq-login-btn { margin-top: var(--space-2); height: 46px; font-size: var(--text-md) !important; font-weight: 700 !important; }
.fq-login-footer { margin: var(--space-6) 0 0; text-align: center; color: var(--text-tertiary); font-size: var(--text-sm); }
.fq-login-back { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); padding: 0; background: none; border: none; color: var(--text-secondary); font-size: var(--text-base); cursor: pointer; transition: color var(--transition-fast); }
.fq-login-back:hover { color: var(--text-primary); }
.fq-branch-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-2); }
.fq-branch-item { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1.5px solid var(--border-default); border-radius: var(--radius-lg); background: var(--surface-base); cursor: pointer; transition: border-color var(--transition-base), box-shadow var(--transition-base); text-align: left; width: 100%; }
.fq-branch-item:hover:not(:disabled) { border-color: var(--color-green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.10); }
.fq-branch-item--loading { border-color: var(--color-green-500); background: var(--color-green-50); }
.fq-branch-item:disabled { opacity: .55; cursor: default; }
.fq-branch-item-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--color-navy-100); color: var(--color-navy-600); flex-shrink: 0; }
.fq-branch-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fq-branch-item-info strong { font-size: var(--text-md); font-weight: 700; }
.fq-branch-item-info small { color: var(--text-secondary); font-size: var(--text-sm); }
.fq-branch-arrow { color: var(--text-tertiary); }

/* ── Utilidades ──────────────────────────────────────────────────────────── */
.fq-splash { display: grid; place-items: center; height: 100vh; }
.fq-splash-content { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-secondary); }
.fq-splash-content a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.fq-splash-content a:hover { text-decoration: underline; }
.fq-action-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.fq-divider { height: 1px; background: var(--border-subtle); margin: var(--space-4) 0; }
#blazor-error-ui { display: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .fq-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fq-dashboard-grid { grid-template-columns: 1fr; }
  .fq-pos-layout { grid-template-columns: 1fr 300px; }
  .fq-pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 900px) {
  .fq-topbar { height: auto; flex-direction: column; align-items: flex-start; padding: var(--space-4); }
  .fq-topbar-actions, .fq-search, .fq-search--desktop { width: 100%; }
  .fq-content { padding: var(--space-4); }
  .fq-page-header { flex-direction: column; align-items: stretch; }
  .fq-kpi-grid { grid-template-columns: 1fr; }
  .fq-form-grid { grid-template-columns: 1fr; }
  .fq-form-span2 { grid-column: span 1; }
  .fq-inv-line { grid-template-columns: 1fr 90px auto; }
  .fq-inv-line > :nth-child(3) { display: none; }
  .fq-pos-layout { grid-template-columns: 1fr; height: auto; }
  .fq-pos-cart { max-height: 400px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   POS REDISEÑO — layout tipo Precision POS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shell fullscreen — sin padding del fq-content */
.pos-shell {
  display: flex;
  flex-direction: column;
  /* Ocupa todo el espacio disponible debajo del topbar principal */
  height: calc(100vh - 58px - var(--space-6) * 2);
  overflow: hidden;
  background: var(--surface-app);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* Toolbar unificado: lista de precios integrada junto al buscador. */
.pos-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 160px minmax(0, 1fr) auto;
  grid-template-areas: "search pricelist cats cash";
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}

.pos-search-wrap { min-width: 0; grid-area: search; }
.pos-search-field { width: 100%; }

/* Estado enfocado (POS-UI-006) — MudTextField ya trae su propio borde, esto añade un halo
   sobre el contenedor para que el estado "listo para escanear" se note incluso a distancia.
   Mismo color que el resto de estados activos del toolbar (badge de lista de precios, tabs). */
.pos-search-wrap:focus-within .pos-search-field .mud-input-outlined-border {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(22, 92, 174, .15);
}

/* Categorías: fila con scroll + flechas + menú "Más categorías" (POS-UI-012) — el wrap
   contiene la fila scrolleable y los controles; sin esto el usuario dependía de arrastrar
   la fila a ciegas (scrollbar oculta) para llegar a categorías fuera de vista. */
.pos-cats-wrap {
  grid-area: cats;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.pos-cats-inline {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  scroll-behavior: smooth;
}
.pos-cats-inline::-webkit-scrollbar { display: none; }

.pos-cats-scroll-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-base);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pos-cats-scroll-btn:hover { background: var(--surface-inset); color: var(--text-primary); }

.pos-cats-more-btn { flex-shrink: 0; }
.pos-cats-more-btn .mud-button-root { min-width: 0; padding: 4px; }

/* Badge caja */
.pos-caja-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-green-50);
  color: var(--color-green-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}

.pos-caja-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-green-500); }
.pos-caja-dot.open   { background: var(--color-green-500); }
.pos-caja-dot.closed { background: var(--color-red-400); }

.pos-caja-badge--closed {
  background: var(--color-red-50);
  color: var(--color-red-700);
}

/* Badge lista de precios */
.pos-pricelist-badge {
  grid-area: pricelist;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 160px;
  max-width: 100%;
  min-height: 34px;
  padding: 4px var(--space-2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.pos-pricelist-badge > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-pricelist-badge:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pos-pricelist-badge--active {
  background: #eff6ff;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* Selector de listas comerciales y bloque separado de precio de respaldo. */
.pos-pricelist-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pos-pricelist-section-label {
  padding: 2px 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.pos-pricelist-section-label--fallback {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.pos-pricelist-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-base);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.pos-pricelist-option:hover {
  background: var(--surface-inset);
  border-color: var(--brand-primary);
}

.pos-pricelist-option--active {
  background: var(--color-navy-50);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 1px rgba(30, 94, 168, .18);
}

.pos-pricelist-option--fallback:not(.pos-pricelist-option--active) {
  border-style: dashed;
  color: var(--text-secondary);
}

.pos-pricelist-option--fallback {
  cursor: default;
}

.pos-pricelist-option--fallback:hover {
  background: var(--surface-base);
  border-color: var(--border-subtle);
}

.pos-pricelist-option--fallback.pos-pricelist-option--active:hover {
  background: var(--color-navy-50);
  border-color: var(--brand-primary);
}

.pos-pricelist-option-main,
.pos-pricelist-option-active {
  display: inline-flex;
  align-items: center;
}

.pos-pricelist-option-main {
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}

.pos-pricelist-option-name {
  font-weight: 650;
}

.pos-pricelist-option-fallback-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pos-pricelist-option-fallback-copy small {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}

.pos-pricelist-option-default,
.pos-pricelist-option-active {
  border-radius: var(--radius-full);
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .25px;
  text-transform: uppercase;
}

.pos-pricelist-option-default {
  background: var(--color-green-100);
  color: var(--color-green-700);
}

.pos-pricelist-option-active {
  gap: 2px;
  background: var(--color-navy-100);
  color: var(--color-navy-700);
  white-space: nowrap;
}

.pos-pricelist-option-active .mud-icon-root {
  font-size: 14px;
}

.pos-pricelist-option-count {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.pos-pricelist-option-automatic {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-cash-context {
  grid-area: cash;
  justify-self: end;
}

/* En laptop, buscador/lista/caja quedan arriba y las categorías usan una segunda línea.
   En escritorio amplio todo cabe en una sola fila. */
@media (max-width: 1500px) and (min-width: 901px) {
  .pos-toolbar {
    grid-template-columns: minmax(280px, 1fr) 160px auto;
    grid-template-areas:
      "search pricelist cash"
      "cats cats cats";
    row-gap: var(--space-1);
  }
}

/* Barra de categorías independiente (solo visible en móvil) */
.pos-cats-bar {
  display: none;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex-shrink: 0;
}

.pos-cat-btn {
  flex-shrink: 0;
  padding: 6px var(--space-4);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pos-cat-btn:hover { background: var(--surface-inset); color: var(--text-primary); }
.pos-cat-btn--active { background: var(--color-slate-900); color: #fff; }

/* Body split */
.pos-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Área catálogo */
.pos-catalog-area {
  overflow-y: auto;
  padding: var(--space-4);
  /* min-height:0 is required on a CSS grid child that scrolls internally —
     without it, the child uses its min-content as a floor and "blows out" the
     grid row instead of scrolling, pushing the order panel off-screen at short
     viewport heights (e.g. laptop 1366×768 with a long catalog). POS-UI-001/004. */
  min-height: 0;
}

.pos-loading { display: flex; justify-content: center; padding: var(--space-10); }

/* Grid productos */
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: var(--space-3);
  align-content: start;
}

/* Tarjeta producto — flex en columna + height:100% para recibir el stretch que la grilla ya
   aplica por fila (comportamiento por defecto de CSS Grid): así todas las tarjetas de una misma
   fila terminan con igual altura, y no cambian por tener presentación, promoción o nombre de
   dos líneas (POS-UI-007). */
.pos-product-card {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: default;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pos-product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pos-product-card--oos { opacity: .5; }

/* Imagen / avatar */
.pos-product-img {
  position: relative;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pos-product-initials {
  font-size: 28px;
  font-weight: 900;
  color: rgba(0,0,0,.25);
  user-select: none;
}

/* Estado de stock (POS-UI-010) — en su propia fila dentro del cuerpo, NO superpuesto a la
   imagen: un badge flotante con el texto largo requerido ("Stock bajo · N") tapaba buena parte
   de imágenes pequeñas en laptop. Texto siempre explícito, nunca depende solo del color;
   max-width con ellipsis por seguridad en tarjetas angostas con nombres/cantidades largas. */
.pos-stock-pill {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 3px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-stock-pill--ok  { background: var(--color-green-100); color: var(--color-green-700); }
.pos-stock-pill--low { background: var(--color-amber-100); color: var(--color-amber-600); }
.pos-stock-pill--oos { background: var(--color-red-100);   color: var(--color-red-600);   }

/* Cuerpo de la tarjeta — flex:1 dentro de la tarjeta (ver .pos-product-card) para que el footer
   pueda anclarse abajo con margin-top:auto, sin importar cuántas líneas ocupe el nombre. */
.pos-product-body {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pos-product-sku {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.pos-product-name-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: var(--space-2);
}

/* Antes se truncaba a una sola línea — con la etiqueta de presentación (PACK X 6) ocupando
   espacio al lado, el nombre se cortaba demasiado rápido y el cajero no alcanzaba a leer qué
   producto era. Ahora se permiten 2 líneas antes de truncar. */
.pos-product-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

/* Tarjeta de una presentación no principal (ej. "Pack x6") — misma tarjeta que el producto,
   distinguida por esta etiqueta junto al nombre. flex-shrink:0 para que el ellipsis del nombre
   se la coma a ella primero, no al revés (antes el nombre largo se tragaba la etiqueta entera). */
.pos-product-presentation-tag {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-navy-100, #e0e7ff);
  color: var(--color-navy-700, #3730a3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* margin-top:auto ancla el footer al fondo de la tarjeta (ver .pos-product-body flex:1) — así
   el precio y el botón "+" quedan alineados entre tarjetas de la misma fila sin importar si el
   nombre ocupó una o dos líneas, o si la tarjeta muestra etiqueta de presentación (POS-UI-007). */
.pos-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-2);
}

.pos-product-price {
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--text-primary);
}

.pos-add-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--color-slate-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  padding: 0;
}

.pos-add-btn:hover:not(:disabled) { background: var(--color-navy-600); transform: scale(1.1); }
.pos-add-btn:disabled { background: var(--color-slate-300); cursor: not-allowed; }

/* Panel orden */
.pos-order-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface-base);
  border-left: 1px solid var(--border-subtle);
  overflow: hidden;
  /* Same reason as .pos-catalog-area: without min-height:0 this grid child can
     grow with the cart contents and push pos-totals/pos-actions off-screen
     instead of letting .pos-order-items scroll on its own. POS-UI-004. */
  min-height: 0;
}

/* Cliente */
.pos-order-customer {
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pos-customer-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: .08em;
  margin-bottom: var(--space-2);
}

.pos-customer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pos-customer-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pos-customer-name { font-size: var(--text-base); font-weight: 700; }
.pos-customer-sub  { font-size: var(--text-xs); color: var(--text-tertiary); }

/* Toggle Boleta/Factura */
.pos-doc-toggle {
  display: flex;
  margin: 0 var(--space-4);
  padding: var(--space-2) 0;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pos-doc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pos-doc-btn:hover { border-color: var(--color-navy-400); color: var(--text-primary); }
.pos-doc-btn--active { background: var(--color-navy-600); border-color: var(--color-navy-600); color: #fff; }

/* Header items */
.pos-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* Items del carrito */
.pos-order-items {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-4);
  /* min-height:0 on a flex child with flex:1 + its own overflow — same reason as
     .pos-order-panel above. Without it, a long list pushes pos-totals/pos-actions
     instead of scrolling internally. POS-UI-004. */
  min-height: 0;
}

.pos-order-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
  color: var(--text-tertiary);
  text-align: center;
}

.pos-order-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color .6s ease;
}

/* Resaltado breve al agregar/incrementar una línea (POS-UI-018) — la clase se quita desde
   C# ~800ms después (Pos.razor.cs, ClearHighlightAfterDelayAsync), esta transición es lo que
   hace que el fondo se desvanezca en vez de desaparecer de golpe. */
.pos-order-item--added {
  background-color: rgba(22, 163, 74, .12);
}

/* Línea de la orden en dos filas (POS-UI-003) — antes competían 5 controles (nombre, cantidad,
   importe, descuento, eliminar) en una sola fila: el nombre se truncaba a una línea y el nombre
   no distinguía Unidad de Pack. Fila 1 = identidad + importe + eliminar; fila 2 = precio unitario
   + cantidad + descuento. align-items:flex-start en la fila 1 para que el importe y "eliminar"
   no se desplacen cuando el nombre ocupa su segunda línea. */
.pos-order-item-row-1 {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.pos-order-item-row-2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  /* 44px = 36px del avatar + 8px de gap de la fila 1 — alinea esta fila (sin avatar) bajo el
     nombre, mismo criterio que ya usaba .pos-order-item-discount-row. */
  padding: 4px 0 0 44px;
}

.pos-order-item:last-child { border-bottom: 0; }

.pos-order-item-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 900;
  color: rgba(0,0,0,.3);
  flex-shrink: 0;
}

.pos-order-item-info { flex: 1; min-width: 0; }

.pos-order-item-name-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

/* Hasta dos líneas (POS-UI-003) — antes se truncaba a una sola línea con ellipsis, así que un
   nombre largo se cortaba y el cajero no alcanzaba a confirmar qué producto era. */
.pos-order-item-name {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

/* Distingue Unidad de Pack en el propio carrito — antes ambas líneas de un mismo producto
   mostraban el mismo nombre y solo se diferenciaban por el precio. */
.pos-order-item-presentation-tag {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-navy-100, #e0e7ff);
  color: var(--color-navy-700, #3730a3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pos-order-item-price-fallback {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  color: var(--color-amber-600);
  font-size: 10px;
  font-weight: 700;
}

.pos-order-item-price-fallback .mud-icon-root {
  font-size: 13px;
}

.pos-order-item-price { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }

.pos-order-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pos-qty-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-default);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
  color: var(--text-primary);
}

.pos-qty-btn:hover { background: var(--surface-inset); }
.pos-qty-val { min-width: 22px; text-align: center; font-size: var(--text-base); font-weight: 700; }
.pos-qty-input {
  width: 40px;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 700;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1px 2px;
  background: var(--surface-card);
  color: var(--text-primary);
  -moz-appearance: textfield;
}
.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pos-qty-input:focus { outline: none; border-color: var(--color-navy-500); }

/* Botón % descuento línea */
.pos-line-discount-btn {
  background: transparent;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.pos-line-discount-btn:hover { border-color: var(--color-green-500); color: var(--color-green-600); }
.pos-line-discount-btn--active { border-color: var(--color-green-500); color: var(--color-green-600); background: #f0fdf4; }

/* Fila de descuento expandible */
.pos-order-item-discount-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 0 2px 44px;
}
.pos-line-discount-label { font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; }
.pos-line-discount-field { width: 80px; flex-shrink: 0; }
.pos-line-discount-field .mud-input-outlined-border { min-height: 28px !important; }
.pos-line-discount-field input { padding: 4px 6px !important; font-size: 12px !important; text-align: center; }
.pos-line-discount-amount { font-size: var(--text-xs); color: var(--color-green-700); font-weight: 600; white-space: nowrap; margin-left: auto; }

.pos-item-del-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.pos-item-del-btn:hover { color: var(--color-red-500); background: var(--color-red-50, #fef2f2); }

/* flex-shrink:0 — el importe nunca se corta, incluso con montos de 4+ dígitos (POS-UI-003):
   sin esto, un nombre largo en la misma fila podía comprimirlo. */
.pos-order-item-total { font-size: var(--text-base); font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* Totales */
/* ── Descuento inline en totales ─────────────────────────────────────────── */
.pos-discount-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.pos-discount-pct-wrap {
  width: 80px;
  flex-shrink: 0;
}

/* Reduce altura del MudNumericField de descuento */
.pos-discount-pct-field .mud-input-outlined-border { min-height: 28px !important; }
.pos-discount-pct-field input { padding: 4px 6px !important; font-size: 12px !important; text-align: center; }

.pos-discount-error {
  display: block;
  font-size: 11px;
  color: var(--color-red-500);
  padding: 0 var(--space-4);
}

/* Texto secundario "Autorizado por ..." — descuento global (POS-UI-020) usa el padding del
   total (--space-4); el de línea (dentro de .pos-order-item-discount-row) hereda el mismo
   sangrado que el resto de esa fila (44px, ver esa regla) para alinear con el ícono/label. */
.pos-discount-authorized-by {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 var(--space-4);
}
.pos-order-item-discount-row + .pos-discount-authorized-by {
  padding: 0 0 4px 44px;
  margin-top: -2px;
}

.pos-totals {
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.pos-total-line {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.pos-total-line--tax      { color: var(--text-tertiary); font-size: var(--text-sm); }
.pos-total-line--discount { color: var(--color-green-600); }
.pos-total-line--grand {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -.02em;
  padding-top: var(--space-2);
  border-top: 2px solid var(--border-default);
  margin-top: 4px;
}

/* ── Mobile tab bar ──────────────────────────────────────────────────────── */
.pos-mobile-tabs {
  display: none; /* oculto en desktop */
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
  flex-shrink: 0;
}
.pos-mobile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}
.pos-mobile-tab--active { color: var(--color-navy-600); border-bottom-color: var(--color-navy-500); }
.pos-mobile-tab-badge {
  position: absolute;
  top: 6px; right: calc(50% - 30px);
  background: var(--color-green-500);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Alerta caja cerrada */
.pos-caja-warning {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: #fef3c7;
  border-top: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
  padding: var(--space-2) var(--space-4);
  flex-shrink: 0;
}

/* Botones de acción */
.pos-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex-shrink: 0;
}

/* min-height explícito (POS-UI-011): "Suspender venta" y "Cobrar S/ {total}" son más largos que
   los textos anteriores ("Pausar orden" / "Cobrar e imprimir") y el importe puede crecer a 4+
   dígitos — con min-height + line-height, si el texto llegara a necesitar dos líneas en un total
   grande, ambos botones igual conservan la misma altura mínima en vez de desalinearse entre sí. */
.pos-hold-btn, .pos-pay-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 12px;
  min-height: 46px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.2;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.pos-hold-btn {
  background: var(--surface-inset);
  border: 1.5px solid var(--border-default);
  color: var(--text-primary);
}

.pos-hold-btn:hover:not(:disabled) { background: var(--color-slate-200); }
.pos-hold-btn:disabled { opacity: .5; cursor: not-allowed; }
.pos-hold-btn--has-held { border-color: var(--color-navy-400); color: var(--color-navy-600); background: var(--color-navy-50, #eff6ff); }
.pos-hold-btn--has-held:hover:not(:disabled) { background: var(--color-navy-100, #dbeafe); }
.pos-hold-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-navy-500); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  margin-left: 2px;
}

/* Órdenes pausadas modal */
.pos-held-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-3);
}
.pos-held-row:last-child { border-bottom: 0; }
.pos-held-info { flex: 1; min-width: 0; }
.pos-held-label { display: flex; align-items: center; gap: 6px; font-size: var(--text-base); margin-bottom: 2px; }
.pos-held-meta { font-size: var(--text-xs); color: var(--text-secondary); }
.pos-held-time { color: var(--text-tertiary); }
.pos-held-actions { display: flex; gap: 2px; flex-shrink: 0; }

.pos-pay-btn {
  background: var(--color-green-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,163,74,.30);
}

.pos-pay-btn:hover:not(:disabled) { background: var(--color-green-700); box-shadow: 0 4px 12px rgba(22,163,74,.40); }
/* Gris explícito cuando está deshabilitado, verde cuando está disponible (POS-UI-011) — antes
   solo bajaba la opacidad del verde, un estado "apagado" menos inequívoco que un gris real. */
.pos-pay-btn:disabled {
  background: var(--color-slate-300);
  color: var(--text-tertiary);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 900px) {
  /* En móvil: toolbar pasa a 2 columnas, cats en barra separada */
  .pos-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "search cash"
      "pricelist pricelist";
  }
  .pos-cats-wrap { display: none; }
  .pos-pricelist-badge { width: 160px; justify-self: start; }
  .pos-cats-bar--mobile { display: flex; }

  .pos-body { grid-template-columns: 1fr; overflow: visible; }
  .pos-order-panel { max-height: none; border-left: none; border-top: none; overflow: visible; }
  .pos-catalog-area { overflow: visible; }
  .pos-order-items { max-height: none; overflow: visible; }
  .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .pos-shell { height: auto; min-height: calc(100vh - 58px - var(--space-6) * 2); overflow: visible; }
  .pos-mobile-hidden { display: none !important; }
  .pos-mobile-tabs { display: flex; }
}

/* ── Modal selector de cliente ───────────────────────────────────────────── */
.pos-customer-list {
  max-height: 340px;
  overflow-y: auto;
  margin: 0 calc(-1 * var(--space-5));
  padding: 0 var(--space-2) var(--space-3);
}

.pos-customer-row-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.pos-customer-row-item:hover { background: var(--surface-inset); }

.pos-customer-row-item--selected { background: var(--color-green-50); }
.pos-customer-row-item--selected:hover { background: var(--color-green-100); }

.pos-customer-row-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 800;
  color: rgba(0,0,0,.35);
  flex-shrink: 0;
}

.pos-customer-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.pos-customer-row-info span {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-customer-row-info small {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Impresión de ticket ─────────────────────────────────────────────────── */
.pos-print-area {
  display: none; /* Oculto en pantalla */
}

@page {
  size: 80mm auto; /* Ancho térmico, alto automático según contenido */
  margin: 4mm;
}

@media print {
  /* Cortar el alto de la página para evitar páginas en blanco */
  html, body {
    height: auto !important;
    overflow: hidden !important;
    visibility: hidden;
  }

  /* Solo mostrar el área de ticket */
  .pos-print-area,
  .pos-print-area * {
    visibility: visible;
  }

  .pos-print-area {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 80mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #000;
    padding: 8px;
    background: #fff;
  }

  .pos-print-header {
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.6;
  }

  .pos-print-header strong { font-size: 16px; display: block; }
  .pos-print-header p { margin: 2px 0; font-size: 13px; }
  .pos-print-header small { font-size: 11px; color: #444; }

  .pos-print-customer { margin: 4px 0; font-size: 12px; }

  .pos-print-divider {
    margin: 6px 0;
    font-size: 11px;
    letter-spacing: 0;
    color: #666;
  }

  .pos-print-line {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
    font-size: 12px;
  }

  .pos-print-line--sub {
    color: #555;
    font-size: 11px;
    margin-top: -2px;
  }

  .pos-print-line--total {
    font-size: 14px;
    margin: 4px 0;
  }

  .pos-print-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
  }
}

/* ── Sales History ───────────────────────────────────────────────────────── */
.sales-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sales-header-text h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.sales-header-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.sales-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sales-kpi {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 12px 20px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-kpi small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.sales-kpi-value {
  font-size: 20px;
  font-weight: 700;
}

.sales-kpi-value--green { color: var(--color-green-500); }
.sales-kpi-value--blue  { color: var(--color-navy-500, #3b82f6); }

.sales-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.sales-filter-field { flex: 1 1 140px; min-width: 130px; }
.sales-filter-field--wide { flex: 2 1 200px; }

.sales-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.sales-pager-size-btn {
  border: 1.5px solid var(--border-default);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.sales-pager-size-btn:hover { border-color: var(--color-navy-400); color: var(--color-navy-600); }
.sales-pager-size-btn--active { border-color: var(--color-navy-500); background: var(--color-navy-500); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── KPI row ────────────────────────────────────────────────────────────── */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 1100px) { .dash-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dash-kpi-row { grid-template-columns: 1fr; } }

.dash-kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 96px;
}
.dash-kpi-card--green { border-left: 3px solid var(--color-green-500); }
.dash-kpi-card--red   { border-left: 3px solid var(--color-red-400); }

.dash-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.dash-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.dash-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.dash-kpi-value--red { color: var(--color-red-500); }

.dash-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
}
.dash-kpi-badge.up   { background: #dcfce7; color: #15803d; }
.dash-kpi-badge.down { background: #fee2e2; color: #b91c1c; }

.dash-kpi-spark { flex-shrink: 0; }
.dash-kpi-icon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

/* ── Skeleton loader ────────────────────────────────────────────────────── */
.dash-skeleton {
  background: linear-gradient(90deg, var(--surface-inset) 25%, var(--border-subtle) 50%, var(--surface-inset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Chart toggle ───────────────────────────────────────────────────────── */
.dash-chart-toggle {
  display: flex;
  gap: 4px;
}
.dash-chart-toggle button {
  border: 1.5px solid var(--border-default);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.dash-chart-toggle button.active,
.dash-chart-toggle button:hover {
  border-color: var(--color-navy-500);
  background: var(--color-navy-500);
  color: #fff;
}

/* ── Caja card ──────────────────────────────────────────────────────────── */
.dash-caja-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.dash-caja-icon {
  width: 52px; height: 52px;
  background: #dcfce7;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-caja-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dash-caja-name { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.dash-caja-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.dash-caja-dot.open   { background: var(--color-green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.dash-caja-dot.closed { background: var(--color-slate-400); }

/* ── Top productos ──────────────────────────────────────────────────────── */
.dash-top-products { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

.dash-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-top-rank {
  width: 20px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-tertiary);
  flex-shrink: 0;
  text-align: center;
}
.dash-top-info { flex: 1; min-width: 0; }
.dash-top-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.dash-top-bar-wrap {
  height: 5px;
  background: var(--surface-inset);
  border-radius: 999px;
  overflow: hidden;
}
.dash-top-bar {
  height: 100%;
  background: var(--color-navy-400);
  border-radius: 999px;
  transition: width .4s ease;
  min-width: 4px;
}
.dash-top-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 1px;
}
.dash-top-qty   { font-size: 11px; color: var(--text-secondary); }
.dash-top-total { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* ── Cash close grid (2 columnas) ──────────────────────────────────────── */
.cash-close-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
@media (max-width: 600px) { .cash-close-grid { grid-template-columns: 1fr; } }

/* ── NumPad ─────────────────────────────────────────────────────────────── */
.numpad { display: flex; flex-direction: column; gap: var(--space-2); }
.numpad-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  justify-content: flex-end;
}
.numpad-currency { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.numpad-value    { font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.numpad-btn {
  border: 1.5px solid var(--border-default);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.numpad-btn:hover        { background: var(--surface-inset); border-color: var(--color-navy-300); }
.numpad-btn:active       { transform: scale(.95); }
.numpad-btn--del         { color: var(--color-red-500); border-color: var(--color-red-200); }
.numpad-btn--del:hover   { background: #fee2e2; }
.numpad-btn--dot         { font-size: 22px; }

/* ── Stock bajo accionable ──────────────────────────────────────────────── */
.dash-lowstock {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}
.dash-lowstock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: 13px;
}
.dash-lowstock-list { display: flex; flex-direction: column; gap: 6px; }
.dash-lowstock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.dash-lowstock-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dash-lowstock-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-lowstock-code { font-size: 11px; color: var(--text-tertiary); font-family: monospace; }
.dash-lowstock-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dash-lowstock-qty {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.dash-lowstock-qty--low { background: #fef3c7; color: #92400e; }
.dash-lowstock-qty--out { background: #fee2e2; color: #b91c1c; }
.dash-lowstock-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-navy-600);
  text-decoration: none;
  padding: 2px 8px;
  border: 1.5px solid var(--color-navy-400);
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.dash-lowstock-btn:hover { background: var(--color-navy-500); color: #fff; }
.sales-pager-size-btn:hover { border-color: var(--color-navy-400); color: var(--color-navy-600); }
.sales-pager-size-btn--active { border-color: var(--color-navy-500); background: var(--color-navy-500); color: #fff; }

.sales-filters-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sales-period-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sales-period-chip {
  border: 1.5px solid var(--border-default);
  background: transparent;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.sales-period-chip:hover { border-color: var(--color-navy-400); color: var(--color-navy-600); }
.sales-period-chip--active { border-color: var(--color-navy-500); background: var(--color-navy-500); color: #fff; }

.sales-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  color: #333;
}

/* ── Ticket preview (modal) ──────────────────────────────────────────────── */
.ticket-preview {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  width: 280px;
  background: #fff;
  color: #000;
  padding: 16px;
  border: 1px dashed #ccc;
  border-radius: 4px;
}

.ticket-preview-header {
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.7;
}

.ticket-preview-header strong { font-size: 16px; display: block; }
.ticket-preview-header p { margin: 2px 0; font-size: 14px; font-weight: 600; }
.ticket-preview-header small { font-size: 11px; color: #555; }

.ticket-preview-customer { font-size: 11px; margin: 4px 0; }

.ticket-preview-divider {
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.ticket-preview-line {
  display: flex;
  justify-content: space-between;
  margin: 3px 0;
  font-size: 12px;
}

.ticket-preview-line--sub { color: #666; font-size: 11px; }

.ticket-preview-line--total {
  font-weight: bold;
  font-size: 14px;
  margin-top: 4px;
}

.ticket-preview-footer {
  text-align: center;
  margin-top: 10px;
  font-size: 11px;
  color: #444;
}

/* ── Cash / Caja ─────────────────────────────────────────────────────────── */
.cash-closed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  text-align: center;
}

.cash-closed-wrap h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.cash-closed-wrap p {
  color: var(--text-secondary);
  margin: 0;
}

.cash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cash-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.cash-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Cash Control redesign ───────────────────────────────────────────────── */
.cash-ctrl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cash-ctrl-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.cash-ctrl-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.cash-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .cash-kpi-row { grid-template-columns: 1fr; }
}

.cash-kpi-main,
.cash-kpi-breakdown,
.cash-kpi-operator {
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.cash-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.cash-kpi-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 8px 0 4px;
}

.cash-breakdown-cols {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.cash-breakdown-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cash-breakdown-col small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-secondary);
}

.cash-breakdown-col strong {
  font-size: 16px;
  font-weight: 700;
}

.cash-audit-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 130px;
}

.cash-audit-item small {
  font-size: 11px;
  color: var(--text-secondary);
}

.cash-audit-item strong {
  font-size: 16px;
  font-weight: 700;
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dash-top-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-top-item:last-child { border-bottom: none; }

.dash-top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-inset);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-top-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-top-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-top-qty {
  font-size: 11px;
  color: var(--text-secondary);
}

.dash-top-total {
  font-size: 13px;
  color: var(--color-green-600);
  white-space: nowrap;
}

/* ── Dashboard v2 ────────────────────────────────────────────────────────── */
/* ── KPI row ─────────────────────────────────────────────────────────────── */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1100px) { .dash-kpi-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px)  { .dash-kpi-row { grid-template-columns: 1fr; } }

.dash-kpi-card {
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 120px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .15s;
}

.dash-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.dash-kpi-card--green { border-left: 4px solid var(--color-green-500); }
.dash-kpi-card--red   { border-left: 4px solid var(--color-red-500); }

.dash-kpi-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.dash-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dash-kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-value--red { color: var(--color-red-500); }

.dash-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.dash-kpi-badge.up   { background: var(--color-green-100); color: var(--color-green-700); }
.dash-kpi-badge.down { background: var(--color-red-100);   color: var(--color-red-700); }

.dash-kpi-spark {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  opacity: .85;
}

.dash-kpi-icon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 6px;
}

/* ── Caja card ───────────────────────────────────────────────────────────── */
.dash-caja-card {
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.dash-caja-icon {
  width: 52px;
  height: 52px;
  background: var(--color-green-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-caja-info { flex: 1; min-width: 0; }

.dash-caja-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.dash-caja-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dash-caja-dot.open   { background: var(--color-green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.dash-caja-dot.closed { background: var(--color-red-500); }

/* ── Notificación card ───────────────────────────────────────────────────── */
.dash-notif-card {
  background: linear-gradient(135deg, var(--color-navy-900) 0%, var(--color-navy-950) 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.dash-notif-card small { color: rgba(255,255,255,0.6); }

/* Chart toggle */
.dash-chart-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-inset);
  border-radius: var(--radius-full);
  padding: 3px;
}

.dash-chart-toggle button {
  background: none;
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.dash-chart-toggle button.active {
  background: var(--color-navy-800);
  color: white;
}

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
.dash-skeleton {
  background: linear-gradient(90deg, var(--border-subtle) 25%, var(--surface-inset) 50%, var(--border-subtle) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: dash-shimmer 1.4s infinite;
}

@keyframes dash-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ── Inventario — pills de stock ─────────────────────────────────────────── */
.inv-stock-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.inv-stock-pill--ok  { background: #dcfce7; color: #15803d; }
.inv-stock-pill--low { background: #fef9c3; color: #a16207; }
.inv-stock-pill--out { background: #fee2e2; color: #b91c1c; }

.inv-stock-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.inv-stock-dot--ok  { background: #16a34a; }
.inv-stock-dot--low { background: #ca8a04; }
.inv-stock-dot--out { background: #dc2626; }

/* ── Inventario — modal movimiento ──────────────────────────────────────── */
.inv-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  color: var(--text-tertiary); margin-bottom: 6px; text-transform: uppercase;
}
.mt-3 { margin-top: 12px; }

.inv-mov-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 8px;
}
@media (max-width: 680px) { .inv-mov-grid { grid-template-columns: 1fr; } }

/* toggle Entrada / Salida */
.inv-type-toggle {
  display: flex; border-radius: var(--radius-md); overflow: hidden;
  border: 1.5px solid var(--border-subtle);
}
.inv-type-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; background: transparent;
  color: var(--text-secondary); transition: background .15s, color .15s;
}
.inv-type-btn:hover { background: var(--surface-inset); }
.inv-type-btn--entry-active {
  background: #16a34a; color: #fff;
}
.inv-type-btn--exit-active {
  background: var(--surface-inset); color: var(--text-primary);
}

/* tarjeta producto seleccionado */
.inv-product-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-inset);
}
.inv-stock-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #dbeafe; color: #1d4ed8;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
}

/* control +/- cantidad */
.inv-qty-control {
  display: flex; align-items: center; border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden; width: fit-content;
}
.inv-qty-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; background: var(--surface-inset); cursor: pointer;
  color: var(--text-primary); transition: background .15s;
}
.inv-qty-btn:hover:not(:disabled) { background: var(--border-subtle); }
.inv-qty-btn:disabled { opacity: .4; cursor: default; }
.inv-qty-input {
  width: 72px; height: 40px; border: none; text-align: center;
  font-size: 16px; font-weight: 700; background: transparent;
  color: var(--text-primary); outline: none;
  -moz-appearance: textfield;
}
.inv-qty-input::-webkit-outer-spin-button,
.inv-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }


/* ── Inventario — pills de stock ─────────────────────────────────────────── */
.inv-stock-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.inv-stock-pill--ok  { background: #dcfce7; color: #15803d; }
.inv-stock-pill--low { background: #fef9c3; color: #a16207; }
.inv-stock-pill--out { background: #fee2e2; color: #b91c1c; }

.inv-stock-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.inv-stock-dot--ok  { background: #16a34a; }
.inv-stock-dot--low { background: #ca8a04; }
.inv-stock-dot--out { background: #dc2626; }

/* ── Inventario — modal movimiento ──────────────────────────────────────── */
.inv-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  color: var(--text-tertiary); margin-bottom: 6px; text-transform: uppercase;
}
.mt-3 { margin-top: 12px; }

.inv-mov-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 8px;
}
@media (max-width: 680px) { .inv-mov-grid { grid-template-columns: 1fr; } }

.inv-type-toggle {
  display: flex; border-radius: var(--radius-md); overflow: hidden;
  border: 1.5px solid var(--border-subtle);
}
.inv-type-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; background: transparent;
  color: var(--text-secondary); transition: background .15s, color .15s;
}
.inv-type-btn:hover { background: var(--surface-inset); }
.inv-type-btn--entry-active { background: #16a34a; color: #fff; }
.inv-type-btn--exit-active  { background: var(--surface-inset); color: var(--text-primary); }

.inv-product-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-inset);
}
.inv-stock-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #dbeafe; color: #1d4ed8;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
}

.inv-qty-control {
  display: flex; align-items: center; border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden; width: fit-content;
}
.inv-qty-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; background: var(--surface-inset); cursor: pointer;
  color: var(--text-primary); transition: background .15s;
}
.inv-qty-btn:hover:not(:disabled) { background: var(--border-subtle); }
.inv-qty-btn:disabled { opacity: .4; cursor: default; }
.inv-qty-input {
  width: 72px; height: 40px; border: none; text-align: center;
  font-size: 16px; font-weight: 700; background: transparent;
  color: var(--text-primary); outline: none;
  -moz-appearance: textfield;
}
.inv-qty-input::-webkit-outer-spin-button,
.inv-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
/* TEST */

/* ── SuperAdmin: Tabla de empresas ───────────────────────────────── */
.sa-overview-layout {
  display: grid;
  grid-template-columns: minmax(260px, .55fr) minmax(680px, 1.8fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  align-items: start;
}
.sa-diagnostics-card { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); }
.sa-companies-table { width: 100%; }
.sa-companies-header,
.sa-companies-row {
  display: grid;
  grid-template-columns: 3fr 1.2fr 1fr 1.2fr 1fr 70px 70px;
  align-items: center;
  gap: 0 .75rem;
  padding: .6rem .75rem;
}
.sa-companies-header {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.sa-companies-row {
  border-bottom: 1px solid var(--border-subtle);
  font-size: .875rem;
  transition: background .12s;
}
.sa-companies-row:last-child { border-bottom: none; }
.sa-companies-row:hover { background: var(--surface-inset); }

/* ── SuperAdmin: aprovisionamiento de empresa ──────────────────────────── */
.sa-provision-page { max-width: 1440px; margin: 0 auto; }
.sa-provision-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.sa-provision-intro { margin: -8px 0 var(--space-5); color: var(--text-secondary); }
.sa-provision-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.sa-provision-form { display: flex; flex-direction: column; gap: var(--space-4); }
.sa-provision-section { padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); background: var(--surface-base); }
.sa-provision-section-heading { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-5); }
.sa-provision-section-heading > span {
  display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px;
  border-radius: var(--radius-full); background: var(--color-navy-100); color: var(--color-navy-700);
  font-size: 12px; font-weight: 800;
}
.sa-provision-section-heading h2,
.sa-provision-summary h2 { margin: 0; font-size: var(--text-lg); }
.sa-provision-section-heading p { margin: 3px 0 0; color: var(--text-secondary); font-size: var(--text-sm); }
.sa-provision-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.sa-provision-fields--single { grid-template-columns: minmax(0, 1fr); }
.sa-plan-summary {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-inset);
  color: var(--text-secondary); font-size: var(--text-sm);
}
.sa-plan-summary strong { color: var(--text-primary); }
.sa-provision-summary {
  position: sticky; top: calc(var(--topbar-height) + var(--space-4)); display: flex; flex-direction: column;
  gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); background: var(--surface-base); box-shadow: var(--shadow-sm);
}
.sa-provision-summary-block { display: flex; flex-direction: column; gap: 3px; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.sa-provision-summary-block small { color: var(--text-tertiary); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sa-provision-summary-block strong { font-size: var(--text-base); }
.sa-provision-summary-block span { color: var(--text-secondary); font-size: var(--text-sm); }

@media (max-width: 1280px) {
  .sa-overview-layout { grid-template-columns: 1fr; }
  .sa-diagnostics-card { position: static; }
}

@media (max-width: 900px) {
  .sa-provision-layout { grid-template-columns: 1fr; }
  .sa-provision-summary { position: static; }
  .sa-provision-fields { grid-template-columns: 1fr; }
  .sa-provision-header-actions { justify-content: flex-end; }
}

/* ── SuperAdmin: badge estado empresa ───────────────────────────────── */
.cust-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
}
.cust-status--active   { background: var(--color-green-100); color: var(--color-green-700); }
.cust-status--inactive { background: var(--color-slate-100); color: var(--color-slate-500); }

/* ── Botones genéricos fq-btn ────────────────────────────────────────── */
.fq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}
.fq-btn:disabled { opacity: .55; cursor: not-allowed; }

.fq-btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.fq-btn-primary:hover:not(:disabled) { background: var(--color-navy-700); border-color: var(--color-navy-700); }

.fq-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.fq-btn-ghost:hover:not(:disabled) { background: var(--surface-inset); color: var(--text-primary); }

/* ── Modal SuperAdmin — secciones y campos compactos ────────────────── */
.cust-section {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.cust-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.cust-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* Reducir altura de los MudTextField dentro del modal */
.fq-modal .mud-input-outlined { min-height: 40px !important; }
.fq-modal .mud-input-outlined input,
.fq-modal .mud-input-outlined textarea { padding-top: 10px !important; padding-bottom: 10px !important; font-size: var(--text-base) !important; }
.fq-modal .mud-input-label-outlined { font-size: var(--text-base) !important; }
.fq-modal .mud-select .mud-input-outlined { min-height: 40px !important; }
.fq-modal .mb-3 { margin-bottom: var(--space-3) !important; }

/* ── Modal backdrop (alias de fq-modal-overlay para SuperAdmin) ──────── */
.fq-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: overlayIn var(--transition-base) ease;
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MÓDULO ETIQUETAS
   ══════════════════════════════════════════════════════════════════════════════ */

/* Shell: dos columnas */
.etq-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .etq-shell { grid-template-columns: 1fr; }
}

/* Barra de búsqueda */
.etq-search-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  position: relative;
}

/* Item de la cola */
.etq-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}
.etq-item:last-child { border-bottom: none; }
.etq-item:hover { background: #f8fafc; }

.etq-avatar {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: #1a1a2e; flex-shrink: 0; letter-spacing: .3px;
}

.etq-item-info { flex: 1; min-width: 0; }
.etq-item-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.etq-item-meta { font-size: 11px; color: var(--text-tertiary); }

.etq-qty {
  display: flex; align-items: center; gap: 2px;
  background: #f1f5f9; border-radius: 8px; padding: 2px 4px;
}
.etq-qty-val {
  font-weight: 700; font-size: 14px;
  min-width: 26px; text-align: center;
}

/* Footer cola */
.etq-queue-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
}

/* Empty state de la cola */
.etq-queue-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; gap: 10px;
  color: var(--text-tertiary); text-align: center;
}

/* Dropdown sugerencias */
.etq-suggestions {
  position: absolute; z-index: 999;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  width: calc(100% - 32px);
  max-height: 280px; overflow-y: auto;
  margin-top: 4px; left: 16px;
}
.etq-suggestion-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.etq-suggestion-row:last-child { border-bottom: none; }
.etq-suggestion-row:hover { background: #f0f7ff; }
.etq-suggestion-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-primary); flex-shrink: 0;
}

/* Panel derecho */
.etq-right {
  display: flex; flex-direction: column; gap: 0;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-light); background: white;
}
.etq-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.etq-section:last-child { border-bottom: none; }
.etq-section-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: .8px; color: var(--text-tertiary); margin-bottom: 10px;
}

/* Botones de tamaño */
.etq-size-row { display: flex; gap: 6px; }
.etq-size-btn {
  flex: 1; padding: 6px 4px;
  border-radius: 6px; border: 1.5px solid var(--border-light);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-secondary); transition: all .13s; text-align: center;
}
.etq-size-btn--active {
  border-color: var(--brand-primary); background: #eff6ff; color: var(--brand-primary);
}

.etq-checks { display: flex; flex-direction: column; gap: 2px; }

/* Preview */
.etq-preview-bg {
  background: #f0f2f5; border-radius: 6px;
  min-height: 110px;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.etq-preview-empty { color: var(--text-tertiary); font-size: 12px; text-align: center; }

/* La etiqueta */
.etq-label {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 0; border-radius: 3px;
  padding: 5px 6px; background: white; gap: 1px;
  overflow: hidden;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  text-rendering: geometricPrecision;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.etq-label--xs { width: 30mm; height: 25mm; min-height: 25mm; }
.etq-label--sm { width: 50mm; height: 20mm; min-height: 20mm; box-sizing: border-box; }
.etq-label--md { width: 70mm; height: 42mm; min-height: 42mm; }
.etq-label--lg { width: 90mm; height: 55mm; min-height: 55mm; }

/* La plantilla estándar escala composición y márgenes según el área física. */
.etq-label.etq-label--xs { padding: 1.2mm 1.5mm; gap: .35mm; }
.etq-label.etq-label--sm { padding: 1mm 2mm; gap: .25mm; }
.etq-label.etq-label--md { padding: 2.2mm 3mm; gap: .65mm; }
.etq-label.etq-label--lg { padding: 3mm 4mm; gap: .9mm; }

.etq-label-name {
  font-weight: 700; text-align: center;
  line-height: 1.2; word-break: break-word; width: 100%;
  min-width: 0; max-width: 100%;
}
.etq-label--xs .etq-label-name { font-size: 2.35mm; line-height: 1.05; }
.etq-label--sm .etq-label-name {
  font-size: 2.35mm; line-height: 1.05; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.etq-label--md .etq-label-name { font-size: 3.8mm; line-height: 1.08; }
.etq-label--lg .etq-label-name { font-size: 4.8mm; line-height: 1.08; }

.etq-label-price { font-weight: 800; color: #1a1a2e; text-align: center; }
.etq-label--xs .etq-label-price { font-size: 4mm; line-height: 1; }
.etq-label--sm .etq-label-price { font-size: 4.2mm; line-height: 1; }
.etq-label--md .etq-label-price { font-size: 6.5mm; line-height: 1; }
.etq-label--lg .etq-label-price { font-size: 8mm; line-height: 1; }

.etq-label-sku { color: #1f2937; font-weight: 600; letter-spacing: .2px; text-align: center; }
.etq-label--xs .etq-label-sku { font-size: 1.8mm; }
.etq-label--sm .etq-label-sku { font-size: 1.8mm; line-height: 1; }
.etq-label--md .etq-label-sku { font-size: 2.6mm; }
.etq-label--lg .etq-label-sku { font-size: 3.2mm; }

.etq-label-barcode-box { width: 90%; max-width: 90%; overflow: hidden; flex: 0 0 auto; }
.etq-label-barcode-box svg { width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; overflow: hidden; shape-rendering: crispEdges; }
.etq-label--xs .etq-label-barcode-box { height: 8.5mm; max-height: 8.5mm; }
.etq-label--sm .etq-label-barcode-box { width: 42mm; height: 6mm; max-width: 42mm; max-height: 6mm; }
.etq-label--md .etq-label-barcode-box { height: 15mm; max-height: 15mm; }
.etq-label--lg .etq-label-barcode-box { height: 21mm; max-height: 21mm; }

/* Botón imprimir */
.etq-print-btn {
  width: 100%; padding: 13px;
  border: none; border-radius: 8px;
  background: #16a34a; color: white;
  font-size: 15px; font-weight: 700; letter-spacing: .4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.etq-print-btn:hover:not(:disabled) { background: #15803d; }
.etq-print-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.etq-printer-note {
  font-size: 11px; color: var(--text-tertiary);
  text-align: center; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}

/* Preview con scroll para etiquetas anchas */
.etq-preview-bg { overflow: auto; justify-content: safe center; }

.etq-label-layout {
  display: flex;
  flex-direction: column;
  width: max-content;
  box-sizing: border-box;
  background: white;
}
.etq-label-layout--preview { max-width: none; }
.etq-label-page {
  display: grid;
  width: max-content;
  box-sizing: border-box;
  background: white;
  break-after: page;
  page-break-after: always;
}
.etq-label-page:last-child {
  break-after: auto;
  page-break-after: auto;
}
.etq-label-cell {
  box-sizing: border-box;
  overflow: hidden;
}
.etq-label-cell > .etq-label,
.etq-label-cell > .etq-brand-label {
  width: 100%; height: 100%; min-height: 0;
  box-sizing: border-box;
}
.etq-label-cell--blank { border: 0; background: transparent; }

/* Zona de impresión (oculta en pantalla) */
.etq-print-zone { display: none; }

@media print {
  html, body {
    margin: 0 !important; padding: 0 !important;
    width: auto !important; height: auto !important; min-height: 0 !important;
    overflow: visible !important;
  }
  .fq-sidebar, .fq-topbar, .fq-tenant-access-banner,
  .fq-page-header, .etq-shell {
    display: none !important;
  }
  .fq-shell, .fq-main, .fq-content {
    display: block !important;
    width: auto !important; height: auto !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important;
    overflow: visible !important;
  }
  .etq-print-zone {
    position: static; width: max-content;
    display: block !important;
    box-sizing: border-box;
    background: white;
    align-items: flex-start; align-content: flex-start;
  }
  .etq-label, .etq-label--xs,
  .etq-brand-label { border: 0 !important; outline: 0 !important; box-shadow: none !important; }

  /* Forzar impresión de fondos y colores en la plantilla de marca */
  .etq-brand-label,
  .etq-brand-label * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* ── Plantilla Marca ────────────────────────────────────────────────────── */

.etq-brand-label {
  display: grid;
  border: 0; border-radius: 4mm;
  padding: 0;
  overflow: hidden; box-sizing: border-box;
  font-family: 'Arial', 'Helvetica Neue', sans-serif;
  text-rendering: geometricPrecision;
  box-shadow: inset 0 0 0 .25mm #707780, 0 2px 8px rgba(0,0,0,.12);
  background: white;
  font-size: 2.8mm;
}
.etq-brand-label.etq-label--sm {
  width: 50mm; height: 20mm; min-width: 50mm; min-height: 20mm;
  grid-template-columns: 31% minmax(0, 69%);
  font-size: 1.6mm; border-radius: 2mm;
}
.etq-brand-label.etq-label--md {
  width: 70mm; height: 42mm; min-width: 70mm; min-height: 42mm;
  grid-template-columns: 38.571428% minmax(0, 61.428572%);
  font-size: 2.5mm;
}
.etq-brand-label.etq-label--lg {
  width: 90mm; height: 55mm; min-width: 90mm; min-height: 55mm;
  grid-template-columns: 37.777778% minmax(0, 62.222222%);
  font-size: 2.8mm; border-radius: 5mm;
}

/* Panel izquierdo */
.etq-brand-left {
  width: 100%; min-width: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  position: relative; z-index: 1; overflow: visible;
}

/* Bump curvo (convexo hacia la derecha) */
.etq-brand-left::after {
  content: '';
  position: absolute; right: -2mm; top: 0; bottom: 0;
  width: 4mm; background: inherit;
  border-radius: 0 50% 50% 0; z-index: 1;
}

.etq-brand-left-body {
  min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2mm 1.5mm 1mm; gap: .8mm;
  position: relative; z-index: 2;
  overflow: hidden;
}

/* Logo de marca (iniciales en círculo) */
.etq-brand-logo {
  width: 11mm; height: 11mm; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 3mm; flex: 0 0 auto;
}
.etq-brand-logo-image { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(1.45); }
.label-config-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,38%); gap:20px; margin-top:16px; }
.label-config-heading { grid-column:1/-1; display:flex; justify-content:space-between; gap:16px; align-items:center; }
.label-config-heading h3,.label-config-heading p { margin:0; }
.label-config-form { display:flex; flex-direction:column; gap:14px; padding:16px 0; }
.label-config-switches { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.label-geometry-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:16px 0; }
.label-config-preview { min-width:0; overflow:auto; }
@media (max-width:900px){.label-config-panel{grid-template-columns:1fr}.label-geometry-grid{grid-template-columns:1fr}}

.etq-brand-company {
  font-weight: 800; text-align: center;
  line-height: 1; font-size: 5mm;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.etq-brand-tagline {
  color: #666; text-align: center; font-style: italic;
  line-height: 1.1; font-size: 2mm;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Tira de insignias inferior */
.etq-brand-strip {
  display: grid; grid-template-columns: 1fr .25mm 1fr .25mm 1fr;
  align-items: stretch;
  height: 12mm; padding: 1mm .7mm;
  box-sizing: border-box;
  position: relative; z-index: 2;
}

.etq-brand-badge-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .08em; color: white; flex: 1;
}
/* Línea 1: ícono */
.etq-brand-badge-icon { font-size: 1em; line-height: 1; }
/* Línea 2: texto principal */
.etq-brand-badge-main {
  font-size: .58em; font-weight: 800;
  text-transform: uppercase; text-align: center; line-height: 1.1;
}
/* Línea 3: subtexto */
.etq-brand-badge-sub {
  font-size: .5em; font-weight: 600;
  text-transform: uppercase; text-align: center; line-height: 1.1;
  opacity: .85;
}

.etq-brand-vline {
  width: .25mm; min-width: .25mm; align-self: stretch;
  background: rgba(255,255,255,.55); margin: 0;
}

/* Panel derecho */
.etq-brand-right {
  min-width: 0; display: grid;
  padding: 2mm 2mm 2mm 4mm;
  overflow: hidden;
  background: white; position: relative; z-index: 0;
}

.etq-brand-prod-name {
  font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.02em; color: #1a1a1a;
  min-width: 0; max-width: 100%;
  line-height: 1.05; font-size: 4.2mm;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.etq-brand-prod-sub {
  color: #777; text-transform: uppercase;
  letter-spacing: .05em; font-size: 2.6mm;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Línea punteada separadora */
.etq-brand-dotted {
  border-bottom: .25mm dashed #bbb; margin: 0; min-height: 0;
}

/* Fila precio + círculo */
.etq-brand-price-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1mm; min-height: 0;
  padding: 0; overflow: hidden;
}

.etq-brand-price-block { min-width: 0; display: flex; flex-direction: column; gap: .6mm; }

.etq-brand-precio-tag {
  display: inline-block; width: fit-content; border-radius: 20mm;
  color: white; font-weight: 700; font-size: 2.2mm;
  padding: .35mm 1.8mm; line-height: 1.1;
}

.etq-brand-price-num {
  font-weight: 800; color: #1a1a1a;
  line-height: 1; font-size: 8.8mm;
  display: flex; align-items: baseline; gap: .02em;
  white-space: nowrap; flex-wrap: nowrap; overflow: hidden;
}
/* Centavos más pequeños */
.etq-brand-price-dec { font-size: .45em; font-weight: 700; align-self: flex-end; padding-bottom: .1em; white-space: nowrap; }

/* Separador vertical precio | círculo */
.etq-brand-price-separator {
  width: .25mm; align-self: stretch;
  background: #bbb; margin: 0; flex-shrink: 0;
}

/* Círculo de marca (esquina precio) */
.etq-brand-circle-badge {
  border-radius: 50%; flex-shrink: 0; color: white;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; overflow: hidden; padding: .6mm;
  width: 12mm; height: 12mm; box-sizing: border-box;
}
.etq-brand-circle-icon { font-size: 2.5mm; line-height: 1; }
.etq-brand-circle-name { width: 100%; font-weight: 800; text-transform: uppercase; font-size: 1.5mm; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etq-brand-circle-sub  { text-transform: uppercase; font-size: 1mm; line-height: 1.1; font-weight: 600; opacity: .9; }

/* Fila de código */
.etq-brand-code-row {
  display: flex; align-items: center; gap: 1mm;
  min-width: 0; overflow: hidden;
}

.etq-brand-code-label {
  display: inline-block; border-radius: 20mm;
  color: white; font-weight: 700; font-size: 1.8mm;
  padding: .4mm 1.6mm; line-height: 1.1;
  white-space: nowrap; flex-shrink: 0;
}

.etq-brand-code-val {
  border-radius: 20mm; font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1; font-size: 2.2mm; font-weight: 600; padding: .4mm 1.5mm;
  background: rgba(0,0,0,.06); color: #444;
}

/* Código de barras */
.etq-brand-barcode-box {
  min-width: 0; max-width: 100%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.etq-brand-barcode {
  display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  overflow: hidden; shape-rendering: crispEdges;
}
.etq-brand-label.etq-label--lg .etq-brand-right {
  grid-template-rows: 9mm 4mm .5mm 15mm 6mm 13mm;
  padding: 3mm 2mm 2.5mm 4mm;
}
.etq-brand-label.etq-label--lg .etq-brand-prod-name {
  grid-row: 1; height: 9mm; max-height: 9mm;
  font-size: 4.2mm; line-height: 1.05;
  -webkit-line-clamp: 2; overflow: hidden;
}
.etq-brand-label.etq-label--lg .etq-brand-prod-sub { grid-row: 2; }
.etq-brand-label.etq-label--lg .etq-brand-dotted { grid-row: 3; }
.etq-brand-label.etq-label--lg .etq-brand-price-row { grid-row: 4; }
.etq-brand-label.etq-label--lg .etq-brand-code-row { grid-row: 5; }
.etq-brand-label.etq-label--lg .etq-brand-barcode-box {
  grid-row: 6; width: 48mm; height: 13mm; max-width: 48mm; max-height: 13mm;
  overflow: hidden;
}
.etq-brand-label.etq-label--lg .etq-brand-tagline {
  display: -webkit-box; max-width: 100%;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  white-space: normal; overflow: hidden; text-overflow: clip;
  line-height: 2.4mm; max-height: 4.8mm;
}

/* ── Adaptaciones para tamaño Medium (70×42): compactar para que todo quepa ── */
.etq-brand-label.etq-label--md .etq-brand-right {
  grid-template-rows: 7mm 3mm .5mm 11mm 5mm 9mm;
  padding: 2mm 1.5mm 2.5mm 3mm;
}
.etq-brand-label.etq-label--md .etq-brand-prod-name  {
  grid-row: 1; font-size: 3.2mm; line-height: 1.08;
  height: 7mm; max-height: 7mm;
}
.etq-brand-label.etq-label--md .etq-brand-prod-sub { grid-row: 2; font-size: 2mm; }
.etq-brand-label.etq-label--md .etq-brand-dotted { grid-row: 3; }
.etq-brand-label.etq-label--md .etq-brand-price-row { grid-row: 4; }
.etq-brand-label.etq-label--md .etq-brand-code-row { grid-row: 5; }
.etq-brand-label.etq-label--md .etq-brand-barcode-box { grid-row: 6; width: 38.5mm; height: 9mm; overflow: hidden; }
.etq-brand-label.etq-label--md .etq-brand-price-num { font-size: 6.5mm; }
.etq-brand-label.etq-label--md .etq-brand-circle-badge { width: 9mm; height: 9mm; }
.etq-brand-label.etq-label--md .etq-brand-strip { height: 9mm; }
.etq-brand-label.etq-label--md .etq-brand-logo { width: 8mm; height: 8mm; font-size: 2.2mm; }
.etq-brand-label.etq-label--md .etq-brand-company { font-size: 3.8mm; }

/* ── Adaptaciones para tamaño Small (50×20): contenido esencial compacto ── */
.etq-brand-label.etq-label--sm .etq-brand-right {
  padding: .8mm 1mm .2mm 2mm;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-right {
  grid-template-rows: 3.8mm 1.5mm .35mm 4.65mm 2.5mm 5.5mm;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-dotted {
  align-self: start; width: 100%; border-bottom-width: .15mm;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-price-row {
  height: 4.65mm; overflow: hidden;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-price-block {
  height: 100%; max-height: 100%; justify-content: center;
  gap: .05mm; overflow: hidden;
}
.etq-brand-label.etq-brand--compact-tall .etq-brand-right {
  grid-template-rows: 4.4mm 2mm .3mm 5.3mm 3mm 7.2mm;
  padding-top: .8mm; padding-bottom: .8mm;
}
.etq-brand-label.etq-label--sm .etq-brand-prod-name  {
  grid-row: 1; height: 3.8mm; max-height: 3.8mm; min-width: 0;
  display: -webkit-box; font-size: 1.8mm; line-height: 1.9mm; font-weight: 800;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; text-overflow: clip; white-space: normal;
}
.etq-brand-label.etq-brand--compact-tall .etq-brand-prod-name {
  height: 4.4mm; max-height: 4.4mm; font-size: 1.9mm; line-height: 2.2mm;
}
.etq-brand-label.etq-label--sm .etq-brand-prod-sub { display: block; grid-row: 2; font-size: .8mm; line-height: 1.4mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etq-brand-label.etq-label--sm .etq-brand-dotted { grid-row: 3; }
.etq-brand-label.etq-label--sm .etq-brand-price-row { grid-row: 4; gap: .5mm; padding: 0; }
.etq-brand-label.etq-label--sm .etq-brand-code-row { grid-row: 5; gap: .4mm; }
.etq-brand-label.etq-label--sm .etq-brand-barcode-box {
  grid-row: 6; width: 31.5mm; height: 5.5mm; max-width: 31.5mm; max-height: 5.5mm;
  overflow: hidden;
}
.etq-brand-label.etq-brand--compact-tall .etq-brand-barcode-box {
  height: 7.2mm; max-height: 7.2mm;
}
.etq-brand-label.etq-label--sm .etq-brand-price-num { font-size: 3.7mm; line-height: 1; }
.etq-brand-label.etq-label--sm .etq-brand-precio-tag { font-size: 1.1mm; padding: .15mm .7mm; }
.etq-brand-label.etq-brand--compact-short .etq-brand-price-num {
  font-size: 2.5mm; line-height: 1.25;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-precio-tag {
  font-size: .9mm; line-height: 1.2; padding: 0 .6mm; flex-shrink: 0;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-price-dec {
  font-size: 1em; align-self: baseline; padding-bottom: 0;
}
/* La marca secundaria se conserva como sello compacto. */
.etq-brand-label.etq-label--sm .etq-brand-price-separator { display: block; margin: 0 .15em; }
.etq-brand-label.etq-label--sm .etq-brand-circle-badge {
  display: flex; width: 4.5mm; height: 4.5mm; padding: .2mm;
}
.etq-brand-label.etq-label--sm .etq-brand-circle-icon  { font-size: 1.1mm; }
.etq-brand-label.etq-label--sm .etq-brand-circle-name  { font-size: .7mm; }
.etq-brand-label.etq-label--sm .etq-brand-circle-sub   {
  display: -webkit-box; font-size: .4mm; line-height: .55mm; max-width: 100%; max-height: 1.1mm;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; text-overflow: clip; white-space: normal; overflow-wrap: anywhere;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-circle-sub {
  font-size: .3mm; line-height: .48mm; max-height: .96mm;
  -webkit-line-clamp: 2;
}
/* Código: etiqueta más corta en sm para que no se trunque */
.etq-brand-label.etq-label--sm .etq-brand-code-row   { gap: .2em; }
.etq-brand-label.etq-label--sm .etq-brand-code-label { font-size: 1mm; font-weight: 800; padding: .15mm .5mm; }
.etq-brand-label.etq-label--sm .etq-brand-code-val   { font-size: 1.25mm; font-weight: 700; padding: .15mm .5mm; }
/* Panel izquierdo compacto */
.etq-brand-label.etq-label--sm .etq-brand-left       { width: 100%; min-width: 0; }
.etq-brand-label.etq-label--sm .etq-brand-left-body  { gap: .2mm; padding: .6mm .5mm .2mm; }
.etq-brand-label.etq-label--sm .etq-brand-logo       { width: 4.5mm; height: 4.5mm; font-size: 1.2mm; }
.etq-brand-label.etq-label--sm .etq-brand-company    { font-size: 2mm; }
.etq-brand-label.etq-label--sm .etq-brand-tagline    {
  display: -webkit-box; max-width: 100%; max-height: 1.4mm; font-size: .55mm; line-height: .7mm;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; text-overflow: clip; white-space: normal;
}
.etq-brand-label.etq-brand--compact-short .etq-brand-tagline {
  max-height: 1.6mm; font-size: .7mm; line-height: .8mm;
  -webkit-line-clamp: 2;
}
.etq-brand-label.etq-brand--compact-tall .etq-brand-left-body {
  gap: .35mm; padding: .8mm .6mm .4mm;
}
.etq-brand-label.etq-brand--compact-tall .etq-brand-logo { width: 5.5mm; height: 5.5mm; font-size: 1.4mm; }
.etq-brand-label.etq-brand--compact-tall .etq-brand-company { font-size: 2.3mm; }
.etq-brand-label.etq-brand--compact-tall .etq-brand-tagline {
  max-height: 1.8mm; font-size: .65mm; line-height: .9mm;
}
/* Las insignias se conservan en 50×20 con icono y texto principal. */
.etq-brand-label.etq-label--sm .etq-brand-strip      { display: grid; height: 4.5mm; padding: .3mm .2mm; }
.etq-brand-label.etq-brand--compact-tall .etq-brand-strip { height: 5.2mm; padding: .4mm .25mm; }
.etq-brand-label.etq-label--sm .etq-brand-badge-sub  { display: block; max-width: 100%; font-size: .28em; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etq-brand-label.etq-label--sm .etq-brand-badge-main { font-size: .38em; line-height: 1; }
.etq-brand-label.etq-label--sm .etq-brand-badge-icon { font-size: .62em; }
.etq-brand-label.etq-label--sm .etq-brand-vline      { margin: 0 .1em; }

/* La celda define la medida física efectiva; el preset solo elige densidad visual.
   El contorno es una guía de preview y no forma parte del documento impreso. */
.etq-label-cell > .etq-label,
.etq-label-cell > .etq-brand-label {
  width: 100%; height: 100%; min-width: 0; min-height: 0;
}
.etq-label-layout--preview .etq-label,
.etq-label-layout--preview .etq-brand-label {
  outline: 1px solid #d1d5db;
  outline-offset: -1px;
}

/* Config UI de marca en el panel de opciones */
.etq-color-pair {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.etq-color-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary);
}
.etq-color-input {
  width: 26px; height: 26px; border-radius: 4px;
  border: 2px solid var(--border-color); padding: 1px;
  cursor: pointer; background: none;
}
.label-color-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.label-color-editor {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 8px;
}

/* SaaS management */
.sa-page { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.sa-page-subtitle { margin: -12px 0 22px; color: var(--text-secondary); }
.sa-breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-tertiary); }
.sa-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.sa-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.sa-kpi { display: flex; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-base); }
.sa-kpi > svg { padding: 9px; box-sizing: content-box; border-radius: 10px; }
.sa-kpi span { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 5px; }
.sa-kpi small { grid-column: 1 / -1; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.sa-kpi strong { font-size: 22px; }.sa-kpi em { font-size: 11px; font-style: normal; color: var(--text-secondary); }
.sa-kpi--success > svg { color: #059669; background: #d1fae5; }.sa-kpi--warning > svg { color: #d97706; background: #fef3c7; }.sa-kpi--danger > svg { color: #dc2626; background: #fee2e2; }.sa-kpi--neutral > svg { color: #64748b; background: #f1f5f9; }
.sa-list-panel, .sa-card { border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-base); }
.sa-filters { padding: 12px; display: grid; grid-template-columns: minmax(280px, 1fr) 150px 170px 180px auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border-subtle); }
.sa-company-table-wrap { overflow-x: auto; }.sa-company-table { min-width: 1120px; }
.sa-company-table-head, .sa-company-table-row { display: grid; grid-template-columns: 2fr 1fr .8fr 1.15fr .9fr 1.05fr 1.05fr 1.1fr 60px; gap: 12px; align-items: center; padding: 13px 15px; }
.sa-company-table-head { background: var(--surface-inset); color: var(--text-secondary); font-size: 11px; font-weight: 800; text-transform: uppercase; }.sa-company-table-row { border-top: 1px solid var(--border-subtle); font-size: 13px; }
.sa-company-cell { border: 0; padding: 0; background: none; display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer; }.sa-company-cell > b, .sa-company-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: #111827; color: white; font-size: 12px; }.sa-company-cell span { display: flex; flex-direction: column; }.sa-company-cell small,.sa-cycle { display: block; color: var(--text-tertiary); font-size: 10px; margin-top: 3px; }
.sa-plan-badge,.sa-limit-chips span { display: inline-flex; padding: 4px 8px; border-radius: 4px; background: #f1f5f9; font-size: 11px; font-weight: 700; }.sa-date-danger { color: #dc2626; font-weight: 700; }.sa-date-warning { color: #d97706; font-weight: 700; }
.sa-pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-top: 1px solid var(--border-subtle); font-size: 12px; }.sa-loading,.sa-empty { padding: 48px; text-align: center; color: var(--text-secondary); }
.sa-status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }.sa-status > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.sa-status--success { color: #059669; background: #d1fae5; }.sa-status--warning { color: #b45309; background: #fef3c7; }.sa-status--danger { color: #dc2626; background: #fee2e2; }.sa-status--neutral { color: #475569; background: #f1f5f9; }
.sa-usage { min-width: 90px; }.sa-usage-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }.sa-usage-track { height: 5px; margin-top: 6px; border-radius: 99px; background: #e5e7eb; overflow: hidden; }.sa-usage-track span { display: block; height: 100%; background: #111827; }.sa-usage small { font-size: 9px; text-transform: uppercase; }.is-normal { color: #059669; }.sa-usage-track .is-normal { background: #111827; }.is-warning,.is-limit { color: #d97706; }.sa-usage-track .is-warning,.sa-usage-track .is-limit { background: #f59e0b; }.is-danger { color: #dc2626; }.sa-usage-track .is-danger { background: #ef4444; }
.sa-company-header,.sa-company-strip { display: flex; align-items: center; gap: 14px; padding: 15px 0; }.sa-company-heading { flex: 1; }.sa-company-title-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }.sa-company-title-line h1 { margin: 0; font-size: 25px; }.sa-company-heading > small { color: var(--text-secondary); }.sa-company-header-actions { margin-left: auto; display: flex; gap: 8px; }
.sa-tabs { display: flex; gap: 25px; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }.sa-tabs a { color: var(--text-secondary); text-decoration: none; padding: 10px 0; white-space: nowrap; font-size: 12px; }.sa-tabs .active { color: var(--text-primary); font-weight: 700; border-bottom: 2px solid #111827; }
.sa-overview-grid { display: grid; grid-template-columns: minmax(280px,.75fr) minmax(420px,1.6fr); gap: 16px; }.sa-card { padding: 20px; }.sa-card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }.sa-card-title h2 { margin: 0; font-size: 15px; }.sa-card-title a { font-size: 11px; }
.sa-data-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 0; }.sa-data-grid--three { grid-template-columns: repeat(3,minmax(0,1fr)); }.sa-data-grid div { min-width: 0; }.sa-data-grid dt { color: var(--text-tertiary); text-transform: uppercase; font-size: 9px; font-weight: 800; }.sa-data-grid dd { margin: 5px 0 0; font-size: 12px; overflow-wrap: anywhere; }.sa-price { font-size: 28px; font-weight: 800; margin-bottom: 8px; }.sa-price small,.sa-price-line small { color: var(--text-secondary); font-size: 11px; font-weight: 500; }.sa-status-line,.sa-card-actions,.sa-limit-chips { display: flex; flex-wrap: wrap; gap: 8px; }.sa-card-actions { margin-top: 20px; }.sa-usage-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 25px; }
.sa-provisioning-card { display: flex; flex-direction: column; gap: 8px; }.sa-provisioning-summary { display: flex; justify-content: space-between; padding: 14px; background: #f1f5f9; }.sa-provisioning-summary span { display: flex; flex-direction: column; }.sa-provisioning-summary small { text-transform: uppercase; font-size: 9px; }.sa-provisioning-task { display: flex; gap: 8px; align-items: center; padding: 10px; background: #ecfdf5; color: #047857; }.sa-provisioning-task span { display: flex; flex-direction: column; }.sa-provisioning-task small { color: var(--text-secondary); }.sa-provisioning-task--pending,.sa-provisioning-task--inprogress { background: #f8fafc; color: #64748b; }.sa-provisioning-task--failed { background: #fef2f2; color: #dc2626; }
.sa-history-table { font-size: 11px; }.sa-history-head,.sa-history-row { display: grid; grid-template-columns: 140px 1fr 2fr; gap: 12px; padding: 10px; border-bottom: 1px solid var(--border-subtle); }.sa-history-head { background: #f1f5f9; text-transform: uppercase; font-size: 9px; font-weight: 800; }.sa-history-row strong { display: flex; flex-direction: column; }.sa-history-row small { color: var(--text-tertiary); }.sa-empty-inline { padding: 20px; text-align: center; color: var(--text-secondary); }
.sa-company-strip { padding: 14px; border: 1px solid var(--border-subtle); }.sa-company-strip > div:nth-child(2) { display: flex; flex-direction: column; }.sa-company-strip-status { margin-left: auto; display: flex; gap: 8px; }.sa-subscription-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }.sa-price-line { font-size: 25px; font-weight: 800; margin-bottom: 25px; }.sa-price-line > span { display: block; color: var(--text-secondary); font-size: 10px; font-weight: 500; }.sa-subscription-main { padding: 0; overflow: hidden; }.sa-subscription-main > * { margin-left: 20px; margin-right: 20px; }.sa-subscription-main .sa-card-title { margin: 0; padding: 20px 0 12px; }.sa-subscription-main .sa-card-actions { margin: 20px 0 0; padding: 14px 20px; background: #f8fafc; }.sa-limit-chips { margin-top: 20px; padding: 14px 0; background: #f8fafc; }.sa-usage-stack { display: flex; flex-direction: column; gap: 20px; }.sa-history-section h2 { font-size: 15px; }
.sa-change-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; align-items: start; }.sa-change-main { display: flex; flex-direction: column; gap: 20px; }.sa-company-change { display: flex; flex-direction: column; }.sa-company-change small,.sa-company-change span { color: var(--text-secondary); }.sa-step > h2 { font-size: 14px; display: flex; gap: 8px; align-items: center; }.sa-step > h2 > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #111827; color: white; font-size: 10px; }.sa-plan-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }.sa-plan-option { display: flex; flex-direction: column; gap: 5px; padding: 16px; border: 1px solid var(--border-subtle); background: white; text-align: left; cursor: pointer; }.sa-plan-option.selected { border: 2px solid #111827; }.sa-plan-option.current { opacity: .55; cursor: default; }.sa-plan-option b { font-size: 20px; }.sa-plan-option em { font-size: 10px; font-style: normal; }.sa-plan-option span { font-size: 11px; }.sa-comparison > div { display: grid; grid-template-columns: 1.4fr repeat(3,1fr); gap: 10px; padding: 10px; border-bottom: 1px solid var(--border-subtle); font-size: 11px; }.sa-comparison-head { background: #f1f5f9; font-size: 9px !important; font-weight: 800; }.sa-change-summary { position: sticky; top: 80px; }.sa-change-summary h2 { font-size: 13px; text-transform: uppercase; }.sa-change-summary dl div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 11px; }.sa-change-summary dd { margin: 0; font-weight: 700; }.sa-sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; background: rgba(255,255,255,.96); border-top: 1px solid var(--border-subtle); z-index: 2; }
@media(max-width:1100px){.sa-filters{grid-template-columns:1fr 1fr}.sa-kpi-grid,.sa-usage-grid{grid-template-columns:repeat(2,1fr)}.sa-overview-grid,.sa-subscription-layout,.sa-change-layout{grid-template-columns:1fr}.sa-change-summary{position:static}}
@media(max-width:700px){.sa-kpi-grid,.sa-filters,.sa-plan-grid,.sa-data-grid,.sa-data-grid--three,.sa-usage-grid{grid-template-columns:1fr}.sa-company-header,.sa-company-strip{align-items:flex-start;flex-wrap:wrap}.sa-company-header-actions,.sa-company-strip-status{margin-left:0;width:100%}.sa-history-head,.sa-history-row{grid-template-columns:90px 1fr}.sa-history-head span:last-child,.sa-history-row>span:last-child{grid-column:1/-1}.sa-pager{align-items:flex-start;gap:8px;flex-direction:column}}
.fq-tenant-access-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 18px;
    color: #78350f;
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
}

.fq-tenant-access-banner > .mud-icon-root { margin-top: 2px; flex: 0 0 auto; }
.fq-tenant-access-content { flex: 1; min-width: 0; }
.fq-tenant-access-summary { line-height: 1.45; }
.fq-tenant-access-mode {
    display: inline-flex;
    margin-left: 8px;
    padding: 1px 7px;
    border: 1px solid rgba(146, 64, 14, .28);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}
.fq-tenant-access-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.fq-tenant-access-permissions { position: relative; text-transform: none; }
.fq-tenant-access-permissions summary {
    cursor: pointer;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.fq-tenant-access-permissions > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
    padding: 8px;
    border: 1px solid rgba(146, 64, 14, .2);
    border-radius: 6px;
    background: rgba(255, 255, 255, .55);
}
.fq-tenant-access-permissions code {
    padding: 2px 5px;
    border-radius: 4px;
    color: #78350f;
    background: rgba(245, 158, 11, .13);
    font-size: 10px;
}
.fq-tenant-access-banner > .mud-button-root { flex: 0 0 auto; }

@media (max-width: 800px) {
    .fq-tenant-access-banner { flex-wrap: wrap; }
    .fq-tenant-access-content { width: calc(100% - 34px); }
    .fq-tenant-access-banner > .mud-button-root { margin-left: 34px; }
}
