/* ============================================================
   app-catalogo — sistema de diseño basado en shadcn/ui
   + acentos estilo Magic UI (shimmer, border-beam) en CSS puro
   ============================================================ */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --ring: 240 5% 64.9%;
  --destructive: 0 72% 51%;
  --success: 142 71% 45%;
  --success-bg: 143 85% 96%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: hsl(var(--muted) / 0.4);
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }
a { color: hsl(var(--primary)); text-decoration: none; }
.muted { color: hsl(var(--muted-foreground)); font-size: 13px; }

/* ---- Botones (shadcn variants) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  color: hsl(var(--foreground)); font-weight: 500; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: hsl(var(--accent)); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: calc(var(--radius) - 4px); }

/* primary con shimmer estilo Magic UI */
.btn.primary {
  position: relative; overflow: hidden;
  background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.btn.primary:hover { background: hsl(var(--primary) / 0.9); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, hsl(0 0% 100% / 0.28), transparent);
  transform: skewX(-18deg); transition: left .55s ease;
}
.btn.primary:hover::after { left: 130%; }
.btn.danger { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.35); background: hsl(var(--background)); }
.btn.danger:hover { background: hsl(var(--destructive) / 0.08); }

/* ---- Inputs ---- */
select, input[type=text], input[type=password], input[type=search], input[type=file], textarea {
  font: inherit; color: hsl(var(--foreground)); width: auto;
  height: 36px; padding: 0 12px; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background)); outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 6px 10px; height: auto; }
textarea { height: auto; padding: 8px 12px; }
select:focus, input:focus, textarea:focus {
  border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25);
}
::placeholder { color: hsl(var(--muted-foreground)); }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 8px;
  background: hsl(var(--background) / 0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border)); padding: 10px 18px;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.topbar .spacer { flex: 1; }

.menu-toggle { display: none; }
.collapse-toggle { display: inline-flex; }

/* ---- Layout ---- */
.layout { display: flex; min-height: calc(100vh - 57px); }
.sidebar {
  width: 250px; flex: 0 0 250px; background: hsl(var(--background));
  border-right: 1px solid hsl(var(--border)); padding: 12px; overflow-y: auto;
}
.content { flex: 1; padding: 20px 24px; min-width: 0; }

.side-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin: 4px 4px 10px; }
.newcat { display: flex; gap: 6px; margin-bottom: 8px; }
.newcat input { flex: 1; min-width: 0; }
.catsearch { width: 100%; margin: 0 0 12px; height: 34px; }
.btn.eye { font-size: 17px; padding: 0 10px; line-height: 1; }

/* Selector de fotos para etiquetas */
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pickcard { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); overflow: hidden; cursor: pointer; background: hsl(var(--card)); transition: border-color .12s, box-shadow .12s; }
.pickcard.sel { border-color: hsl(var(--primary)); box-shadow: 0 0 0 2px hsl(var(--primary) / 0.3); }
.pickph { aspect-ratio: 1 / 1; background-size: cover; background-position: center; background-color: hsl(var(--muted)); position: relative; }
.pickchk { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.pickname { padding: 6px 8px 0; font-size: 12px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickcat { padding: 0 8px 8px; font-size: 11px; }

.cat-item {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 8px 10px; border-radius: calc(var(--radius) - 2px); cursor: pointer; margin-bottom: 2px;
  font-size: 14px; transition: background .12s;
}
.cat-item:hover { background: hsl(var(--accent)); }
.cat-item.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-weight: 500; }
.cat-item.active .count { background: hsl(0 0% 100% / 0.18); color: hsl(var(--primary-foreground)); }
.count { font-size: 11px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted));
  padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cat-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
