:root,
:root[data-theme='light'] {
  --bg: #eef2f7;
  --bg-soft: #e7edf5;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-elevated: #ffffff;
  --text: #1f2a3b;
  --muted: #66758d;
  --border: #d7dfea;
  --accent: #2f5fbc;
  --accent-strong: #224a93;
  --accent-soft: #e4edfb;
  --danger: #d15353;
  --danger-soft: #fbe6e6;
  --success: #249268;
  --success-soft: #e3f4ed;
  --sidebar-bg: #f7f9fd;
  --sidebar-surface: #edf2f9;
  --sidebar-text: #1f2a3b;
  --sidebar-muted: #6a7890;
  --sidebar-hover: #e7edf5;
  --sidebar-active: #d9e5f8;
  --sidebar-active-text: #1d3f79;
  --sidebar-border: #d6e0ee;
  --product-title: #1f3555;
  --bg-layer-1: rgba(79, 116, 199, 0.12);
  --bg-layer-2: rgba(73, 161, 139, 0.1);
  --bg-layer-3: rgba(255, 255, 255, 0.85);
  --sidebar-grad-1: #f9fbff;
  --sidebar-grad-2: #edf3fb;
  --panel-grad-1: #ffffff;
  --panel-grad-2: #f7fafe;
  --glass-border: rgba(148, 163, 184, 0.24);
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.12);
  --radius-md: 14px;
  --radius-lg: 18px;
  --theme-wave-x: 50vw;
  --theme-wave-y: 50vh;
}

:root[data-theme='dark'] {
  --bg: #020617;
  --bg-soft: #0b1224;
  --surface: #0f172a;
  --surface-soft: #111a2f;
  --surface-elevated: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1f2e45;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: #173149;
  --danger: #ef4444;
  --danger-soft: #3e1c21;
  --success: #22c55e;
  --success-soft: #173d2f;
  --sidebar-bg: #020617;
  --sidebar-surface: #111827;
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active: #16324d;
  --sidebar-active-text: #e2e8f0;
  --sidebar-border: #233249;
  --product-title: #e5edf8;
  --bg-layer-1: rgba(56, 189, 248, 0.12);
  --bg-layer-2: rgba(34, 197, 94, 0.08);
  --bg-layer-3: rgba(2, 6, 23, 0.86);
  --sidebar-grad-1: #08101f;
  --sidebar-grad-2: #111a2f;
  --panel-grad-1: #111a2e;
  --panel-grad-2: #0f172a;
  --glass-border: rgba(148, 163, 184, 0.22);
  --shadow-sm: 0 8px 22px rgba(2, 6, 23, 0.4);
  --shadow-md: 0 20px 40px rgba(2, 6, 23, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
}

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

body {
  background:
    radial-gradient(900px 520px at -10% -8%, var(--bg-layer-1), transparent 62%),
    radial-gradient(780px 440px at 110% 6%, var(--bg-layer-2), transparent 64%),
    linear-gradient(180deg, var(--bg-layer-3), var(--bg));
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body.theme-fallback-transition,
body.theme-fallback-transition * {
  transition:
    background-color .42s ease,
    color .38s ease,
    border-color .42s ease,
    box-shadow .46s ease !important;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  clip-path: circle(0 at var(--theme-wave-x) var(--theme-wave-y));
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

body:not(.app-body):not(.auth-page) {
  min-height: 100vh;
}

body:not(.app-body):not(.auth-page) > header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

body:not(.app-body):not(.auth-page) > header h1 {
  font-size: clamp(18px, 2vw, 24px);
}

body:not(.app-body):not(.auth-page) > footer {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  padding: 12px;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* =============================
   APP SHELL
============================= */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  transition: grid-template-columns .26s ease;
}

.app-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 16px
    );
  pointer-events: none;
  z-index: -1;
}

:root[data-theme='dark'] .app-shell::before {
  background:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.008) 0px,
      rgba(255, 255, 255, 0.008) 1px,
      transparent 1px,
      transparent 18px
    );
}

