/* ============================================================
   Tornasol Noir -- MockupSetup, reestructurado (no solo reskin)
   segun el export completo de Google Stitch: login con shader,
   sidebar real, grid de productos, editor de capas en 3 columnas.
   Sin build step, sin CDN -- fuentes e iconos self-hosted.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('fonts/material-symbols-outlined.woff2') format('woff2');
}
/* Subset del editor — incluye rocket_launch para la pestaña Assets Modo Rápido */
@font-face {
  font-family: 'MSFast';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('fonts/material-symbols-fast.woff2') format('woff2');
}
.msf {
  font-family: 'MSFast';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  display: inline-block;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

:root {
  --bg: #17111d;
  --surface: #201926;
  --surface-2: #2e2735;
  --surface-glass: rgba(36, 29, 42, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --focus-gray: rgba(255, 255, 255, 0.4);
  --text: #ebdef1;
  --text-muted: rgba(230, 188, 191, 0.72);
  --accent: #ff2f72;
  --accent-hover: #ff588e;
  --accent-soft: rgba(230, 0, 77, 0.16);
  --accent-2: #7701d0;
  --tertiary: #00dce5;
  --success: #00dce5;
  --success-soft: rgba(0, 220, 229, 0.14);
  --danger: #ffb4ab;
  --danger-soft: rgba(147, 0, 10, 0.32);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glow-accent: 0 0 24px rgba(230, 0, 77, 0.28);
  --gradient-primary: linear-gradient(135deg, #7701d0, #e6004d);
  --gradient-tornasol: linear-gradient(to right, #00dce5, #ffb2b8, #e6004d);
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 260px;
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-glass: rgba(255, 255, 255, 0.7);
  --border: #e6e8ec;
  --border-strong: #d7dae0;
  --focus-gray: #9aa0ab;
  --text: #16181d;
  --text-muted: #6b7280;
  --accent: #c8004a;
  --accent-hover: #a80040;
  --accent-soft: #fbe6ee;
  --accent-2: #6700b5;
  --tertiary: #008186;
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 3px rgba(16, 20, 30, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 20, 30, 0.08);
  --shadow-lg: 0 16px 48px rgba(16, 20, 30, 0.16);
  --glow-accent: 0 0 0 rgba(0, 0, 0, 0);
  --gradient-primary: linear-gradient(135deg, #6700b5, #c8004a);
}

* { box-sizing: border-box; }

/* El atributo hidden lo aplica el navegador con `display: none`, pero
   CUALQUIER regla de autor que fije `display` le gana (misma trampa que
   rompio el modal del gotero, y despues dejo el boton "Guardar borrador"
   visible para clientes de Wix, que al tocarlo recibian un 403 "Solo para
   el equipo interno"). Clases afectadas hoy: .btn, .field, .icon-btn-plain,
   .pres-controls-section, .test-mode-controls, .modal-overlay. En vez de
   parchear cada una, esta regla global cubre tambien las que se agreguen
   despues -- por eso lleva !important, que aqui es correcto y no un atajo:
   la intencion de `hidden` siempre debe ganarle al display de una clase. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.gradient-text {
  background: var(--gradient-tornasol);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= Ingreso ================= */

.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}
.login-screen.hidden { display: none; }

.shader-bg { position: absolute; inset: 0; z-index: 0; }
.shader-bg canvas { display: block; width: 100%; height: 100%; }
:root[data-theme="light"] .shader-bg { display: none; }

.login-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.login-card {
  width: 100%;
  background: var(--surface-glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}
.login-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-tornasol);
  opacity: 0.7;
}
.login-card .spectral-hit {
  position: absolute;
  top: -2px; left: -2px;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-header { margin-bottom: 24px; }
.login-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: initial;
}
.login-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2-label, #dcb8ff);
  margin-bottom: 6px;
}
:root[data-theme="light"] .field label { color: var(--accent-2); }

.field-icon .input-glow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(46, 39, 53, 0.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-icon .input-glow:focus-within {
  border-color: var(--tertiary);
  box-shadow: 0 0 15px rgba(0, 220, 229, 0.2);
}
.field-icon .input-glow .material-symbols-outlined { color: var(--text-muted); flex-shrink: 0; }
.field-icon input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0;
}
.field-icon input:focus { outline: none; }
.icon-btn-plain {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}
.icon-btn-plain:hover { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}
.btn-gradient {
  background: var(--gradient-primary);
  color: #fffaf9;
  width: 100%;
  border-radius: 999px;
  padding: 13px 24px;
  box-shadow: var(--glow-accent);
}
.btn-gradient:hover { box-shadow: 0 0 32px rgba(230, 0, 77, 0.45); filter: brightness(1.06); }
.btn-gradient:active { transform: scale(0.97); }
.btn-gradient:disabled { opacity: 0.6; cursor: default; }

.btn-primary { background: var(--gradient-primary); color: #fffaf9; box-shadow: var(--glow-accent); }
.btn-primary:hover { box-shadow: 0 0 32px rgba(230, 0, 77, 0.4); filter: brightness(1.06); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--tertiary); color: var(--tertiary); }
.btn-block { width: 100%; margin-top: 4px; }

.error-text { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 16px; text-align: center; }

.login-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tertiary);
  animation: tornasol-pulse 1.8s ease-in-out infinite;
}
.status-sep { opacity: 0.4; }