/* Manija para arrastrar/reordenar categorias (SortableJS) */
.drag-handle { flex: none; cursor: grab; color: hsl(var(--muted-foreground)); font-size: 16px;
  line-height: 1; padding: 0 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-handle:active { cursor: grabbing; }
.cat-item.active .drag-handle { color: hsl(var(--primary-foreground) / 0.8); }
.sortable-ghost { opacity: .4; }
.sortable-chosen { background: hsl(var(--accent)); }
.cat-actions { display: flex; gap: 1px; flex-shrink: 0; }
.iconbtn { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: hsl(var(--muted-foreground)); border-radius: 6px;
  cursor: pointer; font-size: 13px; padding: 0; transition: background .12s, color .12s; }
.iconbtn:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.iconbtn.danger:hover { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); }
.cat-item.active .iconbtn { color: hsl(var(--primary-foreground) / 0.8); }
.cat-item.active .iconbtn:hover { background: hsl(0 0% 100% / 0.18); color: #fff; }

/* ---- Card grid (catálogo) ---- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .ph {
  aspect-ratio: 1 / 1; background: hsl(var(--muted) / 0.5) center/contain no-repeat;
  cursor: zoom-in; border-bottom: 1px solid hsl(var(--border));
}
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .name { font-weight: 500; font-size: 14px; line-height: 1.35; }
.card .price { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.card .price .from { font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; }

/* ---- Badges / chips ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; width: fit-content; border: 1px solid transparent; }
.badge.ok  { color: hsl(var(--success)); background: hsl(var(--success-bg)); border-color: hsl(var(--success) / 0.25); }
.badge.off,
.badge.no  { color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.10); border-color: hsl(var(--destructive) / 0.25); }
.badge.parcial { color: hsl(32 90% 40%); background: hsl(38 92% 50% / 0.14); border-color: hsl(38 92% 50% / 0.35); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 7px; border: 1px solid transparent; }
.chip.ok  { color: hsl(var(--success)); background: hsl(var(--success-bg)); border-color: hsl(var(--success) / 0.3); }
.chip.off { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); text-decoration: line-through; }

/* Resumen compacto de variantes (en la tarjeta) */
.var-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Lista por variante (etiqueta + precio + disponibilidad) — en el lightbox */
.var-list { display: flex; flex-direction: column; width: 100%; }
.var-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0;
  border-bottom: 1px solid hsl(var(--border) / 0.6); }
.var-row:last-child { border-bottom: none; }
.var-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: hsl(var(--success)); }
.var-dot.off { background: hsl(var(--muted-foreground) / 0.45); }
.var-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-row.off { color: hsl(var(--muted-foreground)); }
.var-row.off .var-label { text-decoration: line-through; }
.var-price { font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ---- Estados ---- */
.empty { color: hsl(var(--muted-foreground)); text-align: center; padding: 64px 20px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary)); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Login (con border-beam estilo Magic UI) ---- */
.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(60rem 60rem at 110% -10%, hsl(var(--primary) / 0.06), transparent 60%),
    radial-gradient(50rem 50rem at -10% 110%, hsl(var(--primary) / 0.05), transparent 60%); }
.login-card {
  position: relative; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 32px 30px; width: 100%; max-width: 380px; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--beam-angle, 0deg), transparent 0 75%, hsl(var(--foreground) / 0.55) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  animation: beam 5s linear infinite;
}
@property --beam-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes beam { to { --beam-angle: 360deg; } }
.login-card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.login-card p { margin: 0 0 22px; color: hsl(var(--muted-foreground)); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 14px; }
.check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: hsl(var(--primary)); cursor: pointer; }
.err { color: hsl(var(--destructive)); font-size: 13px; margin-bottom: 12px;
  background: hsl(var(--destructive) / 0.08); border: 1px solid hsl(var(--destructive) / 0.2);
  padding: 8px 12px; border-radius: calc(var(--radius) - 4px); }