.app-sidebar {
  background: linear-gradient(165deg, var(--sidebar-grad-1), var(--sidebar-grad-2));
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  overflow: hidden;
  transition: transform .26s ease, opacity .22s ease;
}

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

body.sidebar-collapsed .app-sidebar {
  transform: translateX(-108%);
  opacity: 0;
  pointer-events: none;
}

.app-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(280px 200px at -10% -8%, rgba(255, 255, 255, 0.26), transparent 68%),
    radial-gradient(220px 180px at 120% 0%, rgba(59, 130, 246, 0.16), transparent 72%);
  pointer-events: none;
  opacity: .7;
}

:root[data-theme='dark'] .app-sidebar::before {
  opacity: .16;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--sidebar-surface), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  position: relative;
  flex: 1;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}

.sidebar-close-inside {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  color: var(--sidebar-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  z-index: 35;
}

.sidebar-close-inside:hover {
  background: color-mix(in srgb, var(--sidebar-hover) 72%, transparent);
  color: var(--sidebar-text);
  transform: scale(1.04);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  border-color: var(--sidebar-border);
  color: var(--sidebar-active-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--sidebar-border);
}

.action-dock {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.menu-wrapper {
  position: relative;
}

.icon-circle-btn {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--sidebar-border);
  background: linear-gradient(145deg, var(--sidebar-surface), rgba(255, 255, 255, 0.04));
  color: var(--sidebar-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.icon-circle-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.15);
}

.icon-circle-btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.icon-circle-btn i {
  font-size: 15px;
}

.action-label {
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: var(--sidebar-muted);
  text-align: center;
}

.menu-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 150px;
  border-radius: 12px;
  border: 1px solid var(--sidebar-border);
  background: linear-gradient(165deg, var(--sidebar-grad-1), var(--sidebar-grad-2));
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.menu-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-item {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--sidebar-hover);
}

.menu-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.menu-item i {
  width: 14px;
  text-align: center;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.66));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

:root[data-theme='dark'] .topbar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.66));
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-kicker {
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}

#pageTitle {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .2s ease, transform .2s ease, opacity .2s ease;
}

.sidebar-toggle:hover {
  transform: scale(1.04);
}

body.sidebar-collapsed .sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1025px) {
  body:not(.sidebar-collapsed) .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
  }

  body:not(.sidebar-collapsed) .sidebar-close-inside {
    display: inline-flex;
  }
}

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

.topbar-actions.hidden {
  display: none;
}

.action-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

:root[data-theme='dark'] .action-btn {
  background: linear-gradient(180deg, #1b2539, #141d2f);
  border-color: #32445f;
  color: #dbe7f9;
}

:root[data-theme='dark'] .action-btn:hover {
  border-color: #4e87b7;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.45);
}

.action-btn.success {
  background: linear-gradient(145deg, var(--success-soft), rgba(34, 197, 94, 0.1));
  border-color: rgba(34, 197, 94, 0.4);
  color: #166534;
}

:root[data-theme='dark'] .action-btn.success {
  background: linear-gradient(145deg, #1f3e32, #17352b);
  border-color: #2f7056;
  color: #d7f7e8;
}

.action-btn.danger-alt {
  background: linear-gradient(145deg, var(--danger-soft), rgba(239, 68, 68, 0.08));
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
}

:root[data-theme='dark'] .action-btn.danger-alt {
  background: linear-gradient(145deg, #462128, #381a20);
  border-color: #7a3a46;
  color: #ffd8dd;
}

.action-btn.ghost {
  color: var(--muted);
}

.content-area {
  padding: 18px 20px 10px;
  flex: 1;
  min-width: 0;
}

.module-pane {
  min-width: 0;
}

.module-pane.active {
  animation: moduleFade .25s ease;
}

@keyframes moduleFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-footer {
  margin: 6px 20px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.app-backdrop {
  display: none;
}

/* =============================
   INVENTARIO MODULE
============================= */
.inventario-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  min-height: 260px;
}

.module-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(3px);
  z-index: 14;
}

.module-loader.active {
  display: flex;
}

.module-loader-card {
  min-width: min(92%, 260px);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  box-shadow: var(--shadow-md);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 16px;
  text-align: center;
}

.module-loader-card p {
  font-size: 13px;
  color: var(--muted);
}

.barra-busqueda {
  display: flex;
  justify-content: center;
}

#searchInput {
  width: min(100%, 620px);
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  box-shadow: var(--shadow-sm);
}

#searchInput::placeholder {
  color: var(--muted);
}

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