@keyframes tornasol-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ================= App shell ================= */

.app-shell { display: none; min-height: 100vh; }
.app-shell.visible { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  background: var(--surface-glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-right: 1px solid var(--border);
  z-index: 40;
}

.sidebar-brand { padding: 0 20px; margin-bottom: 32px; }
.sidebar-brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.sidebar-brand p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }

.tab-btn, .sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.tab-btn .material-symbols-outlined, .sidebar-item .material-symbols-outlined { font-size: 19px; }
.tab-btn:hover, .sidebar-item-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); transform: translateX(2px); }
.tab-btn.active, .sidebar-item.active {
  background: rgba(119, 1, 208, 0.28);
  color: #fffaf9;
  border-left-color: var(--accent);
}
.sidebar-item-static { cursor: default; opacity: 0.55; }
.sidebar-item-static.active { opacity: 1; }
.sidebar-item-btn { cursor: pointer; }

.sidebar-bottom { padding: 16px 12px 0; border-top: 1px solid var(--border); margin-top: 12px; }
.sidebar-credit {
  padding: 14px 14px 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0.55;
}
.sidebar-credit p { margin: 0; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(23, 17, 29, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.8); }
.topbar-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text-muted); }

.main { max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px; }

.view { display: none; }
.view.active { display: block; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.section-sub { color: var(--text-muted); font-size: 14px; margin-top: 6px; max-width: 480px; }

.search-box {
  position: relative;
  max-width: 340px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}
.search-box .material-symbols-outlined {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.search-box input:focus { outline: none; border-color: var(--tertiary); }

/* ---------- Filter tabs ---------- */

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 999px;
}
.filter-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.15s ease;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: var(--gradient-primary);
  color: #fffaf9;
  box-shadow: var(--glow-accent);
}

/* ---------- Grid de productos ---------- */

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

.product-card {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.15s ease;
}
.product-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .placeholder { color: var(--text-muted); font-size: 12px; }

.product-card .body { padding: 14px 16px; }
.product-card .name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-card .sku { font-size: 11.5px; color: var(--text-muted); }

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ready { background: rgba(0, 220, 229, 0.85); color: #002021; }
.badge-pending { background: rgba(230, 0, 77, 0.85); color: #fffaf9; }
.badge-pending::before { animation: tornasol-pulse 1.6s ease-in-out infinite; }

/* ---------- Editor de producto ---------- */

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.editor-topbar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.editor-topbar-title #panelProductName { color: var(--text); }
.editor-topbar-sku { font-size: 12px; color: var(--text-muted); opacity: 0.7; }

.area-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
}
.area-mode-tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-muted);
  flex: 1;
}
.area-mode-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.area-mode-tab[data-target="work"].active { color: var(--tertiary); }
.area-mode-tab[data-target="print"].active { color: var(--accent); }

.area-fields { flex-wrap: wrap; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 70px; margin-bottom: 0; }
.field-row .field label { color: var(--text-muted); font-size: 10px; margin-bottom: 4px; }
/* Los campos del panel comparten un solo estilo. Antes esto vivia solo en
   `.field-row input[type="number"]`, asi que cualquier input de texto o
   select nuevo dentro de un .field caia al estilo nativo del navegador
   (fondo blanco) y desentonaba con el resto de la herramienta. */
