/* ==========================================================================
   Pollo Contento · Hoja de estilos principal
   Orden de mantenimiento:
   1. Variables y base
   2. Navegación y elementos comunes
   3. Catálogo público
   4. Modales y formularios
   5. Administración e inventario
   6. Usuarios, roles y configuración
   7. Historial y POS
   8. Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables y base
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-soft: #edf4ff;
  --surface-muted: #f8fbff;
  --text: #17243d;
  --muted: #61708a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #d7e3f5;
  --border-strong: #bed3fa;
  --danger: #c53030;
  --danger-dark: #991b1b;
  --success: #047857;
  --warning: #a16207;
  --shadow: 0 18px 50px rgba(30, 72, 140, .09);
  --line: #dbe8f5;
  --ink: #17243d;
  --blue: #0877d1;
  --blue-soft: #e8f2ff;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: ui-rounded, Inter, system-ui, sans-serif;
  letter-spacing: -.03em;
}

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

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

.container {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

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

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}

/* --------------------------------------------------------------------------
   2. Navegación, marca, botones y mensajes
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.brand > span:last-child > span {
  color: var(--primary);
}

.brand .brand-emphasis {
  color: #dc2626 !important;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
  font-size: 19px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .22);
}

.brand-logo {
  overflow: hidden !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid var(--border);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 10px;
  color: #334155;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-link.active {
  background: #eff6ff;
  color: var(--primary-dark);
  font-weight: 800;
}

.nav-icon-link {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  padding: 0 !important;
  border: 1px solid #dbe6f6;
  background: #f8fafc;
}

.nav-icon-link.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.nav-gear-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 6px 11px;
  border: 1px solid #dbe6f6;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12.5px;
  font-weight: 650;
}

.nav-user strong {
  color: #0f172a;
  font-weight: 800;
}

.nav-user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .2);
}

.nav-logout {
  color: #dc2626;
}

.nav-logout:hover {
  background: #fef2f2;
  color: #991b1b;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .2);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button-outline {
  color: #1e293b;
  background: var(--surface);
  border-color: #cbd5e1;
}

.button-outline:hover:not(:disabled) {
  color: var(--primary-dark);
  background: #f8fafc;
  border-color: #93c5fd;
}

.button-ghost {
  color: var(--primary-dark);
  background: transparent;
  border-color: transparent;
}

.button-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.button-small {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 9px;
}

.button-wide {
  width: 100%;
}

.button-danger {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

.button-danger:hover:not(:disabled) {
  color: #fff !important;
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.notice {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.notice.success {
  color: #17643d;
  background: #e7f7ee;
  border: 1px solid #bde5ce;
}

.notice.error {
  color: #9f2d2d;
  background: #fff0f0;
  border: 1px solid #f2c0c0;
}

.notice.warning {
  color: #855b13;
  background: #fff7e5;
  border: 1px solid #f0d8a0;
}

.notice ul {
  margin: 7px 0 0;
  padding-left: 19px;
}

/* --------------------------------------------------------------------------
   3. Catálogo público: búsqueda, filtros y fichas ultra compactas modernas
   -------------------------------------------------------------------------- */

.hero {
  background: radial-gradient(circle at 50% 0%, #dbeafe 0%, #eff6ff 52%, #f8fafc 100%);
  border-bottom: 1px solid rgba(186, 208, 244, .75);
}

.hero-inner {
  padding: 16px 0 18px;
  text-align: center;
}

.hero h1 {
  margin-bottom: 15px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.hero p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
}

.search-bar {
  max-width: 740px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 5px 6px 5px 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, .08), 0 2px 6px -1px rgba(37, 99, 235, .05);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 10px 26px -6px rgba(37, 99, 235, .14);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.search-bar input:focus {
  box-shadow: none;
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  line-height: 1;
}

.clear-search {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.clear-search:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.search-submit-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
}

.catalog-section {
  padding: 16px 0 64px;
}

/* Panel unificado de filtros y controles del catálogo */
.catalog-control-dock {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #dbe6f6;
  border-radius: 14px;
  box-shadow: 0 6px 20px -8px rgba(15, 35, 75, .07);
  backdrop-filter: blur(8px);
}

.catalog-dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2fa;
}

.catalog-dock-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.catalog-filters-stack {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filters-chips-track {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 1px 2px 3px 0;
  scrollbar-width: thin;
}

.filters-chips-track::-webkit-scrollbar {
  height: 4px;
}

.filters-chips-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.filter-label {
  flex: none;
  min-width: 58px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  transition: all .15s ease;
}

.chip:hover {
  color: #0f172a;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chip.selected {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(37, 99, 235, .22);
}

/* Segmented switch de tarifas */
.price-mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 0;
}

.price-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.price-mode-switch .chip {
  padding: 4px 10px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 750;
  box-shadow: none;
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .65;
}

.price-mode-switch .chip.selected .mode-dot {
  background: #fff;
  opacity: 1;
}

/* Colores de las modalidades de precio */
.price-mode-chip-public {
  color: #1d4ed8;
}
.price-mode-chip-public:hover,
.price-mode-chip-public.selected {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}

.price-mode-chip-wholesale {
  color: #047857;
}
.price-mode-chip-wholesale:hover,
.price-mode-chip-wholesale.selected {
  color: #fff;
  background: #059669;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, .28);
}

.price-mode-chip-business {
  color: #b45309;
}
.price-mode-chip-business:hover,
.price-mode-chip-business.selected {
  color: #fff;
  background: #d97706;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, .28);
}

.price-mode-chip-family {
  color: #7e22ce;
}
.price-mode-chip-family:hover,
.price-mode-chip-family.selected {
  color: #fff;
  background: #9333ea;
  border-color: #9333ea;
  box-shadow: 0 2px 8px rgba(147, 51, 234, .28);
}

.results-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.results-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #334155;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.results-counter-pill strong {
  color: #0f172a;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.results-query {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.active-price-mode {
  display: none;
}

/* Base visual reutilizada por el catálogo y administración. */
.product-card,
.panel-card,
.stat-card,
.auth-card,
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

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

/* Fichas ultra compactas de última generación */
.product-card {
  position: relative;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 108px 62px;
  align-items: center;
  overflow: hidden;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #dce6f5;
  border-radius: 13px;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .05);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.product-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .13);
  transform: translateY(-1px);
}

.product-image-wrap {
  width: 66px;
  height: 66px;
  min-height: 66px;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f1f5f9, #f8fafc);
  border: 1px solid #e2e8f0;
  border-radius: 9px;
}

.product-image,
.product-image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
}

.product-image {
  object-fit: cover;
  transition: transform .25s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-image-placeholder {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 20px;
}

.product-card-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  padding: 2px 10px 2px 8px;
}