.filtro {
  min-width: 0;
}

.filtro select,
input:not([type='checkbox']),
select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  caret-color: var(--accent-strong);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
select:disabled,
.filtro select:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 1;
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  border-style: dashed;
  border-color: color-mix(in srgb, var(--muted) 40%, var(--border));
  background: color-mix(in srgb, var(--surface-soft) 94%, var(--surface) 6%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.filtro-talla.is-disabled-temp select,
.filtro-talla-mobile.is-disabled-temp select {
  border-color: color-mix(in srgb, var(--muted) 38%, var(--border));
  background: color-mix(in srgb, var(--surface-soft) 90%, var(--muted) 10%);
}

.filtro-talla.is-disabled-temp::after,
.filtro-talla-mobile.is-disabled-temp::after {
  content: none;
}

.resumen-filtros-grid .filtro-talla.is-disabled-temp::after,
.filtro-talla-mobile.is-disabled-temp::after {
  content: none;
}

.filtro-talla,
.filtro-talla-mobile {
  position: relative;
}

.hint-talla {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  font-size: 12px;
  color: #b45309;
}

.hint-talla.is-waiting {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.hint-talla.is-ready {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

:root[data-theme='dark'] .hint-talla {
  color: #fcd34d;
}

:root[data-theme='dark'] .hint-talla.is-waiting {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

:root[data-theme='dark'] .hint-talla.is-ready {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
  color: #86efac;
}

.hint-talla.is-hidden {
  display: none;
}

.filtros-mobile-toolbar,
.filtros-mobile-modal {
  display: none;
}

.filtros-resumen {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.grid > p {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, var(--panel-grad-1), var(--panel-grad-2));
  box-shadow: var(--shadow-sm);
  min-height: 180px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(180px 90px at 10% -10%, rgba(255, 255, 255, 0.3), transparent 72%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.02), transparent 60%);
  pointer-events: none;
  transition: opacity .22s ease;
  opacity: .9;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 13px
  );
  pointer-events: none;
  opacity: .4;
}

:root[data-theme='dark'] .card::before {
  background:
    radial-gradient(180px 90px at 10% -10%, rgba(56, 189, 248, 0.08), transparent 74%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.01), transparent 60%);
  opacity: .26;
}

:root[data-theme='dark'] .card::after {
  opacity: .12;
}

body:not(.app-body) .card {
  min-height: auto;
  padding: 20px;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  opacity: 1;
}

.card.active,
.card[data-selected='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);
}

.grid.delete-mode .card {
  border-color: color-mix(in srgb, var(--danger) 20%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--danger-soft) 58%, transparent),
    var(--shadow-sm);
  animation: delete-card-shiver 1.18s ease-in-out infinite;
  transform-origin: center center;
}

.grid.delete-mode .card:nth-child(2n) {
  animation-delay: .08s;
}

.grid.delete-mode .card:nth-child(3n) {
  animation-delay: .18s;
}

.grid.delete-mode .card:nth-child(5n) {
  animation-delay: .12s;
}

.grid.delete-mode .card:hover {
  transform: none;
}

.grid.delete-mode .card.active,
.grid.delete-mode .card[data-selected='true'] {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--border));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--danger-soft) 76%, transparent),
    var(--shadow-md);
  animation: none;
  transform: translateY(-1px);
}

