*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #212121;
  --surface:   #2f2f2f;
  --surface2:  #3a3a3a;
  --border:    #424242;
  --text:      #ececec;
  --text-muted:#8e8ea0;
  --accent:    #10a37f;
  --chip-bg:   #2f2f2f;
  --chip-h:    #3a3a3a;
  --radius:    14px;
  --input-r:   26px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.layout {
  display: grid;
  grid-template-columns: 185px 1fr;
  height: 100vh;
  height: 100dvh; /* viewport real en mobile (descuenta barras del navegador) */
}

/* ── Sidebar ── */
.sidebar {
  position: relative;
  background: linear-gradient(180deg, #1c1c1c 0%, #171717 100%);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  overflow: visible;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16,163,127,0.35), transparent);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 20px;
}

.sidebar-logo-img {
  width: 130px;
  height: auto;
  /* El logo ya es azul metálico sobre fondo transparente: no invertir.
     Un leve brillo + drop-shadow lo despega del sidebar oscuro. */
  filter: brightness(1.05) drop-shadow(0 2px 8px rgba(0,0,0,0.45));
  opacity: 1;
  display: block;
}

/* ── Chips de sugerencia en sidebar ── */
.sidebar-suggestions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 4px 14px;
  margin-top: -12px;  /* compensa el margin-bottom del new-chat-btn */
}
.sidebar-suggest-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: left;
}
.sidebar-suggest-chip:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--accent);
}

/* ── Welcome screen en modo chat: oculta carrusel y btn tienda ── */
#welcome-screen.chat-mode .carousel-wrapper,
#welcome-screen.chat-mode .store-btn { display: none !important; }

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 20px;
}
.new-chat-btn:hover { background: var(--surface); }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px 8px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-history::-webkit-scrollbar { width: 4px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item:hover { background: var(--surface); color: var(--text); }

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

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-badge:hover { background: var(--surface); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }

/* ── Main ── */
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* evita que el input quede tapado por la barra del navegador */
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(33,33,33,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.model-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 14px 5px 10px;
  border-radius: 20px;
}

.model-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(16,163,127,0.7);
  animation: badge-pulse 2.8s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16,163,127,0.7); }
  50%       { opacity: 0.55; box-shadow: 0 0 12px rgba(16,163,127,0.3); }
}

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

/* Nav links del topbar (desktop) */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
}

.topbar-nav-link {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  font-family: inherit;
}

.topbar-nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.topbar-nav-link.active {
  color: var(--text);
  background: var(--surface);
}

.icon-btn.topbar-mail-icon { display: none; } /* oculto en desktop, solo mobile */

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }

/* ── Botón hamburguesa (solo mobile) ── */
.menu-btn {
  display: none; /* visible solo en mobile vía media query */
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  margin-right: 4px;
  border-radius: 8px;
  align-items: center;
}
.menu-btn:hover { background: var(--surface); }

/* ── Backdrop del drawer (solo mobile) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  opacity: 0;
  pointer-events: none; /* no bloquea clics cuando el drawer está cerrado */
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

/* ── Chat area ── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: none;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  align-self: stretch;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Messages ── */
.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.message.user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* Botón "Ver este kit en la tienda" (aparece cuando el bot propone un kit) */
.kit-cta {
  align-self: flex-start;
  max-width: 85%;
  margin: -2px 0 4px;
}
.kit-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.kit-cta-btn:hover { opacity: 0.92; }
.kit-cta-btn:active { transform: translateY(1px); }

/* ── Asesor profesional ────────────────────────────────────────────────────── */
.pro-banner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px auto 18px;
  max-width: 640px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(24,121,78,0.12), rgba(24,121,78,0.04));
  border: 1px solid rgba(24,121,78,0.30);
}
.pro-banner-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 3px; }
.pro-banner-text strong { font-size: 14.5px; color: var(--text); }
.pro-banner-text span   { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.pro-banner-btn {
  flex-shrink: 0;
  background: #18794e;
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.pro-banner-btn:hover  { opacity: .92; }
.pro-banner-btn:active { transform: translateY(1px); }
.pro-banner-btn:disabled { opacity: .6; cursor: default; }
.pro-upsell-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.pro-banner-btn-alt {
  background: transparent;
  color: #18794e;
  border: 1px solid #18794e;
}

/* ── Panel de suscripción (desde el menú de usuario) ── */
.subscription-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.sub-intro { display: flex; flex-direction: column; gap: 4px; }
.sub-intro strong { font-size: 16px; color: var(--text); }
.sub-intro span   { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.sub-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(24,121,78,0.14), rgba(24,121,78,0.05));
  border: 1px solid rgba(24,121,78,0.32);
}
.sub-status-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #18794e;
  color: #fff;
}
.sub-status-text { display: flex; flex-direction: column; gap: 3px; }
.sub-status-text strong { font-size: 15px; color: var(--text); }
.sub-status-text span   { font-size: 12.5px; color: var(--text-muted); }
.sub-status-note {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.sub-plans { display: flex; gap: 12px; flex-wrap: wrap; }
.sub-plan-card {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.sub-plan-featured { border-color: rgba(24,121,78,0.45); }
.sub-plan-head { display: flex; flex-direction: column; gap: 4px; }
.sub-plan-name { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.sub-plan-price { font-size: 26px; font-weight: 700; color: var(--text); }
.sub-plan-price small { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.sub-plan-btn { width: 100%; text-align: center; }

.pro-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  background: rgba(24,121,78,0.08);
  border-bottom: 1px solid rgba(24,121,78,0.20);
}
.pro-indicator-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #18794e;
}
.pro-indicator-exit {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.pro-indicator-exit:hover { color: var(--text); }

.pro-sources {
  align-self: flex-start;
  max-width: 85%;
  margin: -2px 0 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* Typing indicator */
.bubble.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
}
.bubble.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Welcome screen ── */
.center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px 20px;
  gap: 28px;
  overflow: hidden;
}

.greeting { text-align: center; }
.greeting h1 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.greeting p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Chips ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 680px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  max-width: 200px;
  line-height: 1.35;
}
.chip:hover { background: var(--chip-h); border-color: #555; }
.chip-icon { font-size: 16px; flex-shrink: 0; }

/* ── Input ── */
.input-area {
  width: 100%;
  max-width: 760px;
  flex-shrink: 0;
  padding: 12px 20px 16px;
  align-self: center;
}

.input-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--input-r);
  padding: 14px 18px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-box:focus-within {
  border-color: rgba(16,163,127,0.55);
  box-shadow: 0 0 0 3px rgba(16,163,127,0.10), 0 0 24px rgba(16,163,127,0.07);
}

.input-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  resize: none;
  line-height: 1.5;
  min-height: 24px;
  max-height: 180px;
  font-family: inherit;
}
.input-box textarea::placeholder { color: var(--text-muted); }

.send-btn {
  width: 34px; height: 34px;
  background: var(--text);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s, box-shadow 0.15s;
  opacity: 0.22;
}
.send-btn.active {
  opacity: 1;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(16,163,127,0.4);
}
.send-btn.active:hover {
  background: oklch(62% 0.155 165);
  box-shadow: 0 0 18px rgba(16,163,127,0.55);
}
.send-btn svg { color: #000; }
.send-btn.active svg { color: #fff; }

.pro-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 13px;
  background: rgba(16,163,127,0.10);
  border: 1px solid rgba(16,163,127,0.35);
  border-radius: 20px;
  color: oklch(76% 0.14 165);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.pro-mode-btn:hover {
  background: rgba(16,163,127,0.18);
  border-color: rgba(16,163,127,0.6);
  box-shadow: 0 0 10px rgba(16,163,127,0.15);
}

.input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Shop button (sidebar) ── */
.shop-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;
  margin-bottom: 20px;
}
.shop-btn:hover { filter: brightness(1.08); }

.app-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 10px;
}
.app-btn:hover { background: rgba(16,163,127,0.1); }
.app-btn-ext { margin-left: auto; opacity: 0.85; }

.shop-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #fff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: auto;
}

/* ── Shop chip (welcome) ── */
.shop-chip {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.shop-chip:hover { background: rgba(16,163,127,0.1) !important; }

/* ── Shop panel ── */
.shop-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.shop-header {
  flex-shrink: 0;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 14px;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text); }