.field-row input[type="number"],
.card-block .field > input[type="text"],
.card-block .field > input[type="number"],
.card-block .field > select {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.card-block .field > input[type="text"]:focus,
.card-block .field > select:focus {
  outline: none;
  border-color: var(--accent);
}
.card-block .field > input[type="text"]::placeholder { color: var(--text-muted); opacity: 0.7; }
/* En el panel de Herramientas (~300px de ancho) 5 campos en una sola
   fila no caben con comodidad -- se acomodan en una grilla de 2
   columnas en vez de una sola fila apretada. */
.tools-panel .area-fields .field { min-width: calc(50% - 5px); }

.print-points-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Panel de herramientas (barra lateral, sobre Capas) ---------- */

/* display:flex + gap (en vez de margin-bottom por elemento) para que al
   ocultar un grupo entero con is-disabled (display:none) no quede un
   espacio en blanco -- el gap se salta automaticamente los hijos con
   display:none, la tarjeta se ajusta de tamano sola. */
.tools-panel { display: flex; flex-direction: column; gap: 16px; }
.tools-panel .small-label { margin-bottom: 0; }
.tools-group { margin-bottom: 0; }
.tools-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.tools-group.is-disabled { display: none; }

/* Capas durante Modo Test: al contrario que Area de trabajo/impresion
   (que se ocultan del todo arriba), aqui no se oculta nada -- se ve
   igual de bien, pero no se puede tocar. El contenido (nombres, miniaturas)
   se queda casi normal; los controles con los que se interactua (Cargar,
   Agregar capa, radios, dropdown) se apagan mas fuerte para que sea obvio
   que estan bloqueados -- mismo criterio que el boton "Continue" del card
   "Fast Mode" deshabilitado en el editor de cliente. */
#layersCardBlock.is-disabled { pointer-events: none; opacity: 0.9; }
#layersCardBlock.is-disabled .layer-upload-btn,
#layersCardBlock.is-disabled #addLayerBtn,
#layersCardBlock.is-disabled select,
#layersCardBlock.is-disabled input[type="range"],
#layersCardBlock.is-disabled input[type="color"],
#layersCardBlock.is-disabled .mode-toggle,
#layersCardBlock.is-disabled .icon-btn,
#layersCardBlock.is-disabled .layer-reorder,
#layersCardBlock.is-disabled .slot-radio,
#layersCardBlock.is-disabled .detect-radio {
  opacity: 0.45;
  filter: grayscale(60%);
}

.tools-panel .field { margin-bottom: 10px; }
.tools-panel .field label {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 4px;
}
.tools-panel input[type="range"],
.test-mode-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  background: var(--surface-2);
  height: 4px;
  border-radius: 999px;
}
.tools-panel .print-points-count { display: block; margin-top: 8px; }