.grid.delete-mode .card.active::before,
.grid.delete-mode .card[data-selected='true']::before {
  background:
    radial-gradient(200px 110px at 10% -8%, rgba(255, 255, 255, 0.24), transparent 72%),
    linear-gradient(180deg, rgba(248, 113, 113, 0.18), rgba(209, 83, 83, 0.12));
  opacity: 1;
}

.grid.delete-mode .card.active::after,
.grid.delete-mode .card[data-selected='true']::after {
  opacity: .22;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0px,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 13px
  );
}

:root[data-theme='dark'] .grid.delete-mode .card {
  border-color: color-mix(in srgb, #fb7185 26%, var(--border));
  box-shadow:
    0 0 0 1px rgba(127, 29, 29, 0.22),
    var(--shadow-sm);
}

:root[data-theme='dark'] .grid.delete-mode .card.active,
:root[data-theme='dark'] .grid.delete-mode .card[data-selected='true'] {
  border-color: #fb7185;
  box-shadow:
    0 0 0 3px rgba(127, 29, 29, 0.34),
    var(--shadow-md);
}

:root[data-theme='dark'] .grid.delete-mode .card.active::before,
:root[data-theme='dark'] .grid.delete-mode .card[data-selected='true']::before {
  background:
    radial-gradient(200px 110px at 10% -8%, rgba(255, 255, 255, 0.08), transparent 72%),
    linear-gradient(180deg, rgba(239, 68, 68, 0.2), rgba(127, 29, 29, 0.18));
  opacity: 1;
}

:root[data-theme='dark'] .grid.delete-mode .card.active::after,
:root[data-theme='dark'] .grid.delete-mode .card[data-selected='true']::after {
  opacity: .16;
}

@keyframes delete-card-shiver {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  14% {
    transform: translate3d(.8px, -.5px, 0) rotate(-.55deg);
  }
  28% {
    transform: translate3d(-1.1px, .4px, 0) rotate(.62deg);
  }
  42% {
    transform: translate3d(.9px, .7px, 0) rotate(-.42deg);
  }
  56% {
    transform: translate3d(-.75px, -.65px, 0) rotate(.5deg);
  }
  70% {
    transform: translate3d(.55px, -.3px, 0) rotate(-.28deg);
  }
  84% {
    transform: translate3d(-.45px, .28px, 0) rotate(.22deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .grid.delete-mode .card {
    animation: none;
  }
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--accent-soft), rgba(255, 255, 255, 0.16));
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--product-title);
}

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

.controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.stock {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface), var(--panel-grad-2));
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--success);
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

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

.add,
.btn-add {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.45);
  color: #166534;
}

:root[data-theme='dark'] .add,
:root[data-theme='dark'] .btn-add {
  background: linear-gradient(145deg, #1f3e32, #17352b);
  border-color: #2f7056;
  color: #d7f7e8;
}

.remove,
.btn-rest {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.45);
  color: #b91c1c;
}

:root[data-theme='dark'] .remove,
:root[data-theme='dark'] .btn-rest {
  background: linear-gradient(145deg, #462128, #381a20);
  border-color: #7a3a46;
  color: #ffd8dd;
}

.btn-rest,
.btn-add {
  min-height: 40px;
  padding: 0;
}

.btn-rest {
  font-size: 20px;
}

.btn-add {
  font-size: 18px;
}

.btn-precio {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.btn-precio.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* =============================
   MODAL NUEVO PRODUCTO
============================= */
#modalNew {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.56), rgba(15, 23, 42, 0.68));
  backdrop-filter: blur(6px);
  z-index: 1300;
  align-items: center;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.modal-box {
  width: min(100%, 940px);
  max-width: min(940px, calc(100vw - 24px));
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel-grad-1), var(--surface-elevated));
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  animation: modalPopIn .28s cubic-bezier(.2, .7, .2, 1) both;
}