.shop-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

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

/* ── Shop body: lista de productos + card de detalle ── */
.shop-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

/* ── Product cards ── */
.shop-products {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.shop-products::-webkit-scrollbar { width: 4px; }
.shop-products::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Card de detalle (columna derecha en desktop) ── */
.shop-detail {
  flex-shrink: 0;
  width: 340px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 18px 20px;
  background: var(--surface);
}
.shop-detail::-webkit-scrollbar { width: 4px; }
.shop-detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sd-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
  padding: 20px;
}
.sd-placeholder svg { opacity: 0.4; }
.sd-placeholder p { font-size: 13px; line-height: 1.5; }

.sd-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin: -4px -4px 8px auto;
  border-radius: 8px;
}
.sd-close:hover { background: var(--surface2); color: var(--text); }

/* ── Galería (imagen + flechas < > + puntos) ── */
.sd-gallery { position: relative; margin-bottom: 12px; }
.sd-gallery + .sd-dots { margin-top: -4px; }

.sd-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;          /* fondo blanco: las fotos de producto vienen con fondo blanco */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lupa para ampliar la imagen (esquina inferior izquierda) */
.sd-zoom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 2;
}
.sd-zoom:hover { background: rgba(0, 0, 0, 0.72); }
/* contain = muestra la foto completa sin recortarla */
.sd-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sd-image-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

.sd-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.sd-nav:hover { background: rgba(0, 0, 0, 0.7); }
.sd-prev { left: 8px; }
.sd-next { right: 8px; }

.sd-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.sd-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.sd-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.sd-dot.active { background: var(--accent); }

/* Precio mientras se cargan los datos desde Supabase ("---") */
.product-price-loading {
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ── Lightbox de imagen ampliada ── */
.sd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 24px;
  animation: sdLightboxFade 0.15s ease;
}
.sd-lightbox.open { display: flex; }
@keyframes sdLightboxFade { from { opacity: 0; } to { opacity: 1; } }

.sd-lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.sd-lightbox-stage img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.15s;
  background: #fff;
}
.sd-lightbox-stage img.zoomed {
  max-width: none;
  max-height: none;
  width: auto;
  cursor: zoom-out;
}
.sd-lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 3001;
}
.sd-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

.sd-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 6px;
}
.sd-price {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sd-price-final { font-size: 18px; font-weight: 700; color: var(--text); }

.sd-details {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: normal;
  word-wrap: break-word;
  margin-bottom: 16px;
}
.sd-details-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.sd-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.sd-add:hover { opacity: 0.9; }
.sd-add.in-cart {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ── Botón "Más info" en cada slot ── */
.more-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}
.more-info-btn:hover { text-decoration: underline; }

.product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.product-card:hover { border-color: #555; background: var(--surface2); }
.product-card.selected {
  border-color: var(--accent);
  background: rgba(16,163,127,0.06);
}

.product-check { flex-shrink: 0; padding-top: 2px; }

.check-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  color: transparent;
}
.check-circle.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.product-header { margin-bottom: 2px; }

.product-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(16,163,127,0.12);
  padding: 2px 8px;
  border-radius: 20px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.product-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Etiqueta de disponibilidad: stock inmediato vs por encargue */
.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.avail-badge svg { flex-shrink: 0; }
.avail-stock {
  color: #18794e;
  background: rgba(24, 121, 78, 0.10);
}
.avail-order {
  color: #9a6700;
  background: rgba(154, 103, 0, 0.12);
}
.sd-availability { margin: 8px 0 4px; }

/* Aviso de demora en el modal de compra */
.order-delay-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #9a6700;
  background: rgba(154, 103, 0, 0.10);
  border: 1px solid rgba(154, 103, 0, 0.22);
}
.order-delay-note svg { flex-shrink: 0; margin-top: 1px; }

.product-thumb {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.product-thumb:hover { border-color: var(--accent); }

.product-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.product-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.price-discount-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.price-old {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  white-space: nowrap;
}
.price-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #e0484d;
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
  cursor: default;
}
.price-badge-transfer {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #1a7a5e;
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
  cursor: default;
}
.price-transfer-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.price-transfer-final {
  font-size: 12px;
  font-weight: 600;
  color: #3ecfa3;
  white-space: nowrap;
}
.price-transfer-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.sd-transfer-row {
  margin-top: 4px;
  margin-bottom: 2px;
}
.product-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Descuento en líneas del modal de compra */
.order-line-disc {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #e0484d;
  border-radius: 5px;
  padding: 1px 5px;
}

/* Vista previa de precio final en el panel admin */
.apc-final-preview {
  font-size: 13px;
  color: var(--text-muted);
}
.apc-final-preview strong { color: var(--text); }
.apc-prev-old { text-decoration: line-through; }
.apc-prev-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #e0484d;
  border-radius: 5px;
  padding: 1px 5px;
}

.qty-control {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 4px;
}
.qty-control.visible { display: flex; }
.qty-control button {
  width: 26px; height: 26px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.qty-control button:hover { background: var(--surface2); }
.qty-control span {
  min-width: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ── Cart bar ── */
.cart-bar {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  gap: 10px;
}

.cart-total-display {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 0;
  width: min(420px, 100%);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, transform 0.15s;
  box-shadow: 0 4px 22px rgba(16, 163, 127, 0.45);
  letter-spacing: 0.02em;
}
.buy-btn:hover { background: #0d8f6f; transform: translateY(-1px); box-shadow: 0 6px 28px rgba(16, 163, 127, 0.55); }
.buy-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

.modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Order lines */
.order-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.order-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
}
.order-line span:last-child { font-weight: 500; white-space: nowrap; }

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}
.order-total-amount { color: var(--accent); font-size: 18px; }

/* Código de descuento (cupón) en el modal de compra */
.discount-box { margin: 10px 0 4px; }
.discount-input-row { display: flex; gap: 8px; }
.discount-input-row .apc-input { flex: 1; text-transform: uppercase; }
.discount-apply-btn {
  flex-shrink: 0;
  padding: 0 16px;
  border: 1px solid var(--accent);
  background: rgba(16,163,127,0.12);
  color: var(--accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.discount-apply-btn:hover:not(:disabled) { background: rgba(16,163,127,0.22); }
.discount-apply-btn:disabled { opacity: 0.6; cursor: default; }
.discount-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(16,163,127,0.4);
  background: rgba(16,163,127,0.10);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
}
.discount-applied-info strong { color: var(--accent); letter-spacing: .4px; }
.discount-remove-btn {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}
.discount-remove-btn:hover { background: var(--surface2); color: var(--text); }
.discount-error {
  margin-top: 7px;
  font-size: 12.5px;
  color: #f87171;
}
.order-discount-row { color: #34d399; font-weight: 600; }
.order-discount-amount { color: #34d399; }
#modal-subtotal-row { color: var(--text-muted); font-weight: 500; border-top: none; padding-bottom: 0; }
#modal-discount-row { border-top: none; padding-top: 2px; }
#modal-shipping-row { border-top: none; padding-top: 2px; font-weight: 500; }

/* Chip de código de descuento en la tarjeta del pedido */
.order-discount-chip,
.order-ship-chip {
  display: inline-block;
  margin-top: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.order-discount-chip {
  color: #34d399;
  background: rgba(16,163,127,0.12);
  border: 1px solid rgba(16,163,127,0.30);
}
.order-ship-chip {
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* Shipping section */
.ship-method-toggle {
  display: flex;
  gap: 10px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}
.ship-method-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.ship-method-opt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(16,163,127,0.06);
}
.ship-method-opt input { accent-color: var(--accent); }

.ship-andreani-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.ship-andreani-note svg { flex-shrink: 0; margin-top: 1px; stroke: var(--accent); }

/* Grilla de 3 campos de contacto (nombre, mail, teléfono) */
.ship-grid-contact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .ship-grid-contact { grid-template-columns: 1fr; }
}

/* ── Método de pago (checkout) ───────────────────────────────────────────── */
.pay-method-toggle {
  display: flex;
  gap: 10px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}
.pay-method-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  min-width: 170px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-method-opt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(16,163,127,0.06);
}
.pay-method-opt input { accent-color: var(--accent); margin-top: 2px; }
.pay-method-body { display: flex; flex-direction: column; gap: 2px; }
.pay-method-name { font-size: 13.5px; font-weight: 600; }
.pay-method-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 1px 7px;
  border-radius: 20px;
}
.pay-method-sub { font-size: 11.5px; color: var(--text-muted); }

.pay-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.pay-amount { font-size: 18px; font-weight: 700; color: var(--accent); }

.mp-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary, var(--text-muted));
  background: rgba(16,163,127,0.05);
  border: 1px dashed var(--border);
  border-radius: 9px;
}
.mp-note svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