.tool-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 6px;
}
.switch {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  flex-shrink: 0;
  padding: 0;
}
.switch .switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: left 0.15s ease, background 0.15s ease;
}
.switch.active { background: var(--gradient-primary); border-color: transparent; }
.switch.active .switch-knob { left: 18px; background: #fffaf9; }

.tools-hint { font-size: 11px; margin: 0; }

.layers-order-hint { margin: 8px 0 14px; }

.editor-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.canvas-col {
  flex: 1.4;
  min-width: 0;
  /* Se ancla debajo del topbar (que ya es sticky, ~54px de alto) al
     hacer scroll, para que el mockup se mantenga a la vista mientras se
     recorre el panel de Herramientas/Capas, que puede ser mas largo. */
  position: sticky;
  top: 70px;
}
.layers-col {
  flex: 1;
  min-width: 320px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zoom-controls-float {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.zoom-controls-float .icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zoom-controls-float .icon-btn:hover { color: var(--accent); background: rgba(255,255,255,0.05); }
.zoom-controls-float .icon-btn .material-symbols-outlined { font-size: 18px; }
.zoom-sep { width: 1px; height: 16px; background: var(--border-strong); }
#zoomLabel { font-size: 11px; color: var(--text-muted); min-width: 36px; text-align: center; }

.canvas-scroll {
  overflow: auto;
  border-radius: var(--radius-md);
  max-height: 900px;
  /* Antes solo tenia max-height -- sin tope de ancho, al hacer zoom el
     lienzo crecia y el propio marco/mesa se estiraba a los lados para
     acomodarlo (en vez de quedarse fijo y mostrar scroll interno como ya
     hacia verticalmente). Con max-width igual a max-height, la mesa
     nunca crece mas alla de este tamaño en ninguna direccion -- el zoom
     solo cambia que tanto del contenido se ve, con scroll para recorrerlo. */
  max-width: 900px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 0.15s ease;
}
/* Foco visual cuando la mesa de trabajo tiene el foco -- asi el usuario
   ve que los atajos de teclado (deshacer/rehacer) estan activos. */
.canvas-scroll:focus, .canvas-scroll.is-focused { border: 3px solid var(--focus-gray); }

.canvas-focus-hint {
  display: none;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}
.canvas-focus-hint.visible { display: block; }

.canvas-wrap {
  background:
    repeating-conic-gradient(#241d2a 0% 25%, #17111d 0% 50%) 50% / 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  min-height: 420px;
}
.canvas-wrap .empty-state { color: var(--text-muted); }

.editor-floating-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.editor-floating-actions .btn-secondary { border-radius: 999px; padding: 12px 22px; }
.editor-floating-actions .btn-gradient { width: auto; border-radius: 999px; padding: 12px 26px; box-shadow: 0 0 30px rgba(230,0,77,0.3); }

.card-block {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 14px;
}

.test-mode-header { display: flex; align-items: center; justify-content: space-between; }
.test-mode-panel .section-sub { margin-top: 6px; margin-bottom: 0; }
.test-mode-controls { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.test-mode-controls[hidden] { display: none; }

/* Funciones modo fast: mismo patrón que Modo Test (header con switch +
   controles que se despliegan al activar). */
.fast-mode-header { display: flex; align-items: center; justify-content: space-between; }
.fast-mode-panel .section-sub { margin-top: 6px; }
.fast-mode-controls { display: flex; flex-direction: column; margin-top: 14px; }
.fast-mode-controls[hidden] { display: none; }
/* Panel resaltado mientras se está configurando la zona de logo. */
.fast-mode-panel.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Bloqueo del resto del editor mientras Funciones modo fast está activo:
   se ve pero no se puede tocar, para no editar capas/áreas por accidente. */
.fast-config-lock { pointer-events: none; opacity: 0.5; filter: grayscale(45%); transition: opacity .15s; }

.layer-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.layer-row.is-slot { border-color: var(--accent); background: var(--accent-soft); }
.layer-row-top, .layer-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.layer-row-bottom { padding-left: 2px; flex-wrap: wrap; }

.mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.mode-toggle button {
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
}
.mode-toggle button.active { background: var(--gradient-primary); color: #fffaf9; }

.layer-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 14px;
  color: var(--text-muted);
}
.layer-thumb img { width: 100%; height: 100%; object-fit: cover; }

.layer-reorder {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.layer-reorder button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0;
  display: flex;
}
.layer-reorder .material-symbols-outlined { font-size: 15px; }
.layer-reorder button:hover { color: var(--text); }
.layer-reorder button:disabled { opacity: 0.25; cursor: default; }

.layer-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 4px;
}
.layer-row input[type="text"]:focus { outline: none; }
.layer-row select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  flex-shrink: 0;
}
.layer-row input[type="range"] { width: 50px; flex-shrink: 0; accent-color: var(--accent); }
.layer-row .slot-radio { flex-shrink: 0; accent-color: var(--accent); }

/* Verde (mismo tono que "Area de trabajo") a proposito, para distinguirlo
   a simple vista del radio rosa de "espacio del logo del cliente". */
.detect-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.detect-source-toggle .detect-radio { accent-color: #3ad19e; flex-shrink: 0; }

.layer-preview-color-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.layer-preview-color {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border, #3a3a44);
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn .material-symbols-outlined { font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; color: var(--text-muted); }
#undoBtn, #redoBtn { font-size: 15px; }

.layer-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.layer-upload-btn .material-symbols-outlined { font-size: 16px; color: var(--accent); }
.layer-upload-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.small-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.small-label-hint { text-transform: none; font-weight: 400; letter-spacing: 0; opacity: 0.7; }

/* ---------- Tabla de presentaciones ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  max-width: 480px;
}

.stat-card {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 45%);
  pointer-events: none;
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-tornasol);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Perfiles de cliente ---- */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.profile-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-sm);
  /* Fondo claro fijo: muchos logos de cliente son PNG con transparencia y
     tinta oscura -- sobre el surface oscuro del tema no se verian. */
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px;
}
.profile-logo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
}
.profile-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-email {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-info .section-sub { font-size: 12px; margin-top: 0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.profile-gallery-btn { align-self: flex-start; margin-top: 6px; }

/* ---- Galeria de imagenes del cliente ---- */
.modal-box-gallery { width: 720px; max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gallery-header h3 { font-size: 16px; margin: 0; }
.gallery-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.gallery-close:hover { color: var(--accent); }
.logo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  overflow-y: auto;
}
.gallery-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gallery-thumb {
  /* Fondo blanco fijo: los logos suelen ser PNG de tinta oscura con
     transparencia -- sobre el surface oscuro no se verian. */
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumb .profile-logo-empty { width: 100%; height: 100%; border: none; padding: 0; }
.gallery-name {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-download { justify-content: center; text-decoration: none; }
.btn-disabled { opacity: 0.5; pointer-events: none; }

/* ---- Registro por logo (nombre / correo) ---- */
.gallery-date { font-size: 11px; color: var(--text-muted); }
.gallery-reg { display: flex; flex-direction: column; gap: 6px; }
.gallery-reg .btn { justify-content: center; }
.reg-saved { font-size: 12px; line-height: 1.35; }
.reg-nombre-val { font-weight: 700; }
.reg-saved .section-sub { font-size: 11px; margin-top: 0; word-break: break-all; }
.reg-form { display: flex; flex-direction: column; gap: 6px; }
.reg-form input {
  width: 100%;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.reg-form input:focus { outline: none; border-color: var(--accent); }
.reg-actions { display: flex; gap: 6px; }
.reg-actions .btn { flex: 1; justify-content: center; }
.reg-msg { font-size: 11px; }
.reg-msg.error { color: var(--danger, #ec4a3b); }
.reg-auto { color: var(--text-muted); font-style: italic; }

.table-wrap {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); box-shadow: inset 3px 0 0 0 var(--accent); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.status-ready { background: var(--success-soft); color: var(--tertiary); }
.status-pending { background: var(--accent-soft); color: var(--accent); }
.status-generating { background: rgba(255, 178, 184, 0.14); color: #ffb2b8; }
/* Reemplazada: se regenero el PDF desde el mismo borrador y este archivo ya
   no esta en disco. Apagada a proposito -- es historial, no algo accionable. */
.status-replaced { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .big { font-size: 32px; margin-bottom: 8px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #93000a; color: #ffdad6; border-color: transparent; }
.toast.success { background: #005357; color: #f0ffff; border-color: transparent; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .editor-layout { flex-direction: column; }
  .layers-col { max-width: none; }
}

/* ================= Vistas del producto (frente / reverso) ================= */

.view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}
.view-tab:hover { color: var(--text); border-color: var(--text-muted); }
.view-tab.active { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
/* Distingue de un vistazo que hace cada vista sin tener que abrirla. */
.view-tab-kind {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}
.view-tab-add {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}
.view-tab-add:hover { color: var(--accent); border-color: var(--accent); }

.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ================= Modales ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 90vw;
}
.modal-box-confirm { max-width: 460px; text-align: center; }
.modal-box-confirm h3 { font-size: 16px; margin: 0 0 8px; }
.modal-box-confirm p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
/* .btn es inline-flex en fila: estos botones llevan titulo + descripcion
   apilados, por eso cambian a columna. */
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.confirm-actions .btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  padding: 12px 16px;
  /* .btn-gradient trae border-radius: 999px (pastilla). Aca los botones son
     bloques de opcion con dos lineas de texto, no pastillas: se igualan al
     radio del resto, conservando el degradado del primario. */
  border-radius: var(--radius-sm);
}
.opt-title { font-weight: 600; font-size: 13.5px; }
.opt-desc { font-size: 11.5px; opacity: 0.8; font-weight: 400; line-height: 1.4; }
.modal-foot-note {
  margin-top: 16px !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px !important;
  opacity: 0.8;
}

/* ================= Estado de disponibilidad ================= */
/* Indicador, no boton: comunica que el producto YA esta disponible. Por eso
   no tiene hover ni cursor de clic -- la accion es el boton de al lado. */
.available-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
  font-size: 13.5px;
}
.available-state .material-symbols-outlined { font-size: 18px; }

.btn-danger-outline { border-color: var(--border-strong); }
.btn-danger-outline:hover { border-color: var(--danger); color: var(--danger); }

/* Caja "Sellos y leyendas": aclaración de dónde cae cada sello en el PDF,
   para no tener que abrir un PDF de prueba para acordarse. */
.seal-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}
/* Campos de la leyenda de botellas. Solo se muestran con su switch
   encendido — el atributo hidden ya los oculta (regla global). */
.seal-fields {
  margin: 4px 0 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.seal-fields .field { margin-bottom: 10px; }
.seal-fields .field:last-of-type { margin-bottom: 8px; }
/* Vista previa del texto exacto que va a salir impreso. */
.seal-preview { color: var(--text); }


/* Etiqueta del PDF cuando la decide el tipo de vista: se muestra como dato,
   no como campo, para que no invite a escribir algo que se va a ignorar. */
.label-fixed {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* =================== Vista: Assets de Marca =================== */

/* Botón "Subir archivo" del encabezado: tamaño natural, no el pill full-width
   que .btn-gradient impone por defecto (se veía enorme en la cabecera). */
.assets-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: auto;
  padding: 10px 20px;
}
.assets-upload-btn input { display: none; }

/* Panel de confirmación de subida */
.assets-upload-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
/* Archivos elegidos, como chips con ✕ */
.assets-upload-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assets-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
}
.assets-file-name {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assets-file-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.assets-file-remove:hover { background: var(--danger); color: #fff; }

.assets-upload-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
/* Cada campo con su etiqueta arriba */
.assets-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.assets-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.assets-upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* Botones del panel: tamaño natural, no full-width */
.assets-upload-actions .btn { width: auto; }
.assets-cat-select,
.assets-name-input {
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
}
.assets-name-input { min-width: 200px; }
.assets-cat-select { min-width: 170px; }

/* Categoría + botón "+ categoría" en línea */
.assets-cat-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assets-cat-picker .assets-cat-select { min-width: 150px; }

/* Fila de SKUs (input + agregar) y sus chips */
.assets-sku-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.assets-sku-input { min-width: 180px; }
.assets-sku-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Barra de filtros: categorías (chips) + temporada (select) */
.assets-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.assets-filters .assets-filter-row { margin-bottom: 0; }
.assets-season-filter { min-width: 180px; }

.assets-upload-status {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Filtros de categoría */
.assets-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.assets-filter-btn {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.assets-filter-btn:hover { border-color: rgba(255,255,255,0.3); color: var(--text); }
.assets-filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Grid de assets */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.asset-card {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.asset-card:hover { border-color: rgba(255,255,255,0.25); }

/* Preview: SVGs en blanco se invierten para verse sobre el fondo oscuro */
.asset-preview {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.asset-preview img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: invert(1);
}
.asset-preview img.is-png { filter: none; }

.asset-name {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-cat-badge {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}
.asset-delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.asset-delete-btn .material-symbols-outlined { font-size: 12px; color: #fff; }
.asset-card:hover .asset-delete-btn { display: flex; }

.assets-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---- Reglas de uso del asset (dónde tiene sentido usarlo) ---- */
.assets-rules {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.assets-rules-group > .assets-rules-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.assets-rules-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
/* Posición recomendada: chips de selección única */
.assets-placement-row,
.assets-usableon-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.assets-chip {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  user-select: none;
}
.assets-chip:hover { border-color: rgba(255,255,255,0.3); color: var(--text); }
.assets-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.assets-usableon-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Badges de reglas en la tarjeta del asset */
.asset-rule-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.asset-rule-badge {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.asset-rule-badge.is-free {
  color: var(--text-muted);
  opacity: 0.6;
}
/* Botón editar reglas (junto al de eliminar) */
.asset-edit-btn {
  position: absolute;
  top: 5px;
  right: 30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.asset-edit-btn .material-symbols-outlined { font-size: 12px; color: #fff; }
.asset-card:hover .asset-edit-btn { display: flex; }

/* ---- Assets atados a un producto (panel "Funciones modo fast") ---- */
.asset-rule-badge.is-product {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--text);
  opacity: 1;
}
.fast-asset-upload-btn { margin-top: 6px; }
.fast-asset-upload-btn .material-symbols-outlined { font-size: 18px; }
.fast-asset-upload-panel {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fast-asset-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.fast-asset-card { padding: 8px; }
.fast-asset-empty { margin-top: 10px; opacity: 0.7; }

/* ---- Metadata del motor Fast: sección "Diseño avanzado" ---- */
.assets-advanced {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.assets-advanced summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
  user-select: none;
}
.assets-advanced[open] summary { margin-bottom: 10px; }
.assets-range-row { display: flex; gap: 14px; flex-wrap: wrap; }
.assets-range-row label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.assets-range-row input { width: 92px; }