.modal-box-product {
  width: min(100%, 620px);
  max-width: min(620px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  min-height: 0;
  position: relative;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  width: 34px;
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  color: var(--muted);
  padding: 0;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.modal-body {
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 12px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.modal-product-body {
  padding: clamp(12px, 1.8vw, 18px);
  gap: 14px;
  align-content: start;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: none;
  margin: 0;
}

.modal-inline-title {
  margin: 2px 48px 0 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
}

.modal-inline-step {
  color: var(--accent-strong);
  white-space: nowrap;
}

.modal-inline-name {
  color: var(--product-title);
}

.step {
  display: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.step.active {
  display: grid;
  gap: 14px;
  animation: moduleFade .24s ease;
}

.step::before {
  display: none;
}

.step h3,
.step h4 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--product-title);
}

.step-head {
  display: grid;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.step-head p {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 62ch;
}

.step-head > .step-eyebrow,
.step-head > h3,
.step-head > h4 {
  display: none;
}

.step-surface {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.step-card-head {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.step-card-head h4 {
  font-size: 14px;
}

.step-card-head p {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.step-fields {
  display: grid;
  gap: 12px;
}

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

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

.field-group-wide {
  grid-column: 1 / -1;
}

.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.actions,
.step-actions {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  position: relative;
  z-index: 1;
}

.step-nav {
  position: static;
  background: none;
  padding-bottom: 0;
}

.actions button:not(.add):not(.remove):not(.btn-add):not(.btn-rest),
.step-actions button:not(.add):not(.remove):not(.btn-add):not(.btn-rest) {
  border-color: var(--border);
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  color: var(--text);
}

.step-secondary-action {
  margin-top: -2px;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.category-grid-product {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.category-btn,
.gender-btn,
.talla-btn {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  color: var(--text);
  padding: 8px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  width: auto;
  flex: 0 0 auto;
}

.category-btn {
  min-width: 136px;
}

.gender-btn {
  min-width: 104px;
}

.talla-btn {
  min-width: 58px;
}

.category-btn:hover,
.gender-btn:hover,
.talla-btn:hover,
.select-all:hover,
.add-secondary:hover,
.btn-precio:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.category-btn.active,
.gender-btn.active,
.talla-btn.active {
  border-color: var(--accent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 84%, transparent), rgba(255, 255, 255, 0.1));
  color: var(--accent-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-soft) 62%, transparent);
}

.gender-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.tallas-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.select-all,
.add-secondary {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-style: dashed;
  border-color: rgba(14, 165, 233, 0.4);
  color: var(--accent-strong);
}

.select-all {
  width: auto;
  margin-bottom: 10px;
}

.add-secondary {
  width: auto;
  justify-self: start;
  padding-inline: 16px;
}

.step-split-layout {
  grid-template-columns: minmax(220px, .92fr) minmax(0, 1.3fr);
  align-items: start;
}

#step3 .step-block {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}

#step3 .step-block-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--product-title);
  margin-bottom: 2px;
}

#step3 .step-block-copy {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
  margin-bottom: 8px;
}

#step3 .step-fields {
  gap: 10px;
}

#step3 .step-split-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

#step3 .step-block:first-child {
  display: grid;
  gap: 8px;
}

#step3 .gender-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

#step3 .gender-btn {
  width: 100%;
  min-width: 0;
}

#step3 .step-nav {
  padding-top: 10px;
}

.tallas-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.field-na {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 0;
}

.na-toggle {
  min-height: 42px;
  min-width: 48px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.na-toggle.active {
  border-color: rgba(239, 68, 68, 0.45);
  background: var(--danger-soft);
  color: #b91c1c;
}

.tallas-mensaje {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.variantes-grid {
  display: block;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.pricing-flow {
  grid-template-columns: minmax(0, 156px) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.pricing-summary-card {
  position: static;
}

.variantes-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

#step4 .variantes-grid {
  max-height: min(42dvh, 420px);
}

.variantes-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.variantes-table .col-talla {
  width: 56px;
}

.variantes-table .col-stock {
  width: 92px;
}

.variantes-table .col-ajuste {
  width: 112px;
}

.variantes-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0 8px 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.variantes-table td {
  padding: 8px;
  vertical-align: middle;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 95%, transparent), color-mix(in srgb, var(--surface-soft) 92%, transparent));
  border-top: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
}

.variantes-table .variante-row td:first-child {
  border-left: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 14px 0 0 14px;
}

.variantes-table .variante-row td:last-child {
  border-right: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 0 14px 14px 0;
}

.finish-grid {
  grid-template-columns: minmax(0, 360px);
}

.variante-row {
  background: transparent;
}

.variante-talla {
  text-align: center;
  font-weight: 800;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 56%, transparent);
  min-height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}