/* ---- Modal / Dialog (shadcn) ---- */
.modal-bg { position: fixed; inset: 0; background: hsl(0 0% 0% / 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; z-index: 50; overflow-y: auto; }
.modal { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.modal header { padding: 18px 22px 10px; font-weight: 600; font-size: 17px; letter-spacing: -.01em;
  display: flex; justify-content: space-between; align-items: center; }
.modal .x { border: none; background: none; font-size: 22px; color: hsl(var(--muted-foreground)); line-height: 1; cursor: pointer; }
.modal .mbody { padding: 6px 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.modal footer { padding: 14px 22px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Lightbox ---- */
.lightbox { position: fixed; inset: 0; background: hsl(0 0% 0% / 0.88); display: flex; align-items: center;
  justify-content: center; z-index: 60; padding: 30px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 24px; max-width: 96vw; max-height: 94vh; }
.lightbox img { max-width: calc(96vw - 320px); max-height: 92vh; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); background: #fff; transform-origin: center center;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; will-change: transform; }
/* Panel de info con tamaño estándar: ancho fijo y alto acotado; el encabezado
   (nombre/precio/disponibilidad) queda fijo y solo las variantes hacen scroll.
   Así la imagen es siempre la protagonista aunque haya muchas variantes. */
.lb-info { flex: 0 0 300px; width: 300px; background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  align-items: stretch; text-align: left; box-shadow: var(--shadow-lg); max-height: 86vh; overflow: hidden; }
.lb-info > .lb-title, .lb-info > .price, .lb-info > div { flex: 0 0 auto; }
.lb-title { font-weight: 600; font-size: 18px; line-height: 1.35; letter-spacing: -.01em; }
.lb-info .price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); background: hsl(var(--background) / 0.92);
  border: 1px solid hsl(var(--border)); width: 46px; height: 66px; font-size: 28px; line-height: 1;
  cursor: pointer; border-radius: var(--radius); color: hsl(var(--foreground)); display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: hsl(var(--background)); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-close { position: fixed; top: 16px; right: 18px; background: hsl(var(--background) / 0.95);
  border: 1px solid hsl(var(--border)); width: 44px; height: 44px; border-radius: 50%; font-size: 18px;
  cursor: pointer; color: hsl(var(--foreground)); z-index: 70; box-shadow: var(--shadow-lg); }

/* ---- Admin photo card ---- */
.acard { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s;
  display: flex; flex-direction: column; }
.acard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.acard .ph { aspect-ratio: 1/1; background: hsl(var(--muted) / 0.5) center/contain no-repeat;
  border-bottom: 1px solid hsl(var(--border)); cursor: pointer; flex: 0 0 auto; }
.acard .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
/* Chips de variantes — aplican en catalogo (.card), lightbox (.lb-info) y admin (.acard) */
.links { display: flex; flex-wrap: wrap; gap: 4px; }
/* En las tarjetas (no en el visor) se limita la altura para que queden uniformes; el resto hace scroll */
.acard .links, .card .links { max-height: 176px; overflow-y: auto; }
.acard .links::-webkit-scrollbar, .card .links::-webkit-scrollbar { width: 6px; }
.acard .links::-webkit-scrollbar-thumb, .card .links::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 999px; }
.plink { font-size: 11px; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  padding: 2px 8px; border-radius: 6px; white-space: nowrap; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 5px; }
/* Punto indicador antes de la etiqueta: verde = disponible, rojo = agotado */
.plink.disp::before    { content: ''; width: 7px; height: 7px; border-radius: 999px; background: hsl(var(--success)); flex: none; }
.plink.agotado::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: hsl(var(--destructive)); flex: none; }
.acard .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.btn.sm.ico { width: 30px; padding: 0; font-size: 15px; line-height: 1; }
.btn.sm.ico.danger { font-size: 14px; }

/* ---- Buscador de productos ---- */
.search-results { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  max-height: 220px; overflow-y: auto; margin-top: 6px; }
.sr-item { padding: 9px 11px; border-bottom: 1px solid hsl(var(--border)); cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sr-item:hover { background: hsl(var(--accent)); }
.sr-item:last-child { border-bottom: none; }
.sr-all { position: sticky; top: 0; z-index: 1; background: hsl(var(--secondary));
  font-weight: 600; color: hsl(var(--primary)); justify-content: flex-start; }
.sr-all:hover { background: hsl(var(--accent)); }
.picked { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: hsl(var(--muted) / 0.6);
  border-radius: calc(var(--radius) - 2px); margin-bottom: 6px; }
.picked input { flex: 0 0 120px; height: 32px; }
.picked .nm { flex: 1; font-size: 13px; }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 11px 18px;
  border-radius: var(--radius); z-index: 80; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.toast.err { background: hsl(var(--destructive)); color: #fff; }

/* ---- Segmented (modo fotos/pendientes) ---- */
.segmented { display: inline-flex; background: hsl(var(--muted)); border-radius: calc(var(--radius) - 2px); padding: 2px; gap: 2px; }
.segmented button { border: none; background: transparent; padding: 5px 12px; border-radius: calc(var(--radius) - 4px);
  font-size: 13px; font-weight: 500; color: hsl(var(--muted-foreground)); cursor: pointer; white-space: nowrap; }
.segmented button.active { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); }
.count-done { background: hsl(var(--success-bg)) !important; color: hsl(var(--success)) !important; }

/* ---- Aviso de grupo / instrucciones ---- */
.group-hint { background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  padding: 10px 12px; font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.4; }
.group-hint strong { color: hsl(var(--foreground)); }

/* ---- Tarjetas de grupo pendiente ---- */
.acard.pend { display: flex; border-style: dashed; }
.pend-body { padding: 14px; display: flex; flex-direction: column; gap: 5px; width: 100%; }
.pend-modelo { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.pend-ej { font-size: 12px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pend-body .btn { margin-top: 8px; }
.pend-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: auto; }
.pend-stock { font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pend-stock.has { background: hsl(var(--success-bg)); color: hsl(var(--success)); }
.pend-stock.zero { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.plink strong { margin-left: 5px; }
.plink.disp    { color: hsl(var(--success)); background: hsl(var(--success-bg)); border-color: hsl(var(--success) / 0.3); }
.plink.agotado { color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.10);
  border-color: hsl(var(--destructive) / 0.3); text-decoration: line-through; }

/* En el visor ampliado: variantes uniformes (una por fila, ancho completo, precio a la derecha) */
.lb-info .links { flex-direction: column; gap: 6px; width: 100%; }
.lb-info .plink { width: 100%; box-sizing: border-box; justify-content: flex-start; font-size: 12px; padding: 5px 10px; }
.lb-info .plink strong { margin-left: auto; }
/* Variantes agrupadas por talla con subtítulo */
.lb-info .vargroups { display: flex; flex-direction: column; gap: 12px; width: 100%;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.lb-info .vargroups::-webkit-scrollbar { width: 6px; }
.lb-info .vargroups::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 999px; }
.vgroup-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: hsl(var(--muted-foreground)); margin-bottom: 5px; padding-left: 2px; }

/* ---- Carga masiva ---- */
.bulk-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.bulk-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: hsl(var(--muted) / 0.5); border-radius: calc(var(--radius) - 2px); }
.bulk-file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.bulk-modelo { flex: 0 0 116px; height: 30px; text-transform: uppercase; }
.bulk-estado { flex: 0 0 150px; font-size: 12px; font-weight: 600; text-align: right; color: hsl(var(--muted-foreground)); }
.bulk-estado.e-ok, .bulk-estado.e-subida { color: hsl(var(--success)); }
.bulk-estado.e-error { color: hsl(var(--destructive)); }

.sidebar.collapsed { display: none; }

/* ---- Usuarios ---- */
.utable { border: 1px solid hsl(var(--border)); border-radius: var(--radius); overflow: hidden; background: hsl(var(--card)); }
.utable-head, .utable-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr .8fr 1.4fr .8fr 120px;
  gap: 10px; align-items: center; padding: 10px 14px;
}
.utable-head { background: hsl(var(--muted) / 0.6); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: hsl(var(--muted-foreground)); }
.utable-row { border-top: 1px solid hsl(var(--border)); font-size: 14px; }
.utable-row.inactivo { opacity: .55; }
.utable-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-user { font-weight: 600; }
.u-emp { color: hsl(var(--muted-foreground)); font-size: 13px; }
.urol { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.urol.admin { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.urol.vendedor { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.u-acts { display: flex; gap: 4px; justify-content: flex-end; overflow: visible; }
.emp-checks { display: flex; flex-direction: column; gap: 6px; }
input.ro { background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground)); cursor: not-allowed; }

/* ---- Responsive ---- */
/* Tablet y móvil: el control de modos (Mis fotos/Pendientes/Usuarios) va en su
   propia fila a ancho completo, para que nada se salga del topbar. */
@media (max-width: 820px) {
  .segmented { order: 10; width: 100%; }
  .segmented button { flex: 1; text-align: center; }
}

@media (max-width: 640px) {
  .t-full { display: none; }
  .utable-head { display: none; }
  .utable-row { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; }
  .u-emp, .utable-row > span:nth-child(2) { grid-column: 1 / -1; font-size: 12px; }
  .u-acts { grid-row: 1; grid-column: 2; }
  .menu-toggle { display: inline-flex; }
  .collapse-toggle { display: none; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .topbar h1 { font-size: 15px; }
  .topbar select { max-width: 110px; }
  .uname { display: none; }
  .btn-lbl { display: none; }
  .sidebar { position: fixed; left: 0; top: 52px; bottom: 0; z-index: 30; box-shadow: var(--shadow-lg);
    transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { display: block; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .lb-info .price { font-size: 23px; }
  .lb-nav { width: 40px; height: 56px; font-size: 24px; }
}

/* ===== VISOR AMPLIADO por orientación ===== */
/* VERTICAL (portrait): la FOTO es protagonista a casi pantalla completa; la barra
   de precios queda ABAJO (se ve apenas y se baja con scroll). Sin scroll anidado. */
@media (orientation: portrait) {
  .lightbox { align-items: flex-start; overflow-y: auto; padding: 8px; }
  .lb-stage { flex-direction: column; gap: 10px; max-height: none; width: 100%; align-items: center; }
  .lightbox img { width: 100%; max-width: 100%; max-height: 86vh; object-fit: contain; }
  .lb-info { flex: none; width: 100%; max-width: 680px; align-items: stretch; text-align: left;
    padding: 14px 16px; max-height: none; overflow: visible; }
  .lb-info .vargroups { overflow: visible; flex: none; }
  .lb-nav { top: 38vh; width: 42px; height: 58px; }
}
/* HORIZONTAL (landscape): la FOTO ocupa el máximo; panel angosto al lado. */
@media (orientation: landscape) {
  .lightbox { padding: 14px; }
  .lb-stage { gap: 16px; max-width: 99vw; max-height: 96vh; }
  .lightbox img { max-width: calc(100vw - 290px); max-height: 96vh; }
  .lb-info { flex: 0 0 282px; width: 282px; max-height: 92vh; }
}
/* En dispositivos táctiles las flechas estorban encima de la foto: se navega con
   swipe (deslizar). El botón ✕ siempre cierra. */
@media (hover: none) and (pointer: coarse) {
  .lb-nav { display: none; }
}