.product-topline {
  min-width: 0;
  max-width: 100%;
  height: 16px;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}

.product-topline > * {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag,
.unit-badge,
.margin-badge,
.status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.tag {
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.unit-badge {
  border: 1px solid;
}

.unit-piece {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.unit-kg {
  color: #0369a1;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.unit-bundle {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.unit-liter {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.department-badge,
.inventory-category {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid #c9dcf7;
  border-radius: 999px;
  color: #24518f;
  background: #eef6ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-badge {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.product-topline .department-badge {
  padding: 1px 6px;
  border-radius: 6px;
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #bfdbfe;
  font-size: 9px;
  font-weight: 800;
}

.catalog-sku {
  flex: 0 0 auto;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
}

.product-card h2 {
  min-width: 0;
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  margin: 1px 0 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-description {
  min-width: 0;
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.sku {
  display: block;
  margin-top: 2px;
  color: #8a978f;
  font-size: 10px;
}

.product-bottom {
  min-width: 0;
  height: 66px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: right;
}

.product-price-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
}

.price-label {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
}

.product-price {
  display: block;
  overflow: hidden;
  color: var(--primary);
  font-size: 18.5px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-unit {
  display: block;
  color: #64748b;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.price-mode-public {
  background: #f0f6ff;
  border-color: #d4e4fd;
}
.price-mode-public .price-label {
  color: #3b82f6;
}
.price-mode-public .product-price {
  color: #1d4ed8;
}

.price-mode-wholesale {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.price-mode-wholesale .price-label {
  color: #10b981;
}
.price-mode-wholesale .product-price {
  color: #047857;
}

.price-mode-business {
  background: #fffbeb;
  border-color: #fde68a;
}
.price-mode-business .price-label {
  color: #d97706;
}
.price-mode-business .product-price {
  color: #b45309;
}

.price-mode-family {
  background: #faf5ff;
  border-color: #e9d5ff;
}
.price-mode-family .price-label {
  color: #a855f7;
}
.price-mode-family .product-price {
  color: #7e22ce;
}

.catalog-actions-cell {
  min-width: 0;
  height: 66px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 0 2px 0 6px;
  border-left: 0;
  background: transparent;
}

.catalog-actions-cell > * {
  flex: 0 0 auto;
}

.info-price-button,
.calculator-icon-button {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.info-price-button {
  border: 1px solid #dbe6f6;
  color: #475569;
  background: #f8fafc;
}

.info-price-button:hover,
.info-price-button:focus-visible {
  color: var(--primary);
  background: #eff6ff;
  border-color: #93c5fd;
  outline: none;
  transform: translateY(-1px);
}

.calculator-icon-button {
  border: 1px solid #bfdbfe;
  color: var(--primary);
  background: #eff6ff;
}

.calculator-icon-button:hover,
.calculator-icon-button:focus-visible {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, .24);
  outline: none;
  transform: translateY(-1px);
}

.calculator-icon-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.calculator-icon {
  width: 15px;
  height: 15px;
  display: block;
}

.catalog-view-row {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.catalog-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f1f5f9;
}

.catalog-view-button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px !important;
  border: 0;
  border-radius: 6px;
  color: #64748b;
  background: transparent;
  font-size: 0;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}

.catalog-view-button:hover {
  color: #0f172a;
}

.catalog-view-button.selected {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}

.view-rows-icon {
  width: 14px;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
}

.view-rows-icon i {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

/* La consulta pública usa dos columnas por defecto; el selector puede cambiar
   el contenedor a una columna manteniendo la ficha ultra compacta. */
.public-catalog-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.public-catalog-grid.catalog-view-1 {
  grid-template-columns: 1fr !important;
}

.public-catalog-grid.catalog-view-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Compatibilidad con preferencias antiguas: la vista 3 se degrada a 2. */
.public-catalog-grid.catalog-view-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.public-catalog-grid .product-card {
  grid-template-columns: 72px minmax(0, 1fr) 108px 62px;
  height: 76px;
  min-height: 76px;
  border-radius: 12px;
}

.public-catalog-grid.catalog-view-1 .product-card {
  grid-template-columns: 72px minmax(0, 1fr) 124px 66px;
}

.public-catalog-grid .product-image-wrap {
  width: 64px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
}

.public-catalog-grid .product-card-content {
  padding: 2px 10px 2px 8px;
}

.public-catalog-grid .product-topline {
  height: 16px;
  min-height: 16px;
  gap: 4px;
}

.public-catalog-grid .product-card h2 {
  margin: 1px 0 0;
  font-size: 13.5px;
  line-height: 1.16;
  -webkit-line-clamp: 1;
}

.public-catalog-grid .product-description {
  font-size: 10.5px;
  line-height: 1.18;
  -webkit-line-clamp: 1;
}

.public-catalog-grid .product-bottom,
.public-catalog-grid .catalog-actions-cell {
  height: 64px;
  min-height: 64px;
}

.public-catalog-grid .product-bottom {
  padding: 4px 9px;
}

.public-catalog-grid .product-price {
  font-size: 18px;
  line-height: 1.05;
}

.public-catalog-grid .price-unit {
  font-size: 8.5px;
}

.public-catalog-grid .catalog-actions-cell {
  padding: 0 2px 0 5px;
}

/* --------------------------------------------------------------------------
   4. Estados vacíos, modales y formularios
   -------------------------------------------------------------------------- */

.empty-state {
  padding: 72px 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .6);
  text-align: center;
}

.empty-state.compact {
  padding: 40px;
}

.empty-icon {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 40px;
}

.empty-state h2 {
  margin-bottom: 4px;
}

.empty-state p {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 30, 19, .4);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 26px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--primary-dark);
}

.calculator-modal {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .2);
}

.calculator-modal h2 {
  margin-bottom: 4px;
  font-size: 30px;
}

.calculator-modal label {
  display: block;
  margin-top: 22px;
  font-size: 12px;
  font-weight: 800;
}

.calculator-modal input {
  margin-top: 7px;
}

.calculator-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

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

.calculator-total strong {
  color: var(--primary);
  font-size: 30px;
}

.product-info-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 32, 58, .68);
}

.product-info-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 22px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 35, 70, .22);
}

.product-info-dialog h2 {
  margin-bottom: 4px;
}

.info-description {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #e1ecfa;
  border-radius: 10px;
  color: var(--muted);
  background: #f6f9fe;
  font-size: 12px;
  line-height: 1.4;
}

.info-prices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.info-price-card {
  padding: 10px 8px;
  border: 1px solid #dce7f7;
  border-radius: 12px;
  background: #fafcff;
  text-align: center;
}

.info-price-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.info-price-card strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.info-price-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.info-price-card.info-price-public {
  border-color: #b5d2fc;
  background: #f2f7ff;
}