.precio-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}

.precio-label,
.precio-talla {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.precio-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--muted);
}

.precio-talla {
  display: block;
}

.variante-row .stock {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  text-align: center;
  padding-inline: 8px;
  color: var(--text);
}

.btn-precio {
  min-height: 38px;
  border-radius: 10px;
  width: 100%;
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  text-wrap: balance;
}

.step-inline-panel {
  border-style: dashed;
}

/* =============================
   RESUMEN MODULE
============================= */
.resumen-inline {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--panel-grad-1), var(--panel-grad-2));
  box-shadow: var(--shadow-sm);
  padding: 12px;
  position: relative;
  min-height: 260px;
}

.resumen-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) 1fr;
  gap: 12px;
  align-items: start;
}

.resumen-filtros-card,
.resumen-results-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  padding: 12px;
}

.resumen-filtros-card {
  position: sticky;
  top: 82px;
}

.resumen-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}

.resumen-filtros-grid {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.resumen-filtros-grid .filtro label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.resumen-results-card {
  display: grid;
  gap: 10px;
}

.resumen-results-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.resumen-results-top .action-btn {
  width: auto;
  min-height: 40px;
}

.resumen-results-card .muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#resBtnGenerar {
  width: 100%;
}

.resumen-results-card .table-area {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  overflow: hidden;
}

.resumen-results-card .progress {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(2px);
  z-index: 6;
}

.resumen-results-card .progress .bar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-top-color: var(--accent);
  animation: spinLoader .85s linear infinite;
}

.resumen-results-card .table-wrapper {
  width: 100%;
  overflow: auto;
  display: none;
  max-height: min(58vh, 560px);
  -webkit-overflow-scrolling: touch;
}

.resumen-results-card table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.resumen-results-card th,
.resumen-results-card td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 11px;
  font-size: 13px;
  white-space: nowrap;
}

.resumen-results-card th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface-soft) 92%, var(--surface));
  color: var(--muted);
  font-weight: 800;
}

.resumen-results-card tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.resumen-results-card tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
}

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

.resumen-results-card .total-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(165deg, var(--surface), var(--surface-soft));
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.resumen-results-card .total-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: uppercase;
}

.resumen-results-card .total-card strong {
  display: block;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  color: var(--product-title);
  text-wrap: balance;
}

.resumen-results-card .total-card:first-child {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-soft) 42%, transparent);
}

.resumen-results-card .total-card:last-child {
  border-color: color-mix(in srgb, var(--success) 26%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-soft) 45%, transparent);
}

.resumen-results-card .error {
  color: var(--danger);
  min-height: 18px;
  font-size: 13px;
}

/* =============================
   VENTAS MODULE
============================= */
.ventas-inline {
  min-height: 260px;
}

.ventas-periodo-label {
  margin-top: 10px;
  min-height: 16px;
}

.ventas-results-card .table-wrapper table {
  min-width: 980px;
}

.ventas-results-card .totales {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.ventas-results-card .total-card:last-child {
  border-color: color-mix(in srgb, var(--success) 34%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-soft) 55%, transparent);
}

.ventas-ganancia-positive {
  color: color-mix(in srgb, var(--success) 78%, var(--text));
  font-weight: 800;
}

.ventas-ganancia-negative {
  color: color-mix(in srgb, var(--danger) 78%, var(--text));
  font-weight: 800;
}