.ship-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
#ship-domicilio-fields { grid-template-columns: 1fr 1fr 80px 80px; }

.ship-branch-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.ship-error {
  display: none;
  margin-top: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #ff6b6b;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 8px;
}
.ship-success {
  margin-bottom: 16px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  background: rgba(16,163,127,0.08);
  border: 1px solid rgba(16,163,127,0.3);
  border-radius: 8px;
}
.ship-success a { color: var(--accent); text-decoration: none; }
.ship-success a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .ship-grid, #ship-domicilio-fields { grid-template-columns: 1fr 1fr; }
}

/* Bank section */
.bank-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.bank-grid { display: flex; flex-direction: column; gap: 2px; }

.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.bank-row:nth-child(odd) { background: var(--surface2); }

.bank-row.highlight {
  background: rgba(16,163,127,0.1) !important;
  border: 1px solid rgba(16,163,127,0.25);
  margin-top: 6px;
}

.bank-label { color: var(--text-muted); }
.bank-value { color: var(--text); font-weight: 500; }
.bank-value.mono { font-family: ui-monospace, monospace; font-size: 12px; }
.bank-value.accent { color: var(--accent); font-weight: 700; font-size: 15px; }

/* Valor + botón de copiado rápido (CBU / Alias) */
.bank-value-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.copy-mini {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-mini:hover { background: var(--surface2); color: var(--text); border-color: #555; }
.copy-mini.copied { color: var(--accent); border-color: var(--accent); }

.modal-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 12px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.modal-note a { color: var(--accent); text-decoration: none; }
.modal-note a:hover { text-decoration: underline; }

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: var(--surface2); border-color: #555; }
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }

.confirm-btn {
  flex: 1;
  padding: 10px 18px;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.confirm-btn:hover { background: #0d8f6f; }

/* ── Login sidebar button ── */
.login-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.login-sidebar-btn:hover { background: var(--surface); color: var(--text); }

/* ── User info block (logged in) ── */
.user-info-block  { flex: 1; min-width: 0; }
.user-email-small { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-plan-badge {
  margin-top: 3px;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  line-height: 1.5;
}
.user-plan-badge.plan-on  { background: rgba(24,121,78,0.16); color: #34d399; }
.user-plan-badge.plan-off { background: rgba(148,163,184,0.14); color: var(--text-muted); }
.user-chevron     { flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s; }
.user-badge:hover .user-chevron { color: var(--text); }

/* ── User dropdown menu ── */
.user-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.user-menu-item:hover   { background: var(--surface); }
.user-menu-danger       { color: #f87171; }
.user-menu-danger:hover { background: rgba(248,113,113,0.08); }
.user-menu-divider      { height: 1px; background: var(--border); margin: 2px 0; }
.orders-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #e0484d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: auto;
  animation: badge-pop 0.25s ease;
}
@keyframes badge-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Auth modal ── */
.auth-modal { max-width: 400px; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.auth-tab:hover:not(.active) { color: var(--text); }

/* Google button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}
.google-btn:hover { background: #f8f8f8; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,163,127,0.15); }
.form-input::placeholder { color: var(--text-muted); }

.auth-submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s, opacity 0.15s;
}
.auth-submit-btn:hover    { background: #0d8f6f; }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Feedback */
.auth-feedback {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.auth-error-msg   { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }
.auth-success-msg { background: rgba(16,163,127,0.1);  color: var(--accent); border: 1px solid rgba(16,163,127,0.25); }

/* ── Orders panel ── */
.orders-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.orders-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  width: 100%;
  align-self: center;
}
.orders-list::-webkit-scrollbar { width: 4px; }
.orders-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.orders-empty, .orders-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.orders-loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 60px 0;
}
.orders-loading span {
  width: 8px; height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.orders-loading span:nth-child(2) { animation-delay: .2s; }
.orders-loading span:nth-child(3) { animation-delay: .4s; }

/* Order card */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-date   { font-size: 12px; color: var(--text-muted); }
.order-amount { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; }

.order-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.status-pending   { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.status-paid      { background: rgba(16,163,127,0.15);  color: var(--accent); }
.status-shipped   { background: rgba(99,102,241,0.15);  color: #818cf8; }
.status-cancelled { background: rgba(248,113,113,0.12); color: #f87171; }

.order-expiry-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.expiry-ok     { background: var(--surface2);               color: var(--text-muted); }
.expiry-soon   { background: rgba(251,191,36,0.14);         color: #fbbf24; }
.expiry-urgent { background: rgba(251,146,60,0.16);         color: #fb923c; }
.expiry-expired{ background: rgba(248,113,113,0.14);        color: #f87171; }

.order-pay-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.pay-mp       { background: rgba(0,158,227,0.14);  color: #2ca6e0; }
.pay-transfer { background: rgba(148,163,184,0.16); color: #94a3b8; }

.order-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.order-item-tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Admin row */
.order-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.order-user-email {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.status-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.status-select:focus { border-color: var(--accent); }

.order-admin-actions { display: flex; align-items: center; gap: 8px; }
.order-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.35);
  color: #f87171;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.order-delete-btn:hover    { background: rgba(248,113,113,0.18); }
.order-delete-btn:active   { transform: translateY(1px); }
.order-delete-btn.is-loading { opacity: 0.6; cursor: default; }

/* ── Bloque de envío (Andreani) en la tarjeta del pedido ── */
.order-ship {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0 2px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.order-ship-line { line-height: 1.4; }
.order-ship-tag {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.order-ship-contact { color: var(--text); }
.order-ship-notes { font-style: italic; }
.order-ship-track strong { color: var(--accent); }
.order-ship-err {
  color: #e05b5b;
  font-size: 12px;
  margin-right: 8px;
}
.order-ship-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.order-ship-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.order-ship-btn:hover { opacity: 0.88; }
.order-ship-btn:disabled { opacity: 0.55; cursor: default; }

/* ── Topbar shop button (mobile only) ── */
.topbar-shop-btn { display: none; }

.topbar-shop-badge {
  display: none;
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════════
   HERO WELCOME SCREEN — ANIMACIONES
   ══════════════════════════════════════════════════════════════════ */

/* Contenedor principal */
.center-content {
  position: relative;
  justify-content: flex-start;
  overflow: hidden;
  gap: 6px;
  padding-top: max(8px, 1.5dvh);
  padding-bottom: 10px;
}

/* Imagen de fondo del hero (grow-room) con capa oscura para legibilidad */
#welcome-screen {
  background-image: url("fondo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#welcome-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18,18,18,0.55) 0%, rgba(18,18,18,0.78) 100%),
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(18,18,18,0.35) 0%, rgba(18,18,18,0.80) 100%);
}
.center-content::-webkit-scrollbar { width: 3px; }
.center-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 4px; }

/* ── Canvas IoT background ── */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Floating data nodes ── */
.data-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 9px 11px 8px;
  background: color-mix(in oklch, var(--dn-color, #10a37f) 7%, rgba(18,19,24,0.92));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in oklch, var(--dn-color, #10a37f) 20%, transparent);
  border-top: 1.5px solid color-mix(in oklch, var(--dn-color, #10a37f) 55%, transparent);
  border-radius: 11px;
  z-index: 0;
  pointer-events: none;
  min-width: 118px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
}

.dn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.dn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--dn-color, #10a37f);
  opacity: 0.9;
}

.dn-label {
  flex: 1;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dn-color, #10a37f);
  opacity: 0.8;
  line-height: 1;
}

.dn-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--dn-color, var(--accent));
  border-radius: 50%;
  animation: dn-blink 2.2s ease-in-out infinite;
}

.dn-val {
  font-family: 'Oxanium', ui-monospace, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  line-height: 1;
  transition: color 0.4s;
}

.dn-spark {
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 5px;
}

.dn-spark-line {
  stroke: var(--dn-color, #10a37f);
  opacity: 0.55;
}

/* Color por sensor */
.dn-1 { --dn-color: #e05c4c; }   /* Temperatura */
.dn-2 { --dn-color: #4aa8e8; }   /* Humedad rel. */
.dn-3 { --dn-color: #9b6fe8; }   /* CO₂ */
.dn-4 { --dn-color: #4abcb8; }   /* VPD */
.dn-5 { --dn-color: #f5a623; }   /* pH */
.dn-6 { --dn-color: #10c994; }   /* EC */
.dn-7 { --dn-color: #7ecb5d; }   /* ORP */
.dn-8 { --dn-color: #c4956a; }   /* Hum. suelo */
.dn-9 { --dn-color: #f0c040; }   /* PPFD */
.dn-10 { --dn-color: #e8943c; }  /* DLI */

/* Posiciones iniciales (JS override inmediato con transform) */
.dn-1 { top: 12%;  left: 2%;  }
.dn-2 { top: 58%;  left: 2%;  }
.dn-3 { top: 12%;  right: 2%; }
.dn-4 { top: 58%;  right: 2%; }
.dn-5 { top: 35%;  left: 2%;  }
.dn-6 { top: 35%;  right: 2%; }
.dn-7 { top: 74%;  left: 2%;  }
.dn-8 { top: 74%;  right: 2%; }
.dn-9 { top: 86%;  right: 2%; }
.dn-10 { top: 86%; left: 2%;  }

@keyframes dn-blink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 7px var(--dn-color, rgba(16,163,127,0.8)); }
  50%       { opacity: 0.3; box-shadow: none; }
}

/* Ocultar nodos en chat mode */
#welcome-screen.chat-mode .data-node,
#welcome-screen.chat-mode .hero-canvas { opacity: 0; transition: opacity 0.4s; }


/* Ocultar nodos en mobile */
@media (max-width: 768px) {
  .data-node { display: none !important; }
}

/* ── Hero body ── */
.hero-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px 8px;
  animation: hero-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  border-radius: 24px;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(16,163,127,0.05) 0%, transparent 70%);
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Logo respirando ── */
.hero-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
}

.hero-logo-svg {
  width: 50px;
  height: 50px;
  position: relative;
  z-index: 2;
  animation: logo-breathe 4.5s ease-in-out infinite;
}

@keyframes logo-breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(16,163,127,0.35));
  }
  50% {
    transform: scale(1.09);
    filter: drop-shadow(0 0 22px rgba(16,163,127,0.7)) drop-shadow(0 0 40px rgba(16,163,127,0.25));
  }
}

/* Anillos de pulso */
.hero-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 163, 127, 0.4);
  animation: ring-pulse 3.5s ease-out infinite;
  z-index: 1;
}

.hero-ring-2 {
  inset: -18px;
  border-color: rgba(16, 163, 127, 0.2);
  animation-delay: -1.75s;
}

@keyframes ring-pulse {
  0%   { transform: scale(0.82); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0;   }
}

/* ── Tipografía del hero ── */
.hero-title {
  font-family: 'Oxanium', ui-sans-serif, sans-serif;
  font-size: clamp(20px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.4px;
  text-align: center;
  line-height: 1.15;
  background: linear-gradient(140deg, var(--text) 40%, oklch(75% 0.14 165));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-wrap: balance;
}

.hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 400px;
}

/* ── Feature pills ── */
/* ── Text scramble: reemplaza las pills ── */
.hero-scramble {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
}

.scramble-text {
  font-size: 21px;
  font-weight: 700;
  color: oklch(76% 0.14 165);
  font-family: 'Oxanium', ui-monospace, 'Cascadia Code', 'SF Mono', monospace;
  letter-spacing: 0.06em;
  width: 320px;
  text-align: center;
  animation: hero-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
  text-shadow: 0 0 30px rgba(16,163,127,0.25);
}

/* Caracteres "scrambling" — tomado de 21st.dev TextScramble */
.scramble-text .dud {
  color: var(--accent);
  opacity: 0.65;
}

/* ── Pro-banner compacto: no desplaza el layout cuando el suscriptor está logueado ── */
.center-content .pro-banner {
  padding: 9px 14px;
  flex-wrap: nowrap;
  margin: 0 auto 0;
  gap: 10px;
}
.center-content .pro-banner-text span { display: none; }

/* ── Logo del sidebar: glow suave ── */
.sidebar-logo svg {
  animation: sidebar-glow 4.5s ease-in-out infinite;
}

@keyframes sidebar-glow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(16,163,127,0.25)); }
  50%       { filter: drop-shadow(0 0 10px rgba(16,163,127,0.6)); }
}

/* ── Input: glow al hacer focus ── */
.input-box:focus-within {
  border-color: rgba(16, 163, 127, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.10),
              0 0 28px rgba(16, 163, 127, 0.08) !important;
}

/* ── Carousel cards mejoradas (single-card mode, ver bloque principal) ── */

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Layout — 100svh = viewport chico (garantiza que el input entre en pantalla) */
  .layout {
    grid-template-columns: 1fr;
    height: 100dvh;
    height: 100svh;
  }
  .main {
    height: 100dvh;
    height: 100svh;
  }

  /* Sidebar como drawer deslizable.
     translate3d + will-change fuerzan capa GPU: iOS Safari no repinta un
     position:fixed animado con translateX a menos que tenga capa propia. */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-width: 84vw;
    z-index: 200;
    padding: 12px 10px;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 24px rgba(0,0,0,0.45);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .sidebar.open { transform: translate3d(0, 0, 0); }
  .sidebar-backdrop { display: block; }

  /* Topbar */
  .topbar { padding: 10px 12px; gap: 8px; }
  .menu-btn { display: flex; }
  .topbar-shop-btn { display: flex; }
  .topbar-nav { display: none; }
  .icon-btn.topbar-mail-icon { display: flex; }
  .model-badge { font-size: 12px; padding: 4px 10px; }

  /* Welcome screen: scrollable y compacto en mobile */
  .center-content {
    overflow-y: auto;
    justify-content: flex-start;
    padding: 12px 16px 20px;
    gap: 12px;
  }
  .hero-body      { padding: 6px 16px 8px; gap: 9px; }
  .hero-logo-wrap { width: 56px; height: 56px; }
  .hero-logo-svg  { width: 48px; height: 48px; }
  .hero-title     { font-size: 19px; }
  .hero-scramble  { height: 34px; }
  .scramble-text  { font-size: 19px; }
  .greeting h1 { font-size: 22px; }
  .greeting p  { font-size: 13px; }

  .chips {
    gap: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .chip {
    max-width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 12px;
  }
  /* El chip de tienda ocupa toda la fila si queda solo */
  .chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-content: center;
  }

  /* Chat area */
  .chat-area { padding: 16px 14px; }
  .message   { max-width: 92%; }

  /* Input */
  .input-area { padding: 10px 12px 12px; }
  .input-box  { padding: 12px 14px; }
  .input-box textarea { font-size: 14px; }
  .input-hint { font-size: 10px; }

  /* Shop panel */
  .shop-header { padding: 14px 16px 12px; }
  .shop-title  { font-size: 16px; }
  .shop-subtitle { font-size: 12px; }

  .shop-products { padding: 10px 12px 6px; gap: 8px; }

  /* En mobile la card de detalle es un modal a pantalla completa */
  .shop-detail {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 210;
    border-left: none;
    padding: 16px;
    background: var(--bg);
    display: none;
  }
  .shop-detail.open { display: block; }
  .sd-close { display: inline-flex; }

  .product-card   { padding: 11px 12px; gap: 10px; }
  .product-thumb  { width: 40px; height: 40px; }
  .product-name   { font-size: 14px; }
  .product-desc   { font-size: 11px; }
  .product-price  { font-size: 14px; }
  .product-tag    { font-size: 9px; }

  .qty-control button { width: 28px; height: 28px; font-size: 18px; }
  .qty-control span   { font-size: 13px; }

  .cart-bar { padding: 10px 16px 14px; gap: 8px; }
  .buy-btn { padding: 14px 0; font-size: 16px; width: 100%; border-radius: 16px; }

  /* Modal */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal {
    border-radius: 18px 18px 12px 12px;
    max-height: 85vh;
  }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body   { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  .bank-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .bank-value.mono { font-size: 11px; word-break: break-all; }

  /* Auth modal mobile */
  .auth-modal { max-width: 100%; }
  .auth-tab   { font-size: 13px; padding: 10px; }

  /* Orders mobile */
  .orders-list     { padding: 12px 14px; }
  .order-admin-row { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Store admin mobile */
  .store-admin-body { padding: 12px 14px; }
  .apc-grid         { grid-template-columns: 1fr; }
  .apc-ship         { grid-template-columns: 1fr 1fr; }
}

/* ── Panel admin: gestión de tienda ─────────────────────────────────────────── */

/* Tabs nav */
.store-admin-tabs {
  display: flex;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  scrollbar-width: none;
}
.store-admin-tabs::-webkit-scrollbar { display: none; }
.store-tab-btn {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted, #888);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.store-tab-btn:hover { color: var(--text); }
.store-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Tab panels */
.store-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.store-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  max-width: 760px;
  width: 100%;
  align-self: center;
}
.store-admin-body::-webkit-scrollbar { width: 4px; }
.store-admin-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.store-admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.store-admin-section-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.add-product-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.add-product-btn:hover { opacity: .9; }

.admin-products-list { display: flex; flex-direction: column; gap: 8px; }

.admin-product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity .15s;
  overflow: hidden;
}
.admin-product-card.inactive > .apc-accordion-header { opacity: .55; }

/* Accordion header — siempre visible */
.apc-accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.apc-accordion-header:hover { background: rgba(255,255,255,.04); }
.apc-accordion-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apc-accordion-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.apc-accordion-badge.visible  { background: rgba(16,163,127,.15); color: var(--accent); }
.apc-accordion-badge.hidden   { background: rgba(255,255,255,.07); color: var(--muted, #888); }
.apc-accordion-chevron {
  flex-shrink: 0;
  color: var(--muted, #888);
  transition: transform .2s;
}
.admin-product-card.apc-open .apc-accordion-chevron { transform: rotate(180deg); }

/* Accordion body — colapsable */
.apc-accordion-body {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 14px;
  border-top: 1px solid var(--border);
}
.admin-product-card.apc-open .apc-accordion-body { display: flex; }

.apc-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.apc-bottom { grid-template-columns: 1fr 1fr 90px; align-items: end; }
.apc-ship   { grid-template-columns: 1fr 1fr 1fr 1fr; align-items: end; margin-top: 8px; }
.apc-ship-hint {
  font-size: 11px;
  color: var(--muted, #888);
  margin: 4px 0 2px;
}
.store-admin-hint {
  font-size: 12px;
  color: var(--muted, #888);
  margin: -6px 0 12px;
}

/* ── Automatizaciones de keywords de Instagram ─────────────────────────────── */
.ig-auto-form {
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.ig-auto-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.apc-cancel-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
}
.apc-cancel-btn:hover { background: var(--hover); }

.ig-auto-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.2s;
}
.ig-auto-inactive { opacity: 0.5; }
.ig-auto-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ig-auto-keyword {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.ig-auto-trigger {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--hover);
  padding: 2px 8px;
  border-radius: 20px;
}
.ig-auto-code {
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 2px 8px;
  border-radius: 20px;
}
.ig-auto-fires {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.ig-auto-msg {
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.ig-auto-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.ig-auto-delete {
  margin-left: auto;
  font-size: 12px;
  color: #e05;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
.ig-auto-delete:hover { text-decoration: underline; }

/* ── Conversaciones de Instagram Direct ───────────────────────────────────── */
.ig-conv-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s;
}
.ig-conv-paused {
  border-color: oklch(65% 0.12 45 / 40%);
  background: oklch(65% 0.12 45 / 5%);
}
.ig-conv-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ig-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ig-conv-stage {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 20px;
}
.ig-conv-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.ig-conv-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ig-conv-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 600;
}
.ig-conv-badge-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ig-conv-badge-paused {
  color: oklch(75% 0.14 45);
  background: oklch(65% 0.12 45 / 15%);
}

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

.prompts-admin-textarea {
  width: 100%;
  min-height: 420px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.prompts-admin-textarea:focus {
  border-color: var(--accent);
}
.prompts-admin-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 12px;
}
.prompts-status {
  font-size: 13px;
  color: var(--muted, #888);
}
.prompts-status.ok    { color: var(--accent); }
.prompts-status.error { color: #e05; }

.apc-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.apc-field { display: flex; flex-direction: column; gap: 4px; }
.apc-field > span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.apc-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.apc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,163,127,0.15);
}
textarea.apc-input { resize: vertical; min-height: 38px; }

.apc-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  padding-bottom: 9px;
}
.apc-toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.apc-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  justify-content: flex-end;
}

/* ── Panel de suscriptores ─────────────────────────────────────────────────── */
#subs-search { width: 100%; margin-bottom: 14px; }

.sub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--surface, #fff);
}
.sub-row.sub-active { border-color: rgba(24, 121, 78, 0.5); }
.sub-info { flex: 1 1 200px; min-width: 0; }
.sub-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-tag-admin {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
  background: rgba(120, 120, 255, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}
.sub-email {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sub-state { display: flex; align-items: center; gap: 10px; }
.sub-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.sub-badge-on  { color: #18794e; background: rgba(24, 121, 78, 0.10); }
.sub-badge-off { color: var(--text-muted); background: rgba(120, 120, 120, 0.10); }
.sub-toggle-btn {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: opacity .15s;
}
.sub-toggle-btn:hover { opacity: .9; }
.sub-toggle-btn:disabled { opacity: .5; cursor: default; }
.sub-toggle-btn.is-on {
  background: transparent;
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
}
.sub-feedback { flex-basis: 100%; font-size: 12px; color: var(--text-muted); min-height: 0; }
.sub-feedback:empty { display: none; }
.sub-feedback-err { color: #f87171; }

/* Base de conocimiento: barra de progreso de carga */
.kb-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.kb-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.kb-progress-fill {
  height: 100%;
  width: 0%;
  background: #18794e;
  transition: width .2s ease;
}
.kb-progress-text { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
#kb-file { padding: 7px; }
#kb-technique { cursor: pointer; }

.apc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.apc-actions { display: flex; gap: 8px; }

.apc-save {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.apc-save:hover { opacity: .9; }

.apc-del {
  background: transparent;
  color: #f87171;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.apc-del:hover { background: rgba(248,113,113,0.1); border-color: #f87171; }

.apc-feedback { font-size: 12px; font-weight: 600; display: none; }
.apc-feedback.ok  { color: var(--accent); }
.apc-feedback.err { color: #f87171; }

.bank-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bank-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

/* ── Panel admin: códigos de descuento ──────────────────────────────────────── */
.discount-card .dc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 10px;
}
.dc-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}
.dc-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}
.dc-grid { grid-template-columns: 1fr 1fr 1fr; }
.dc-desc-field { width: 100%; }
.dc-code-input-row { display: flex; gap: 6px; }
.dc-code-input-row .apc-input { flex: 1; }
.dc-suggest-btn {
  flex-shrink: 0;
  width: 40px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}
.dc-suggest-btn:hover { border-color: var(--accent); }
.dc-copy {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dc-copy:hover { border-color: var(--accent); color: var(--accent); }

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

/* ── Botón flotante de WhatsApp ──────────────────────────────────────────────── */
.whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 1200;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: none;            /* lo muestra JS si hay número */
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,211,102,0.45);
  transition: transform .15s, box-shadow .15s;
}
.whatsapp-fab:hover { transform: scale(1.06); box-shadow: 0 8px 26px rgba(37,211,102,0.6); }
.whatsapp-fab:active { transform: scale(0.98); }
/* En mobile, subirlo para no tapar la barra de input del chat */
@media (max-width: 768px) {
  .whatsapp-fab { bottom: 116px; right: 16px; width: 50px; height: 50px; }
}

/* Link de seguimiento del envío (a Andreani) */
.order-track-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  text-decoration: none;
}
.order-track-link:hover { text-decoration: underline; }
.order-track-link svg { opacity: 0.8; }

/* Aviso de envío manual en el modal de compra */
.modal-shipping-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 2px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-muted);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
}
.modal-shipping-note svg { flex-shrink: 0; margin-top: 1px; color: #f59e0b; }

/* CTA del cliente para abonar el envío (link manual) */
.order-shiplink-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
}
.order-shiplink-cta:hover { opacity: .9; }

/* Sección admin: link de envío manual */
.order-ship-manual {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.order-ship-manual-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.order-shiplink-input { font-size: 13px; }
.order-ship-manual-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-ship-btn-mail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

/* ── Carousel ── */
/* ── Carousel (single-card, auto-advance) ── */
.carousel-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 214px;
  flex-shrink: 0;
}
.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: 16px;
  height: 100%;
  position: relative;
}
.carousel-track {
  position: relative;
  height: 100%;
}
.carousel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}
.carousel-card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1),
              transform 0.55s cubic-bezier(0.4,0,0.2,1),
              border-color 0.15s;
}
.carousel-card.c-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.carousel-card:hover { border-color: var(--accent); }

/* Fondo imagen: gris frío claro + tinte neon sutil */
.carousel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 122px;
  background:
    radial-gradient(ellipse at 50% 95%, oklch(55% 0.10 165 / 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 15% 10%, oklch(45% 0.14 285 / 0.12) 0%, transparent 50%),
    #dde2e6;
  z-index: 0;
  pointer-events: none;
}

.carousel-card img {
  width: 100%;
  height: 118px;
  object-fit: contain;
  padding: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  mix-blend-mode: multiply;
}
.carousel-card-body {
  padding: 11px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.carousel-card-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.carousel-card-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-top: auto;
}
/* Precios carrusel */
.carousel-card-price-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: auto;
}
.cc-price { font-size: 14px; font-weight: 700; color: var(--text); }
.cc-price-old { font-size: 10px; text-decoration: line-through; opacity: .5; }
.cc-badge-launch {
  font-size: 9px; font-weight: 700; color: #fff;
  background: #e0484d; border-radius: 4px; padding: 1px 4px; white-space: nowrap;
}
.carousel-card-transfer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.cc-badge-transfer {
  font-size: 9px; font-weight: 700; color: #fff;
  background: #1a7a5e; border-radius: 4px; padding: 1px 4px; white-space: nowrap;
}
.cc-transfer-final { font-size: 12px; font-weight: 700; color: #3ecfa3; }
.cc-transfer-label { font-size: 10px; color: var(--text-muted); }
.carousel-arrow {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding-bottom: 2px;
}
.carousel-arrow:hover { background: var(--surface2); border-color: #555; }

/* ── Store button ── */
.store-btn {
  position: relative;
  z-index: 1;
  /* Centrar en el espacio libre entre el carrusel y la barra de chat:
     al ser el último item del contenedor flex en columna, los márgenes
     auto reparten el sobrante parejo arriba y abajo. */
  margin-top: auto;
  margin-bottom: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--input-r);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 14px rgba(16,163,127,0.28);
  flex-shrink: 0;
}
.store-btn:hover {
  background: #0d8f6f;
  transform: translateY(-1px);
  box-shadow: 0 5px 22px rgba(16,163,127,0.38);
}
@media (max-width: 768px) {
  .carousel-wrapper { height: 240px; max-width: 280px; }
  .carousel-card img { height: 140px; }
  .carousel-card::before { height: 145px; }
  .store-btn { padding: 9px 22px; font-size: 13px; }
}

/* ── Admin: upload de imágenes ── */
.apc-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.apc-image-header > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.apc-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(16,163,127,0.12);
  border: 1px solid rgba(16,163,127,0.35);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.apc-upload-btn:hover { background: rgba(16,163,127,0.22); border-color: var(--accent); }
.apc-upload-btn.uploading { opacity: .6; pointer-events: none; }

.apc-image-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.apc-img-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1a1a1a;
  flex-shrink: 0;
}
.apc-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.apc-img-thumb-err img { display: none; }
.apc-img-thumb-err::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #f87171;
}
.apc-img-cover-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(16,163,127,0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.05em;
}
.apc-img-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.apc-img-thumb:hover .apc-img-remove { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════
   INTRO OVERLAY — Pantalla de entrada futurista
   Inspirado en: 21st.dev Geometric Component + Galaxy Interactive Hero
   ═══════════════════════════════════════════════════════════════════════ */

#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080808;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: intro-bg-in 1s ease both;
}

@keyframes intro-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Grain canvas ── */
.intro-grain {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

/* ── Formas geométricas (21st.dev Geometric) ── */
.intro-shape {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  pointer-events: none;
  z-index: 1;
}
.intro-shape-1 {
  width: 680px; height: 155px;
  border-color: rgba(150,163,185,0.12);
  background: rgba(80,90,110,0.025);
  top: 18%; left: -12%;
  animation: intro-float-1 14s ease-in-out infinite alternate;
}
.intro-shape-2 {
  width: 560px; height: 125px;
  border-color: rgba(140,155,178,0.09);
  background: rgba(70,80,100,0.015);
  bottom: 20%; right: -8%;
  animation: intro-float-2 18s ease-in-out infinite alternate;
}
.intro-shape-3 {
  width: 300px; height: 72px;
  border-color: rgba(140,155,178,0.09);
  background: transparent;
  bottom: 14%; left: 7%;
  animation: intro-float-3 12s ease-in-out infinite alternate;
}
.intro-shape-4 {
  width: 210px; height: 50px;
  border-color: rgba(130,145,168,0.08);
  background: transparent;
  top: 13%; right: 16%;
  animation: intro-float-4 16s ease-in-out infinite alternate;
}
@keyframes intro-float-1 { 0% { transform: rotate(12deg) translateY(0); }   100% { transform: rotate(12deg) translateY(-22px); } }
@keyframes intro-float-2 { 0% { transform: rotate(-15deg) translateY(0); }  100% { transform: rotate(-15deg) translateY(-18px); } }
@keyframes intro-float-3 { 0% { transform: rotate(-8deg) translateY(0); }   100% { transform: rotate(-8deg) translateY(-14px); } }
@keyframes intro-float-4 { 0% { transform: rotate(22deg) translateY(0); }   100% { transform: rotate(22deg) translateY(-10px); } }

/* ── Contenido central ── */
.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 2;
  position: relative;
}

/* ── Área visual (prisma rectangular) — en flujo, dentro de la columna ── */
.intro-visual {
  /* Dimensiones del prisma (alto > ancho). Las custom props se heredan a la
     escena, el cubo, las caras y el logo interior. */
  --ch: min(54vh, 76vw);            /* alto */
  --cw: calc(var(--ch) * 0.60);     /* ancho (reducido) */
  --cd: calc(var(--cw) * 0.72);     /* profundidad */

  position: relative;
  width: var(--cw);
  height: var(--ch);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  pointer-events: none;
  animation: intro-in 0.9s cubic-bezier(0.22,1,0.36,1) 0.4s both;
}

/* ── Hoja de cannabis centrada dentro del cubo ── */
.intro-cannabis-leaf {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0.65;
  filter: drop-shadow(0 0 5px rgba(16,163,127,0.18));
  animation: leaf-pulse 5s ease-in-out 2.5s infinite;
}

@keyframes leaf-pulse {
  0%, 100% { opacity: 0.48; filter: drop-shadow(0 0 3px rgba(16,163,127,0.10)); }
  50%       { opacity: 0.90; filter: drop-shadow(0 0 11px rgba(16,163,127,0.46)); }
}

.lf {
  fill: none;
  animation: leaf-draw 1.6s ease-out forwards;
}
.leaf-vein {
  animation: leaf-draw 1s ease-out 1.5s forwards;
  fill: none;
}

@keyframes leaf-draw {
  to { stroke-dashoffset: 0; }
}

/* ── Respiración sutil de las esquinas (el prisma se mantiene como caja) ── */
.cube-face {
  animation: cube-morph 14s ease-in-out 3s infinite;
}

@keyframes cube-morph {
  0%, 100% { border-radius: 3px; }
  50%      { border-radius: 16px; }
}

/* ── Cubo interno (oculto) ── */
.inner-cube {
  display: none;
  position: absolute;
  width: 82px; height: 82px;
  left: 59px; top: 59px;
  transform-style: preserve-3d;
  opacity: 0;
  animation:
    tesseract-appear 14s ease-in-out 3s infinite,
    inner-spin 8s linear infinite;
}

.cube-face-i {
  position: absolute;
  width: 82px; height: 82px;
  border: 1px solid rgba(140,170,220,0.52);
  background: rgba(16,30,50,0.04);
}
.cube-face-i:nth-child(1) { transform: translateZ(41px); }
.cube-face-i:nth-child(2) { transform: rotateY(180deg)  translateZ(41px); }
.cube-face-i:nth-child(3) { transform: rotateY(90deg)   translateZ(41px); }
.cube-face-i:nth-child(4) { transform: rotateY(-90deg)  translateZ(41px); }
.cube-face-i:nth-child(5) { transform: rotateX(90deg)   translateZ(41px); }
.cube-face-i:nth-child(6) { transform: rotateX(-90deg)  translateZ(41px); }

@keyframes inner-spin {
  from { transform: rotateX(20deg) rotateY(0deg); }
  to   { transform: rotateX(20deg) rotateY(360deg); }
}

@keyframes tesseract-appear {
  0%, 62%  { opacity: 0; }
  72%, 88% { opacity: 1; }
  100%     { opacity: 0; }
}

.intro-cube-glow-bg {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(140,160,200,0.11) 0%, transparent 62%);
  border-radius: 50%;
  pointer-events: none;
  animation: intro-glow-pulse 4s ease-in-out infinite;
}
@keyframes intro-glow-pulse {
  0%,100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ── Scan line ── */
.intro-scan {
  position: absolute;
  inset: -10px;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}
.intro-scan::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(185,200,228,0.72) 50%, transparent);
  animation: intro-scan-sweep 3.5s ease-in-out 2s infinite;
}
@keyframes intro-scan-sweep {
  0%   { transform: translateY(0); opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(calc(var(--ch, 220px) + 12px)); opacity: 0; }
}

/* ── 3D Cube ── */
.intro-cube-scene {
  width: var(--cw);
  height: var(--ch);
  perspective: calc(var(--ch) * 3.6);
  perspective-origin: 50% 50%;
  transition: transform 0.25s ease;
  position: relative;
  z-index: 2;
  animation: cube-glitch 6s linear infinite;
}

@keyframes cube-glitch {
  0%,100%{ transform:none;                          opacity:1;  }
  /* Burst 1: jitter lateral */
  15%    { transform:skewX(4deg)  translateX(6px);  opacity:.85; }
  15.5%  { transform:skewX(-3deg) translateX(-5px); opacity:1;   }
  16%    { transform:none;                          opacity:1;   }
  /* Burst 2: flicker */
  40%    { opacity:.25; transform:skewX(2deg);  }
  40.4%  { opacity:1;   transform:none;         }
  40.8%  { opacity:.6;                          }
  41.2%  { opacity:1;                           }
  /* Burst 3: jitter lateral */
  72%    { transform:translateX(-7px) skewX(-3deg); opacity:.8;  }
  72.5%  { transform:translateX(4px);               opacity:1;   }
  73%    { transform:none;                          opacity:1;   }
}

.intro-cube {
  width: var(--cw);
  height: var(--ch);
  position: relative;
  transform-style: preserve-3d;
  animation: intro-cube-spin 14s linear infinite;
}

@keyframes intro-cube-spin {
  from { transform: rotateX(14deg) rotateY(0deg); }
  to   { transform: rotateX(14deg) rotateY(360deg); }
}

.cube-face {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(150,178,216,0.30);
  backface-visibility: visible;
}

/* Frente / dorso → ancho × alto */
.face-front, .face-back { width: var(--cw); height: var(--ch); }
.face-front {
  transform: translate(-50%, -50%) translateZ(calc(var(--cd) / 2));
  background: linear-gradient(135deg,
              rgba(36,54,84,0.20) 0%,
              rgba(120,150,196,0.05) 46%,
              rgba(70,98,142,0.07) 56%,
              rgba(16,24,40,0.22) 100%);
}
.face-back {
  transform: translate(-50%, -50%) rotateY(180deg) translateZ(calc(var(--cd) / 2));
  background: rgba(10,16,28,0.30);
}

/* Laterales → profundidad × alto */
.face-right, .face-left { width: var(--cd); height: var(--ch); }
.face-right {
  transform: translate(-50%, -50%) rotateY(90deg)  translateZ(calc(var(--cw) / 2));
  background: rgba(22,32,52,0.22);
}
.face-left {
  transform: translate(-50%, -50%) rotateY(-90deg) translateZ(calc(var(--cw) / 2));
  background: rgba(14,22,38,0.22);
}

/* Tapa / base → ancho × profundidad */
.face-top, .face-bottom { width: var(--cw); height: var(--cd); }
.face-top {
  transform: translate(-50%, -50%) rotateX(90deg)  translateZ(calc(var(--ch) / 2));
}
.face-bottom {
  transform: translate(-50%, -50%) rotateX(-90deg) translateZ(calc(var(--ch) / 2));
  background: rgba(8,14,24,0.30);
}

/* Corner brackets en face-front */
.face-front::before, .face-front::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(185,200,225,0.78);
  border-style: solid;
}
.face-front::before { top: 8px; left: 8px; border-width: 1.5px 0 0 1.5px; }
.face-front::after  { bottom: 8px; right: 8px; border-width: 0 1.5px 1.5px 0; }

/* Grid en face-top */
.face-top {
  background-image:
    linear-gradient(rgba(140,165,205,0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,165,205,0.22) 1px, transparent 1px);
  background-size: 18px 18px;
  background-color: rgba(16,24,40,0.30);
}

/* ── Logo dentro del cubo 3D ──
   El plano ocupa toda la cara del cubo, así su centro coincide con el centro
   del prisma. Contra-rota en sincronía con .intro-cube (misma duración, sin
   delay) para anular la rotación del padre: el logo mira siempre a cámara y
   queda en el plano z=0, entre la cara delantera y la trasera. */
.cube-logo-plane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: cube-logo-counter 14s linear infinite;
  pointer-events: none;
}

/* Inversa de la rotación del cubo: rotateX(14) rotateY(θ) → rotateY(-θ) rotateX(-14) */
@keyframes cube-logo-counter {
  from { transform: rotateY(0deg)    rotateX(-14deg); }
  to   { transform: rotateY(-360deg) rotateX(-14deg); }
}

.cube-logo-img {
  width: calc(var(--cw) * 0.82);
  height: auto;
  display: block;
  filter: brightness(1.22) saturate(1.05)
          drop-shadow(0 0 10px oklch(58% 0.20 255 / 0.55));
  animation: logo-breathe 4s ease-in-out infinite;
}

@keyframes logo-breathe {
  0%, 100% {
    filter: brightness(1.18) saturate(1.0)
            drop-shadow(0 0 9px oklch(56% 0.18 255 / 0.5));
  }
  50% {
    filter: brightness(1.4) saturate(1.08)
            drop-shadow(0 0 20px oklch(66% 0.24 255 / 0.8));
  }
}

/* ── Marca (texto fallback — ya no se usa pero se preserva) ── */
.intro-brand {
  font-family: 'Oxanium', ui-sans-serif, sans-serif;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
  animation: intro-in 0.7s cubic-bezier(0.22,1,0.36,1) 1s both;
}
.intro-brand span {
  background: linear-gradient(135deg, #c2c8d8 0%, #eaecf5 48%, #98a0b5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-tagline {
  margin: 0;
  font-size: 11px;
  color: rgba(130,145,168,0.62);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  animation: intro-in 0.7s cubic-bezier(0.22,1,0.36,1) 1.2s both;
}

/* ── Botón Entrar ── */
.intro-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 44px;
  background: rgba(18,20,28,0.6);
  border: 1px solid rgba(160,175,205,0.34);
  border-radius: 50px;
  color: rgba(215,225,242,0.92);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 40px rgba(140,155,190,0.06), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: all 0.28s cubic-bezier(0.22,1,0.36,1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
  animation: intro-in 0.7s cubic-bezier(0.22,1,0.36,1) 1.5s both;
}
.intro-enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(180,200,230,0.13) 50%, transparent 75%);
  transform: translateX(-150%);
  transition: transform 0.55s ease;
}
.intro-enter-btn:hover {
  background: rgba(28,32,45,0.8);
  border-color: rgba(175,192,220,0.58);
  box-shadow: 0 0 70px rgba(140,160,205,0.12), 0 4px 24px rgba(120,140,180,0.09);
  transform: translateY(-3px);
}
.intro-enter-btn:hover::before { transform: translateX(150%); }
.intro-enter-btn:active { transform: translateY(-1px); }

/* ── Status ── */
.intro-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: rgba(140,155,178,0.38);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: intro-in 0.5s ease 1.9s both;
}
.intro-status-dot {
  width: 5px; height: 5px;
  background: rgba(185,198,220,0.72);
  border-radius: 50%;
  animation: dn-blink 2.2s ease-in-out infinite;
}

/* ── Footer ── */
.intro-footer {
  position: absolute;
  bottom: 22px;
  font-size: 10px;
  color: rgba(140,155,178,0.22);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: intro-in 0.5s ease 2.1s both;
  z-index: 2;
}

/* ── Animación compartida de entrada ── */
@keyframes intro-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Exit ── */
#intro-overlay.exiting {
  animation: intro-exit 0.65s cubic-bezier(0.22,1,0.36,1) forwards;
  pointer-events: none;
}
@keyframes intro-exit {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
#intro-overlay.exiting .intro-cube {
  animation: intro-cube-exit 0.55s ease forwards !important;
}
@keyframes intro-cube-exit {
  to { transform: rotateX(14deg) rotateY(540deg) scale(0); opacity: 0; }
}

/* ── Mobile / pantallas bajas ── */
@media (max-width: 600px), (max-height: 760px) {
  .intro-shape-1, .intro-shape-2 { display: none; }
  .intro-visual {
    --ch: min(52vh, 122vw);
    --cw: calc(var(--ch) * 0.62);
    --cd: calc(var(--cw) * 0.72);
  }
  .intro-content { gap: 14px; }
  .intro-footer { bottom: 10px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Panel admin: Negocio (gestión interna) — migrado de la webApp
   ════════════════════════════════════════════════════════════════════════════ */

/* Sub-pestañas (chips) */
.neg-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.neg-subtab-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.neg-subtab-btn:hover { color: var(--text); }
.neg-subtab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.neg-pane { display: block; }

/* Tipografía / utilidades */
.neg-muted  { color: var(--text-muted); font-size: 13px; }
.neg-mono   { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.neg-strong { font-weight: 700; }
.neg-right  { text-align: right; }
.neg-nowrap { white-space: nowrap; }
.neg-dot    { margin: 0 7px; opacity: .5; }
.good   { color: var(--accent); }
.danger { color: #fb7185; }
.accent { color: var(--accent); }

/* Encabezado de sección */
.neg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.neg-section-head h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.neg-subhead {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 14px 0 8px;
}

/* Botones */
.neg-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.neg-btn:hover { opacity: .9; }
.neg-btn:disabled { opacity: .5; cursor: default; }
.neg-btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.neg-btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.neg-btn-mini {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color .12s, color .12s;
}
.neg-btn-mini:first-child { margin-left: 0; }
.neg-btn-mini:hover { color: var(--text); border-color: var(--accent); }
.neg-btn-mini:disabled { opacity: .3; cursor: default; }
.neg-btn-mini.danger { color: #fb7185; }
.neg-btn-mini.danger:hover { border-color: #fb7185; }

/* Formularios en fila (alta rápida) */
.neg-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.neg-field { display: flex; flex-direction: column; gap: 4px; }
.neg-field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.neg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.neg-inline { display: flex; gap: 8px; }

/* Tarjetas de estadística (Resumen) */
.neg-resumen-top { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.neg-roadmap-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.neg-roadmap-link:hover { color: var(--text); border-color: var(--accent); }
.neg-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.neg-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 0;
}
.neg-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.neg-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alerta de bajo stock */
.neg-alert {
  background: rgba(251,113,133,.08);
  border: 1px solid rgba(251,113,133,.25);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.neg-alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fb7185;
}
.neg-alert-list { display: flex; flex-direction: column; gap: 6px; }
.neg-alert-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text); }

/* Kanban (Tareas) */
.neg-kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.neg-kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.neg-col-doing { border-top-color: var(--accent); }
.neg-col-done  { border-top-color: #34d399; }
.neg-kanban-col h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.neg-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 999px;
  padding: 1px 8px;
}
.neg-kanban-list { display: flex; flex-direction: column; gap: 8px; }
.neg-task {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.neg-task-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.neg-task-title { font-size: 13px; font-weight: 600; color: var(--text); }
.neg-task-area { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.neg-task-actions { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.neg-prio {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 5px;
  padding: 2px 6px;
  letter-spacing: .3px;
}
.neg-prio-alta  { color: #fb7185; background: rgba(251,113,133,.14); }
.neg-prio-media { color: #f59e0b; background: rgba(245,158,11,.14); }
.neg-prio-baja  { color: #34d399; background: rgba(52,211,153,.14); }

/* Tablas */
.neg-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.neg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.neg-table thead tr {
  text-align: left;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface2);
}
.neg-table th { padding: 10px 12px; font-weight: 600; }
.neg-table td { padding: 10px 12px; color: var(--text); }
.neg-table tbody tr { border-top: 1px solid var(--border); }
.neg-table tfoot tr { border-top: 1px solid var(--border); }
.neg-table tfoot td { padding: 8px 12px; }
.neg-table-sm { font-size: 12px; }
.neg-table-sm th, .neg-table-sm td { padding: 6px 8px; }
.neg-row-danger td { color: #fb7185; }

/* Tarjetas (Proveedores / Productos) */
.neg-cards { display: flex; flex-direction: column; gap: 12px; }
.neg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

/* Proveedores */
.neg-prov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.neg-prov-name { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.neg-prov-name:hover { color: var(--accent); }
.neg-ext { font-size: 11px; color: var(--accent); }
.neg-prov-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; }
.neg-prov-notas { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.neg-prov-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.neg-compras { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }

/* Productos */
.neg-prod-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.neg-prod-arrows { display: flex; flex-direction: column; gap: 2px; }
.neg-prod-arrows .neg-btn-mini { margin: 0; width: 26px; padding: 1px 0; text-align: center; }
.neg-prod-nombre { font-size: 16px; font-weight: 700; flex: 0 1 320px; }
.neg-prod-stats { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.neg-stat-sm { min-width: 0; }
.neg-stat-sm .neg-stat-label { font-size: 11px; }
.neg-stat-sm .neg-stat-value { font-size: 20px; font-weight: 800; }
.neg-stat-hint { font-size: 11px; color: var(--text-muted); }
.neg-bom-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.neg-bom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
}
.neg-prod-prod { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }

/* Gastos */
.neg-gasto-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  max-width: 560px;
  margin-bottom: 24px;
}
.neg-gasto-form h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.neg-gasto-insumos {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.neg-gasto-lines { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.neg-gasto-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.neg-line-del { margin-left: auto; background: none; border: none; color: #fb7185; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.neg-gasto-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.neg-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Modal */
.neg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.neg-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
}
.neg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.neg-modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.neg-modal-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; }
.neg-modal-close:hover { color: var(--text); }
.neg-modal-body { padding: 18px; }
.neg-modal-body .neg-field { margin-bottom: 10px; }
.neg-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.neg-modal-error { color: #fb7185; font-size: 13px; margin-top: 10px; }
.neg-modal-error:empty { display: none; }

@media (max-width: 640px) {
  .neg-grid2 { grid-template-columns: 1fr; }
  .neg-prod-stats { gap: 16px; }
}