.info-price-card.info-price-public span,
.info-price-card.info-price-public strong {
  color: #1a5ec8;
}

.info-price-card.highlight-wholesale {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.info-price-card.highlight-wholesale span,
.info-price-card.highlight-wholesale strong {
  color: #047857;
}

.info-price-card.highlight-business {
  border-color: #f2c46d;
  background: #fff8ed;
}

.info-price-card.highlight-business span,
.info-price-card.highlight-business strong {
  color: #b45309;
}

.info-price-card.highlight-family {
  border-color: #d8b4fe;
  background: #faf5ff;
}

.info-price-card.highlight-family span,
.info-price-card.highlight-family strong {
  color: #9333ea;
}

/* Formularios generales */

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.form-stack label,
.form-section label,
.pricing-box label {
  color: #30473a;
  font-size: 12px;
  font-weight: 800;
}

.form-stack label input,
.form-stack label textarea,
.form-stack label select {
  margin-top: 6px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

.form-section {
  padding-top: 19px;
  border-top: 1px solid var(--border);
}

.form-section h2 {
  margin-bottom: 3px;
  font-size: 18px;
}

.form-section h2 + .muted {
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 9px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}

.check-label input {
  width: auto;
}

.pricing-box {
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

/* Modal amigable de edición y alta de producto */
.product-modal-header {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  padding: 16px 56px 14px 20px !important;
}

.product-modal-header .eyebrow {
  margin-bottom: 4px;
}

.product-editor-form {
  gap: 14px;
  padding: 16px 20px 20px !important;
  background: #f1f5f9;
}

.editor-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .03);
}

.editor-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.editor-step-badge {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.editor-section-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

.editor-section-head p {
  margin: 1px 0 0;
  color: #64748b;
  font-size: 11.5px;
}

.req-star {
  color: #dc2626;
}

.muted-inline {
  color: #64748b;
  font-weight: 500;
}

.visibility-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
}

.visibility-switch input {
  width: 16px !important;
  height: 16px;
  margin: 0 !important;
  accent-color: #059669;
  cursor: pointer;
}

.visibility-switch-label {
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 750;
}

.product-title-sku-grid {
  grid-template-columns: minmax(0, 2.2fr) minmax(150px, 1fr);
}

.new-taxonomy-box {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
}

/* Costo base destacado */
.base-cost-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 12px;
  color: #fff;
}

.base-cost-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}

.base-cost-copy small {
  display: block;
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 11px;
}

.base-cost-input-wrap {
  position: relative;
  width: 190px;
  max-width: 100%;
  display: flex;
  align-items: center;
}

.base-cost-input-wrap .input-prefix {
  position: absolute;
  left: 11px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 850;
  pointer-events: none;
}

.base-cost-input-wrap input {
  margin: 0 !important;
  padding: 9px 12px 9px 26px !important;
  border: 2px solid #60a5fa;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 16px;
  font-weight: 850 !important;
  font-variant-numeric: tabular-nums;
}

/* Cuadrícula 2x2 de las 4 tarifas */
.tariff-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tariff-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}

.tariff-card-public {
  background: #f0f6ff;
  border-color: #bfdbfe;
}