/* =============================
   ALERTS, LOADING, CONFIRM
============================= */
.loading-overlay,
.confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(15, 23, 42, 0.66));
  backdrop-filter: blur(5px);
  z-index: 1800;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.loading-overlay.active,
.confirm-overlay.active {
  display: flex;
}

.loading-box,
.confirm-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  box-shadow: var(--shadow-md);
  padding: 16px;
  color: var(--text);
  animation: modalPopIn .24s ease both;
  max-width: min(100%, 520px);
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.loading-box {
  min-width: 170px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.28);
  border-top-color: var(--accent);
  animation: spinLoader .85s linear infinite;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

.confirm-box {
  width: min(92vw, 400px);
  display: grid;
  gap: 8px;
}

.confirm-box h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.confirm-box p {
  color: var(--muted);
  margin-bottom: 12px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-actions button {
  min-width: 104px;
}

.alert-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translate(-50%, -16px);
  min-width: min(92vw, 520px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  color: var(--text);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 1700;
}

.alert-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.alert-success {
  border-color: #8dd6b5;
  background: var(--success-soft);
}

.alert-error {
  border-color: #e6aaaa;
  background: var(--danger-soft);
}

.alert-info {
  border-color: var(--border);
}

/* =============================
   MOBILE FILTERS
============================= */
.btn-filtros-mobile {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-filtros-mobile svg {
  width: 16px;
  height: 16px;
}

.filtros-resumen {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.filtro-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
}

.chip-text {
  padding: 4px 8px;
}

.chip-remove {
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  color: var(--danger);
  background: transparent;
}

.filtro-chip-empty {
  border-style: dashed;
  color: var(--muted);
}

.filtros-mobile-modal {
  position: fixed;
  inset: 0;
  z-index: 1450;
}

.filtros-mobile-modal.active {
  display: block;
}

.filtros-mobile-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.46), rgba(15, 23, 42, 0.66));
}

.filtros-mobile-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  background: linear-gradient(180deg, var(--panel-grad-1), var(--surface-elevated));
  padding: 14px;
  box-shadow: var(--shadow-md);
  max-height: 88dvh;
  overflow: auto;
}

.filtros-mobile-modal.active .filtros-mobile-sheet {
  animation: mobileSheetIn .24s ease both;
}

@keyframes mobileSheetIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.filtros-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.filtros-mobile-head h3 {
  font-size: 15px;
  font-weight: 800;
}

.filtros-mobile-close {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.filtros-mobile-body {
  display: grid;
  gap: 8px;
}

.filtros-mobile-body .filtro {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  padding: 8px;
}

.filtro-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filtros-mobile-foot {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* =============================
   LOGIN PAGE
============================= */
body.auth-page {
  background:
    radial-gradient(720px 420px at -8% -10%, var(--bg-layer-1), transparent 62%),
    radial-gradient(760px 430px at 110% 10%, var(--bg-layer-2), transparent 64%),
    linear-gradient(180deg, var(--bg-layer-3), var(--bg));
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-container {
  width: min(100%, 1020px);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 420px);
  gap: 18px;
  align-items: stretch;
}

.auth-hero,
.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--panel-grad-1), var(--panel-grad-2));
  box-shadow: var(--shadow-md);
}

.auth-hero {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-pill {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.4);
  background: linear-gradient(145deg, var(--accent-soft), rgba(255, 255, 255, 0.12));
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
}

.auth-hero h1 {
  margin-top: 16px;
  font-size: clamp(28px, 3.3vw, 42px);
  line-height: 1.05;
}

.auth-hero p {
  margin-top: 10px;
  color: var(--muted);
}

.auth-list {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.auth-list li {
  list-style: none;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-list i {
  color: var(--success);
}

.auth-card {
  padding: 22px;
}

.auth-card h2 {
  font-size: 25px;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 12px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form input {
  margin-bottom: 0;
}

.auth-form .add,
.auth-form .remove {
  width: 100%;
}

.auth-footer {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