.tariff-card-wholesale {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.tariff-card-business {
  background: #fffbeb;
  border-color: #fde68a;
}

.tariff-card-family {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.tariff-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tariff-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.tariff-badge-public {
  color: #1d4ed8;
  background: #dbeafe;
}

.tariff-badge-wholesale {
  color: #047857;
  background: #d1fae5;
}

.tariff-badge-business {
  color: #b45309;
  background: #fef3c7;
}

.tariff-badge-family {
  color: #7e22ce;
  background: #f3e8ff;
}

.tariff-subtitle {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
}

.tariff-profit-pill {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(15, 23, 42, .08);
  color: #0f172a;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tariff-mode-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
}

.mode-pill-option {
  margin: 0 !important;
  padding: 3px 8px !important;
  border-radius: 6px;
  color: #64748b !important;
  font-size: 10.5px !important;
  font-weight: 750 !important;
  cursor: pointer;
  transition: all .14s ease;
}

.mode-pill-option input {
  display: none;
}

.mode-pill-option.is-selected {
  color: #fff !important;
  background: #0f172a;
}

.tariff-card-business .mode-pill-option.is-selected {
  background: #d97706;
}

.tariff-card-family .mode-pill-option.is-selected {
  background: #9333ea;
}

.tariff-inputs-row label {
  font-size: 11px !important;
}

.input-affix-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.input-affix-wrap input {
  margin-top: 0 !important;
  font-variant-numeric: tabular-nums;
}

.input-affix-wrap .input-prefix {
  position: absolute;
  left: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.input-affix-wrap .input-suffix {
  position: absolute;
  right: 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.input-affix-wrap.is-final-price input {
  padding-left: 22px;
  font-weight: 800 !important;
  color: #0f172a;
}

.photo-uploader-grid {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.photo-picker-controls {
  flex: 1;
  min-width: 200px;
}

.product-modal-footer {
  justify-content: flex-end;
  padding-top: 4px;
}

.calculated-price {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #c9daf5;
}

.calculated-price span,
.calculated-price small {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
}

.calculated-price span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.calculated-price strong {
  display: block;
  color: var(--primary-dark);
  font-size: 26px;
}

.pricing-sections-stack {
  display: grid;
  gap: 12px;
}

.pricing-rule-card {
  border-radius: 12px;
}

.pricing-rule-business {
  background: #fff8ed;
  border: 2px solid #f2c46d;
}

.pricing-rule-wholesale {
  background: #f0f5ff;
  border: 2px solid #9dbcf2;
}

.pricing-rules-wholesale {
  display: grid;
  gap: 12px;
}

.pricing-rule-card .form-grid {
  margin-top: 6px;
}

.category-picker {
  display: grid;
  gap: 7px;
}

.category-picker label + label {
  margin-top: 2px;
}

.field-help {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 10px;
}

/* Instalador */

.install-page {
  background: linear-gradient(140deg, #e6efff, #f8fbff);
}

.install-shell {
  width: min(620px, calc(100% - 32px));
  margin: 45px auto;
}

.install-card {
  padding: 34px;
}

.brand-center {
  justify-content: center;
  margin-bottom: 25px;
}

.install-card h1 {
  margin-bottom: 7px;
  text-align: center;
  font-size: 34px;
}

.install-card > .muted {
  text-align: center;
}

.security-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.security-note code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-soft);
}

.photo-upload-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #bed3fa;
  border-radius: 14px;
  background: #f2f7ff;
}

.photo-upload-copy strong {
  display: block;
  font-size: 13px;
}

.photo-upload-copy small,
.file-name {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  border: 1px dashed #8bb1ee;
  border-radius: 10px;
  color: var(--primary-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.file-input-label:hover {
  background: #edf4ff;
}

.file-input-label input {
  display: none;
}

.photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.remove-photo {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--danger) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.remove-photo input {
  width: auto !important;
  margin: 0 !important;
}

/* Login */

.auth-main {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 45px 18px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 35px;
  text-align: center;
}

.auth-card h1 {
  margin-bottom: 7px;
  font-size: 31px;
}

.auth-card .form-stack {
  text-align: left;
}

.auth-logo {
  width: 112px !important;
  height: 112px !important;
  display: grid !important;
  place-items: center;
  overflow: hidden !important;
  margin: 0 auto 18px !important;
  padding: 0 !important;
  border: 1px solid var(--border);
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(30, 72, 140, .12);
}

.auth-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-submit-button {
  color: #fff !important;
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  box-shadow: 0 7px 15px rgba(220, 38, 38, .18) !important;
}

.login-submit-button:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

.back-link {
  display: inline-block;
  margin-top: 21px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

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

.password-field > label {
  color: #30473a;
  font-size: 12px;
  font-weight: 800;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  margin-top: 0 !important;
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--primary-dark);
  background: var(--surface-soft);
  outline: 2px solid var(--border-strong);
  outline-offset: 1px;
}

.password-eye {
  width: 18px;
  height: 18px;
}

.remember-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  cursor: pointer;
}

.remember-option input {
  width: 16px !important;
  height: 16px;
  margin: 0 !important;
  accent-color: var(--primary);
}

/* --------------------------------------------------------------------------
   5. Administración e inventario
   -------------------------------------------------------------------------- */

.admin-main {
  padding-top: 10px;
  padding-bottom: 50px;
}

.admin-container {
  width: min(1680px, calc(100% - 28px));
  max-width: 1680px;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #dbe6f6;
  border-radius: 14px;
  box-shadow: 0 4px 14px -6px rgba(15, 35, 75, .06);
}

.admin-heading h1 {
  margin: 0 0 2px;
  font-size: 24px;
}

/* Barra superior ultra compacta de administración */
.admin-compact-bar {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  box-shadow: 0 4px 14px -6px rgba(15, 35, 75, .06);
}

.admin-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #475569;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  transition: all .14s ease;
}

.admin-tab .btn-svg {
  width: 14px;
  height: 14px;
}

.admin-tab:hover {
  color: #0f172a;
}

.admin-tab.is-active {
  color: var(--primary-dark);
  background: #ffffff;
  border-color: #dbe6f6;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.admin-tab-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .07);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.admin-tab.is-active .admin-tab-badge {
  background: #2563eb;
  color: #fff;
}

.admin-compact-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.csv-dropdown {
  position: relative;
}

.csv-dropdown-trigger {
  list-style: none;
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 8px;
  user-select: none;
}

.csv-dropdown-trigger::-webkit-details-marker {
  display: none;
}

.csv-caret {
  font-size: 10px;
  opacity: .7;
}

.csv-dropdown[open] .csv-dropdown-trigger {
  color: var(--primary-dark);
  background: #eff6ff;
  border-color: #93c5fd;
}

.csv-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 60;
  width: 215px;
  display: grid;
  gap: 3px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

.csv-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #1e293b;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.csv-menu-item:hover {
  background: #eff6ff;
  color: var(--primary-dark);
}

.admin-add-product-btn {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  white-space: nowrap;
}

.inline-import-form {
  margin: 0;
}

.import-file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.import-file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Estadísticas KPI */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #dbe6f6;
  border-top: 3px solid #93c5fd;
  border-radius: 16px;
}

.stat-card-primary {
  border-top-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.stat-card-success {
  border-top-color: #10b981;
  background: linear-gradient(180deg, #f2fdf9 0%, #ffffff 100%);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-icon {
  font-size: 14px;
  line-height: 1;
  color: #10b981;
}

.stat-card span,
.stat-card small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  color: #0f172a;
  font-size: 34px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.stat-card small {
  font-size: 11.5px;
  font-weight: 550;
  text-transform: none;
  letter-spacing: 0;
}

.stats-section {
  padding-bottom: 20px;
}

.stats-section > .panel-heading {
  padding-bottom: 12px;
  border-bottom: 0;
}

.stats-section .eyebrow {
  margin-bottom: 5px;
}

.stats-section .stats-grid {
  margin: 0;
  padding: 0 20px 20px;
}

/* Vista de Departamentos y Categorías moderna */
.taxonomy-workspace {
  display: grid;
  gap: 24px;
  padding: 20px;
  background: #f8fafc;
}

.taxonomy-creator-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dbe6f6;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
}

.taxonomy-creator-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.taxonomy-creator-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

.taxonomy-creator-head p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 11.5px;
}

.taxonomy-inline-create {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.taxonomy-inline-create input,
.taxonomy-inline-create select {
  padding: 9px 11px;
  font-size: 13px;
}

.taxonomy-inline-create-cat select {
  max-width: 190px;
}

.taxonomy-inline-create .button {
  flex: none;
  white-space: nowrap;
}

.taxonomy-list-block {
  display: grid;
  gap: 14px;
}

.taxonomy-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.taxonomy-list-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.dept-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.dept-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #dbe6f6;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .03);
}

.dept-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2fa;
}

.dept-rename-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.dept-rename-form input {
  padding: 6px 9px;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 800;
}

.dept-rename-form input:focus {
  background: #fff;
}

.dept-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.dept-card-meta form {
  margin: 0;
}

.taxonomy-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.taxonomy-count-pill.is-subtle {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.dept-cats-label {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dept-empty-cats {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

.dept-cats-stack {
  display: grid;
  gap: 6px;
}

.cat-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.cat-item-row input {
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
}

.cat-item-row .button {
  padding: 5px 8px;
  font-size: 11px;
}

.admin-layout,
.users-layout {
  display: grid;
  align-items: start;
  gap: 18px;
}

.admin-layout {
  grid-template-columns: minmax(280px, 370px) minmax(0, 1fr);
}

.users-layout {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.inventory-only-layout {
  display: block;
}

.panel-card {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.panel-heading h2 {
  margin: 0 0 3px;
  color: #0f172a;
  font-size: 19px;
}

.panel-heading p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

/* Barra de filtros con buscador destacado del inventario */
.inventory-compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f6fe 100%);
  border-bottom: 1px solid #dbe6f6;
}

.calc-label {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.panel-card > .form-stack {
  margin-top: 0;
  padding: 20px;
}

.inventory-panel {
  min-width: 0;
}

.inventory-filter-form {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  min-width: 0;
}

.inventory-search-row {
  display: contents;
}

.inventory-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  min-width: 220px;
}

.inventory-search-icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--primary);
  pointer-events: none;
}

.search-count-badge {
  position: absolute;
  right: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.inventory-filter-form input {
  width: 100%;
  height: 44px;
  padding: 8px 52px 8px 38px;
  border: 2px solid #93c5fd;
  border-radius: 11px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .09);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.inventory-filter-form input::placeholder {
  color: #64748b;
  font-weight: 500;
}

.inventory-filter-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .16), 0 6px 16px rgba(37, 99, 235, .12);
}

.inventory-filter-form select {
  width: auto;
  min-width: 145px;
  height: 38px;
  padding: 6px 10px;
  border-color: #cbd5e1;
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 650;
}

.inventory-filter-form [data-inventory-category-filter] {
  min-width: 150px;
}

.filter-reset-btn {
  height: 38px;
  padding: 5px 10px;
  font-size: 12px;
}

.bulk-toggle-btn {
  order: 10;
  height: 38px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  flex: none;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inventory-table {
  width: 100%;
  min-width: 1160px;
  table-layout: auto;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  height: 58px;
  padding: 7px 9px;
  overflow: hidden;
  border-bottom: 1px solid #edf2fa;
  vertical-align: middle;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-table tbody tr {
  transition: background-color .14s ease;
}

.inventory-table tbody tr:hover {
  background: #f8fbff;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  padding: 6px 9px;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.inventory-table th.th-public {
  color: #1d4ed8;
  background: #eff6ff;
}

.inventory-table th.th-wholesale {
  color: #047857;
  background: #ecfdf5;
}

.inventory-table th.th-business {
  color: #b45309;
  background: #fffbeb;
}

.inventory-table th.th-family {
  color: #7e22ce;
  background: #faf5ff;
}

.inventory-table td {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.inventory-table .unit-badge {
  padding: 3px 8px;
  font-size: 11px;
}

.inventory-table th.bulk-selection-column,
.inventory-table td.bulk-selection-column {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  width: 290px;
  min-width: 230px;
  max-width: 350px;
}

.product-cell-admin {
  position: relative;
  min-width: 230px;
  padding: 0 !important;
  overflow: hidden;
}

.admin-thumb {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  flex: 0 0 42px !important;
  object-fit: cover;
  border: 1px solid #dbe6f6;
  border-radius: 9px;
  background: var(--surface-soft);
}

.admin-thumb-placeholder {
  display: inline-grid !important;
  place-items: center !important;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.admin-thumb-placeholder svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inventory-product-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 7px 10px;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  transition: background .15s ease;
}

.inventory-product-link:hover {
  background: rgba(37, 99, 235, .05);
}

.inventory-product-link:hover strong {
  color: var(--primary);
}

.inventory-product-link:active {
  background: rgba(37, 99, 235, .1);
}

.inventory-product-link:focus-visible {
  outline: 2px solid #8bb1ee;
  outline-offset: -2px;
  border-radius: 6px;
}

.inventory-product-link > span:not(.admin-thumb),
.inventory-product-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.inventory-product-link strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .14s ease;
}

.inventory-product-link small {
  display: block;
  flex: 0 0 auto;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.inline-pricing-cell {
  position: relative;
  z-index: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.inline-pricing-cell:focus-within {
  z-index: 30;
}

.inline-pricing-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font-size: 13.5px;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.inline-pricing-value::after {
  content: "✎";
  opacity: 0;
  font-size: 10px;
  color: #64748b;
  transition: opacity .14s ease;
}

.inline-pricing-value:hover::after,
.inline-pricing-value:focus-visible::after {
  opacity: .85;
}

.inline-pricing-value:hover,
.inline-pricing-value:focus-visible {
  outline: none;
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .1);
}

.inline-cost-pill {
  color: #334155;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.tariff-pill-public,
.tariff-pill-wholesale,
.tariff-pill-business,
.tariff-pill-family {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tariff-pill-public {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.tariff-pill-Public strong,
.tariff-pill-public strong {
  color: #1d4ed8;
}

.tariff-pill-wholesale {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
}

.tariff-pill-business {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.tariff-pill-business strong {
  color: #b45309;
}

.tariff-pill-family {
  color: #7e22ce;
  background: #faf5ff;
  border: 1px solid #f3e8ff;
}

.inline-pricing-form {
  position: relative;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 2px;
  border: 1px solid #bed3fa;
  border-radius: 9px;
  background: #f8fbff;
  box-shadow: 0 8px 22px rgba(30, 72, 140, .18);
}

.inline-pricing-input {
  width: 86px !important;
  padding: 6px 7px !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
}

.inline-pricing-suffix {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inline-pricing-save,
.inline-pricing-cancel {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.inline-pricing-save {
  color: var(--primary-dark);
  background: #e8f0ff;
}

.inline-pricing-save:hover {
  color: #fff;
  background: var(--primary);
}

.inline-pricing-cancel {
  color: var(--muted);
  background: #f1f4f8;
}

.inline-pricing-cancel:hover {
  color: var(--text);
  background: #e4e9f0;
}

.margin-badge {
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12.5px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.status-hidden {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

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

.actions a,
.link-danger {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.actions .link-danger {
  color: var(--danger);
}

.inventory-panel .actions {
  display: table-cell !important;
  padding: 0 8px !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.inventory-action-buttons {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.inventory-action-buttons .inventory-edit-button,
.inventory-action-buttons .history-button,
.inventory-action-buttons .inventory-delete-button {
  width: 35px;
  height: 35px;
  min-width: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 9px;
  transition: all .15s ease;
}

.inventory-action-buttons .inventory-edit-button svg,
.inventory-action-buttons .history-button svg,
.inventory-action-buttons .inventory-delete-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.inventory-action-buttons .inventory-edit-button {
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #f8fafc;
}

.inventory-action-buttons .inventory-edit-button:hover {
  color: var(--primary-dark);
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.inventory-action-buttons .inventory-delete-form {
  display: flex;
  align-items: center;
  margin: 0;
}

.inventory-action-buttons .inventory-delete-button {
  padding: 0;
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fef2f2;
  cursor: pointer;
}

.inventory-action-buttons .inventory-delete-button:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.inventory-action-buttons .inventory-delete-button:active {
  background: #b91c1c;
}

.history-button {
  border: 1px solid #bfdbfe;
  color: var(--primary-dark) !important;
  background: #eff6ff;
}

.history-button:hover {
  color: #fff !important;
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Filtros y edición masiva */

.bulk-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid #dce9f8;
  border-bottom: 1px solid #dce9f8;
  background: #f4f8ff;
}

.bulk-actions-summary,
.bulk-actions-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-actions-summary {
  color: var(--primary-dark);
  font-size: 12px;
}

.bulk-actions-form {
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.bulk-actions-form label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bulk-actions-form select {
  width: auto;
  max-width: 190px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cbdcf2;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.bulk-toggle-btn.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
}

.bulk-selection-column {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 5px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* Las casillas de edición masiva permanecen ocultas salvo que se active explícitamente el modo masivo */
.inventory-panel:not(.is-bulk-mode) .bulk-selection-column,
.inventory-panel .inventory-table th.bulk-selection-column[hidden],
.inventory-panel .inventory-table td.bulk-selection-column[hidden],
.bulk-selection-column[hidden] {
  display: none !important;
}

.bulk-selection-column input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.bulk-select-all-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--primary-dark);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.bulk-select-all-icon:hover {
  background: #e2efff;
}

/* Modal de productos */

.product-modal-backdrop {
  z-index: 80;
  align-items: start;
  overflow: auto;
  padding: 24px 16px;
  background: rgba(15, 32, 58, .66);
}

.product-modal-dialog {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 45, 90, .28);
}

.product-modal-card {
  overflow: visible;
  border: 0;
  border-radius: 18px;
  box-shadow: none;
}

.product-modal-card .panel-heading {
  padding-right: 58px;
}

.product-modal-close {
  z-index: 3;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--primary-dark);
  background: #edf4ff;
  font-size: 24px;
  line-height: 1;
}

.product-modal-close:hover {
  color: #fff;
  background: var(--primary);
}

.product-modal-dialog .form-stack {
  margin-top: 0;
  padding: 20px;
}

.product-modal-dialog .form-actions {
  padding-bottom: 2px;
}

/* --------------------------------------------------------------------------
   6. Usuarios, roles, categorías y configuración
   -------------------------------------------------------------------------- */

.users-page .panel-card {
  height: fit-content;
}

.users-page .user-list-card {
  overflow: visible;
}

.users-page .user-list {
  overflow: visible;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 20px;
}

.user-row {
  display: grid;
  grid-template-columns: 40px minmax(130px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  border-top: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

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

.user-info strong {
  font-size: 14px;
}

.user-info span,
.user-info small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info span {
  font-size: 12px;
}

.user-info small {
  font-size: 10px;
}

.user-current {
  display: inline-block !important;
  width: max-content;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--blue) !important;
  background: var(--blue-soft);
  font-size: 9px !important;
  font-weight: 800;
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-role-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.user-role-form select {
  width: auto;
  min-width: 130px;
  padding: 7px 8px;
  font-size: 11px;
}

.user-delete-form {
  margin: 0;
}

.user-password-details {
  position: relative;
}

.user-password-details summary {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.user-password-details summary::-webkit-details-marker {
  display: none;
}

.user-password-form {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 50;
  width: 230px;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22, 69, 112, .16);
}

.user-password-form input {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}

.user-prices-details {
  position: relative;
  z-index: 1;
}

.user-prices-details[open] {
  z-index: 80;
}

.user-prices-details summary {
  min-width: 92px;
  padding: 7px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.user-prices-form {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  width: 260px;
  max-width: min(260px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 35, 70, .2);
}

.user-prices-form > strong {
  color: var(--text);
  font-size: 12px;
}

.user-price-inherit-label {
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.user-custom-modes-block {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8fafc;
}

.user-custom-modes-block.is-inherited {
  opacity: .4;
}

.user-custom-modes-block .check-label {
  font-size: 11.5px;
}

.user-prices-form > .button {
  width: 100%;
}

.user-catalog-details {
  position: relative;
  z-index: 1;
}

.user-catalog-details[open] {
  z-index: 90;
}

.user-catalog-details summary {
  min-width: 78px;
  padding: 7px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.user-catalog-form {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 90;
  width: 350px;
  max-width: min(350px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 32px));
  overflow-y: auto;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 35, 70, .2);
}

.user-catalog-form > strong {
  color: var(--text);
  font-size: 12px;
}

.user-catalog-inherit-label,
.user-catalog-all-label {
  font-size: 11px;
  font-weight: 700;
}

.user-catalog-inherit-label {
  color: #2563eb;
}

.user-catalog-scope-fields {
  display: grid;
  gap: 8px;
}

.user-catalog-scope-fields[data-disabled="1"] {
  opacity: .48;
}

.user-department-list,
.user-category-list {
  display: grid;
  gap: 4px;
  max-height: 150px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}

.user-access-section-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-catalog-form .check-label {
  min-height: 26px;
  padding: 4px 5px;
  border-radius: 6px;
  font-size: 11px;
}

.user-catalog-form .check-label:hover {
  background: #eef6ff;
}

.user-catalog-help {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.user-catalog-form > .button {
  width: 100%;
}

.role-price-list,
.role-category-list {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
}

.role-price-list .check-label,
.role-category-list .check-label {
  min-height: 32px;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
}

.role-price-list .check-label:hover,
.role-category-list .check-label:hover {
  background: var(--surface-soft);
}

.role-category-list > p {
  margin-bottom: 4px;
}

.categories-management-section {
  overflow: visible;
}

.settings-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.global-settings-card,
.settings-page .panel-card {
  max-width: none;
}

.settings-shortcuts-stack {
  display: grid;
  gap: 12px;
}

.settings-shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #dbe6f6;
  border-radius: 16px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.settings-shortcut-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .14);
  transform: translateY(-1px);
}

.settings-shortcut-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 18px;
}

.settings-shortcut-copy {
  flex: 1;
  min-width: 0;
}

.settings-shortcut-copy strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.settings-shortcut-copy p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.settings-shortcut-arrow {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .settings-hub-grid {
    grid-template-columns: 1fr;
  }
}

.settings-page .form-stack {
  padding: 20px;
}

.settings-note {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   7. Historial y Punto de Venta
   -------------------------------------------------------------------------- */

.history-modal {
  z-index: 60;
  overflow: auto;
  background: rgba(15, 32, 58, .58);
}

.history-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 26px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 45, 90, .28);
}

.history-dialog h2 {
  margin: 0 32px 4px 0;
  color: var(--text);
  font-size: 25px;
}

.history-dialog > .eyebrow {
  margin-bottom: 8px;
}

.history-dialog > .muted {
  margin-bottom: 18px;
}

.history-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.history-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
}

.history-table th {
  color: #52637d;
  background: #edf4ff;
  font-size: 10px;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table tbody tr:hover {
  background: #f8fbff;
}

.history-table td strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.history-dialog .empty-state {
  margin-top: 14px;
  background: #f8fbff;
}

.history-dialog .modal-close {
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--primary-dark);
  background: #edf4ff;
  line-height: 1;
}

.history-dialog .modal-close:hover {
  color: #fff;
  background: var(--primary);
}

/* POS conservado como módulo independiente. */

.pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: start;
  gap: 20px;
}

.pos-product-list {
  max-height: 640px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.pos-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.pos-product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .12);
}

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

.pos-card-cat {
  display: block;
  margin-bottom: 2px;
  color: var(--primary);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-card-title {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-card-unit {
  display: block;
  color: #64748b;
  font-size: .75rem;
}

.pos-card-price {
  flex-shrink: 0;
  text-align: right;
}

.pos-card-price span:first-child {
  display: block;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
}

.pos-add-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border-radius: 6px;
  color: var(--primary);
  background: #eff6ff;
  font-size: 1rem;
  font-weight: 700;
}

.pos-cart-items {
  max-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 8px 0;
}

.pos-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #f8fafc;
}

.pos-qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pos-qty-input {
  width: 56px;
  height: 26px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .8rem;
  text-align: center;
}

.pos-cart-summary {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.pos-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #475569;
  font-size: .95rem;
}

.pos-total-row strong {
  color: var(--primary);
  font-size: 1.7rem;
}

.pos-cash-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: .8rem;
  font-weight: 700;
}

.pos-cash-label input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 800;
}

.pos-cash-denominations,
.pos-top-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pos-cash-denominations {
  margin-bottom: 12px;
}

.pos-change-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  background: #ecfdf5;
}

.pos-change-box strong {
  color: #047857;
  font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 1800px) {
  .admin-container {
    max-width: 1760px;
  }
}

@media (min-width: 701px) {
  .inventory-panel .table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 960px) {
  .pos-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-layout,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .inventory-panel {
    order: 2;
  }

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

  .admin-actions {
    justify-content: flex-start;
  }

  .admin-actions .button {
    padding: 8px 10px;
    font-size: 11px;
  }

  .inventory-filter-form {
    width: 100%;
    justify-content: flex-start;
  }

  .inventory-filter-form input {
    flex: 1;
    min-width: 180px;
  }

  .inventory-filter-form select {
    flex: 1;
    min-width: 140px;
  }

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

  .product-card {
    grid-template-columns: 68px minmax(0, 1fr) 100px 58px;
  }

  .product-image-wrap {
    width: 60px;
    height: 60px;
    min-height: 60px;
  }

  .product-card-content {
    padding: 2px 8px;
  }

  .product-bottom,
  .catalog-actions-cell {
    height: 60px;
    min-height: 60px;
  }

  .product-bottom {
    padding: 4px 8px;
  }

  .product-price {
    font-size: 17px;
  }

  .inventory-table th,
  .inventory-table td {
    padding: 8px 5px;
    font-size: 11px;
  }

  .inventory-table .inline-pricing-value {
    padding: 4px 3px;
  }

  .inventory-table .inline-pricing-input {
    width: 70px !important;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .catalog-view-row {
    display: none !important;
  }

  .public-catalog-grid,
  .public-catalog-grid.catalog-view-2,
  .public-catalog-grid.catalog-view-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .public-catalog-grid .product-card,
  .public-catalog-grid.catalog-view-1 .product-card {
    grid-template-columns: 64px minmax(0, 1fr) 92px 56px !important;
    height: 72px !important;
    min-height: 72px !important;
  }

  .public-catalog-grid .product-image-wrap {
    width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
  }

  .public-catalog-grid .product-bottom,
  .public-catalog-grid .catalog-actions-cell {
    height: 58px !important;
    min-height: 58px !important;
  }

  .public-catalog-grid .product-card h2 {
    font-size: 13px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }

  .public-catalog-grid .product-description {
    font-size: 10px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }
}

@media (orientation: landscape) and (min-width: 420px) and (max-height: 600px) {
  .catalog-view-row {
    display: flex;
  }

  .public-catalog-grid,
  .public-catalog-grid.catalog-view-2,
  .public-catalog-grid.catalog-view-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .public-catalog-grid.catalog-view-1 {
    grid-template-columns: 1fr !important;
  }

  .public-catalog-grid .product-card {
    grid-template-columns: 64px minmax(0, 1fr) 92px 54px !important;
    height: 70px !important;
    min-height: 70px !important;
  }

  .public-catalog-grid.catalog-view-1 .product-card {
    grid-template-columns: 64px minmax(0, 1fr) 104px 58px !important;
  }

  .public-catalog-grid .product-image-wrap {
    width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
  }

  .public-catalog-grid .product-bottom,
  .public-catalog-grid .catalog-actions-cell {
    height: 58px !important;
    min-height: 58px !important;
  }

  .public-catalog-grid .product-card-content {
    padding: 2px 6px !important;
  }

  .public-catalog-grid .product-card h2 {
    font-size: 12.5px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }

  .public-catalog-grid .product-description {
    font-size: 9.5px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  .inventory-heading-actions {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
    flex-direction: column;
  }

  .inventory-heading-actions .inline-search {
    min-width: 0;
    flex: 1;
  }

  .bulk-actions-toolbar {
    align-items: stretch;
    padding: 11px 12px;
  }

  .bulk-actions-summary,
  .bulk-actions-form {
    width: 100%;
    justify-content: stretch;
  }

  .bulk-actions-form label,
  .bulk-actions-form select,
  .bulk-actions-form .button {
    width: 100%;
    max-width: none;
  }

  .inventory-panel .table-wrap {
    overflow-x: auto;
  }

  .inventory-panel table.inventory-table {
    width: max-content !important;
    min-width: 1020px !important;
    table-layout: auto !important;
  }

  .inventory-panel .inventory-table tr:not([hidden]) {
    display: table-row !important;
  }

  .inventory-panel .inventory-table td:not([hidden]):not(.bulk-selection-column),
  .inventory-panel .inventory-table th:not([hidden]):not(.bulk-selection-column) {
    display: table-cell !important;
    text-align: left !important;
    padding: 7px 8px !important;
  }

  .inventory-panel.is-bulk-mode .inventory-table th.bulk-selection-column:not([hidden]),
  .inventory-panel.is-bulk-mode .inventory-table td.bulk-selection-column:not([hidden]) {
    display: table-cell !important;
    text-align: center !important;
    padding: 5px !important;
  }

  .inventory-panel:not(.is-bulk-mode) .inventory-table .bulk-selection-column,
  .inventory-panel .inventory-table th.bulk-selection-column[hidden],
  .inventory-panel .inventory-table td.bulk-selection-column[hidden] {
    display: none !important;
  }

  .inventory-panel .inventory-table thead {
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    overflow: visible !important;
  }

  .inventory-panel .inventory-table td::before {
    display: none !important;
  }

  .inventory-panel .inline-pricing-cell,
  .inventory-panel .actions {
    white-space: nowrap !important;
  }

  .inventory-panel .actions {
    padding: 0 6px !important;
  }

  .inventory-action-buttons {
    min-height: 52px;
    gap: 6px;
  }

  .inventory-action-buttons .inventory-edit-button,
  .inventory-action-buttons .history-button,
  .inventory-action-buttons .inventory-delete-button {
    width: 35px;
    height: 35px;
    min-width: 35px;
  }

  .inventory-panel .product-cell-admin .inventory-product-link {
    min-height: 54px;
    padding: 7px 8px;
    gap: 9px;
  }

  .inventory-panel .product-cell-admin .admin-thumb {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
  }

  .inventory-panel .inventory-product-link strong {
    max-width: 165px;
    font-size: 13.5px;
  }

  .inventory-category,
  .department-badge {
    max-width: 145px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .user-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
  }

  .user-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
    padding-top: 4px;
  }

  .user-role-form {
    flex-wrap: wrap;
  }

  .user-role-form select {
    min-width: 0;
    flex: 1 1 140px;
  }

  .user-password-details {
    grid-column: auto;
  }

  .user-password-form {
    left: 0;
    right: auto;
  }

  .user-prices-details {
    flex-basis: auto;
  }

  .user-prices-form {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    z-index: 1000;
  }

  .user-catalog-form {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 32px);
    z-index: 1000;
  }

  .site-header {
    height: auto;
    min-height: 54px;
    padding: 6px 0;
  }

  .site-header .nav-wrap {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .site-header .brand {
    gap: 6px;
    font-size: 16.5px;
  }

  .site-header .top-nav {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .nav-hide-mobile {
    display: none;
  }

  .site-header .nav-link {
    height: 34px;
    padding: 0 9px;
    font-size: 12.5px;
    line-height: 1;
  }

  .site-header .nav-icon-link {
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex: 0 0 34px;
    padding: 0 !important;
  }

  .site-header .nav-gear-icon {
    width: 16px;
    height: 16px;
  }

  .site-header .nav-user {
    display: none;
  }

  .admin-main {
    padding-top: 6px;
  }

  .admin-container,
  .container {
    width: calc(100% - 16px);
  }

  .admin-heading {
    align-items: start;
    flex-direction: column;
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .admin-heading h1 {
    font-size: 20px;
  }

  .admin-heading .button {
    width: 100%;
  }

  .panel-heading {
    flex-direction: column;
    padding: 12px;
  }

  /* Barra superior ultra compacta en móvil */
  .admin-compact-bar {
    gap: 6px;
    padding: 6px;
    margin-bottom: 6px;
    border-radius: 10px;
  }

  .admin-view-tabs {
    flex: 1 1 auto;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 2px;
  }

  .admin-tab {
    flex: 1;
    justify-content: center;
    padding: 5px 8px;
    font-size: 12px;
    gap: 4px;
    white-space: nowrap;
  }

  .admin-tab .btn-svg {
    display: none;
  }

  .admin-compact-actions {
    gap: 5px;
  }

  .csv-dropdown-trigger,
  .admin-add-product-btn {
    height: 32px;
    padding: 5px 10px;
    font-size: 12px;
  }

  /* Barra de filtros con buscador destacado en móvil */
  .inventory-compact-toolbar {
    padding: 8px;
  }

  .inventory-filter-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .inventory-search-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .inventory-search-box {
    flex: 1;
    min-width: 0;
  }

  .inventory-filter-form input {
    height: 42px;
    padding: 7px 48px 7px 36px;
    font-size: 14px;
  }

  .inventory-filter-form select {
    height: 36px;
    font-size: 12px;
  }

  .bulk-toggle-btn {
    order: 0;
    height: 42px;
    width: auto;
    padding: 6px 11px;
    font-size: 12px;
  }

  .taxonomy-inline-create {
    flex-wrap: wrap;
  }

  .taxonomy-inline-create input,
  .taxonomy-inline-create select,
  .taxonomy-inline-create .button {
    width: 100%;
    max-width: none;
  }

  .dept-cards-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-2,
  .two-cols,
  .form-grid-3,
  .product-title-sku-grid,
  .tariff-cards-grid {
    grid-template-columns: 1fr;
  }

  .visibility-switch {
    margin-left: 0;
  }

  .base-cost-input-wrap {
    width: 100%;
  }

  .form-actions .button {
    flex: 1;
  }

  .install-card,
  .auth-card {
    padding: 25px 20px;
  }

  .hero-inner {
    padding: 12px 0 14px;
  }

  .hero h1 {
    font-size: 37px;
  }

  .search-bar {
    padding-left: 11px;
    border-radius: 12px;
  }

  .search-bar .button {
    padding-right: 12px;
    padding-left: 12px;
  }

  .catalog-section {
    padding-top: 12px;
  }

  .catalog-dock-top {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .catalog-dock-meta {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .results-head {
    align-items: center;
    flex-direction: row;
  }

  .price-mode-row {
    width: 100%;
    align-items: center;
    flex-direction: row;
  }

  .price-mode-switch {
    flex: 1;
  }

  .price-mode-switch .chip {
    flex: 1;
    justify-content: center;
    padding: 4px 6px;
    text-align: center;
  }

  .footer-wrap {
    flex-direction: column;
    gap: 5px;
  }

  .photo-preview-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-modal-backdrop {
    padding: 10px;
  }

  .product-modal-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .product-modal-card {
    border-radius: 14px;
  }

  .product-modal-dialog .panel-heading {
    padding: 17px 52px 15px 15px;
  }

  .product-modal-dialog .form-stack {
    padding: 15px;
  }

  .product-modal-dialog .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-top: 10px;
    padding-bottom: 0;
    background: #fff;
  }

  .history-modal {
    padding: 12px;
  }

  .history-dialog {
    max-height: calc(100vh - 24px);
    padding: 19px 14px;
    border-radius: 15px;
  }

  .history-dialog h2 {
    font-size: 20px;
  }

  .history-table {
    min-width: 510px;
  }

  .history-table th,
  .history-table td {
    padding: 9px 10px;
  }

  .info-prices-grid {
    grid-template-columns: 1fr;
  }

  .auth-logo {
    width: 96px !important;
    height: 96px !important;
    border-radius: 19px !important;
  }

  .brand-logo {
    width: 34px !important;
    height: 34px !important;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card strong {
    font-size: 26px;
  }

  .form-actions .button {
    flex: 1;
  }
}

/* Las búsquedas instantáneas ocultan filas aun cuando la tabla móvil fuerza display. */
.inventory-panel .inventory-table tr[hidden],
.product-grid .product-card[hidden],
.history-modal[hidden],
.product-info-modal[hidden],
.product-modal-backdrop[hidden],
.bulk-actions-toolbar[hidden],
.bulk-selection-column[hidden] {
  display: none !important;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  padding: 19px 0;
  color: var(--muted);
  font-size: 12px;
}
