/* ── RESET + VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul: #0066B2;
  --azul-hover: #004f8f;
  --naranja: #f48120;
  --naranja-hover: #d4690f;
  --error: #f04438;
  --success: #039855;
  --border: #eaecf0;
  --bg: #f8faff;
  --text: #101828;
  --text-muted: #667085;
  --text-faint: #98a2b3;
  --text-secondary: #344054;
  --border-light: #f2f4f7;
  --bg-hover: #f9fafb;
  --input-border: #d0d5dd;
}

.hidden { display: none !important; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

/* ── LAYOUT BASE ── */
.view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#view-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

/* ── LOGIN — PANEL IZQUIERDO ── */
.login-left {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 48px 56px;
}

.login-brand {
  margin-bottom: auto;
}

.login-logo {
  height: 36px;
  object-fit: contain;
}

.login-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 32px;
}

.login-pill {
  background: rgba(0, 102, 178, .07);
  border: 1px solid rgba(0, 102, 178, .12);
  color: var(--azul);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  width: fit-content;
}

.login-h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.5px;
  margin-bottom: 14px;
}

.login-h1 span {
  color: var(--azul);
}

.login-p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 320px;
  margin-bottom: 32px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.feat-icon svg {
  width: 16px;
  height: 16px;
}

.feat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.feat-desc {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}

.login-footer {
  font-size: 11px;
  color: var(--input-border);
}

/* ── LOGIN — PANEL DERECHO ── */
.login-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 72px;
  background: white;
}

.login-form-wrap {
  max-width: 360px;
  width: 100%;
}

.form-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
  margin-bottom: 4px;
}

.form-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.error-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbfa;
  border: 1.5px solid #fda29b;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #b42318;
  font-weight: 500;
}

.error-box svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  background: #fff;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.field input::placeholder {
  color: var(--input-border);
}

.field input:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(0, 102, 178, .1);
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  color: var(--text-faint);
}

.eye-btn svg {
  width: 18px;
  height: 18px;
}

.btn-login {
  width: 100%;
  height: 44px;
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(0, 102, 178, .2);
  margin-top: 4px;
}

.btn-login:hover {
  background: var(--azul-hover);
  transform: translateY(-1px);
}

.lock-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--input-border);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sb-brand {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.sb-logo-img {
  height: 28px;
  object-fit: contain;
  max-width: 160px;
}

.sb-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sb-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.nav-item.active {
  background: #e6f0ff;
  color: var(--azul);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: #fef3f2;
  color: #b42318;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.blue {
  background: #e6f0ff;
  color: var(--azul);
}

.sb-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-back, .sb-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-faint);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.sb-back:hover, .sb-logout:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.sb-back svg, .sb-logout svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ── TOPBAR + MAIN ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 56px;
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
}

.page-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.icon-btn:hover {
  background: var(--border-light);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--error);
  border-radius: 50%;
  border: 1.5px solid white;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon.blue { background: #e6f0ff; }
.stat-icon.blue svg { stroke: var(--azul); }
.stat-icon.red { background: #fef3f2; }
.stat-icon.red svg { stroke: var(--error); }
.stat-icon.orange { background: #fff6ed; }
.stat-icon.orange svg { stroke: var(--naranja); }
.stat-icon.green { background: #ecfdf3; }
.stat-icon.green svg { stroke: var(--success); }

.stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
}

.stat-val.red { color: var(--error); }
.stat-val.orange { color: var(--naranja); }
.stat-val.green { color: var(--success); }

.stat-trend {
  font-size: 11px;
  color: var(--text-faint);
}

.stat-trend b { color: var(--success); }
.stat-trend b.warn { color: var(--error); }

/* ── ALERTS BAR ── */
.alerts-bar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alerts-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-right: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.chip:hover { opacity: .75; }

.chip svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.chip-red { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.chip-orange { background: #fff6ed; color: #b54708; border: 1px solid #fddcab; }
.chip-green { background: #ecfdf3; color: #027a48; border: 1px solid #a9efc5; }

.chip-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
}

/* ── PANELS ── */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── QUICK ACTIONS ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.qa-btn:hover {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0,102,178,.08);
}

.qa-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--azul);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 700px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.panel-full {
  grid-column: 1 / -1;
}

.panel-head {
  padding: 16px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

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

.panel-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.panel-body {
  padding: 16px 20px 20px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--input-border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-hover);
  transition: all .2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--azul);
  background: #f0f5ff;
}

.drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.drop-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.drop-sub {
  font-size: 11px;
  color: var(--text-faint);
}

.drop-sub span {
  color: var(--azul);
  font-weight: 600;
  cursor: pointer;
}

/* ── BUTTONS ── */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  font-family: inherit;
  border: none;
}

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

.btn-primary { background: var(--azul); color: white; }
.btn-primary:hover { background: var(--azul-hover); }
.btn-secondary { background: white; color: var(--text-secondary); border: 1px solid var(--input-border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-orange { background: var(--naranja); color: white; }
.btn-orange:hover { background: var(--naranja-hover); }
.btn-danger { background: #fef3f2; color: #b42318; border: 1.5px solid #fecdca; }
.btn-danger:hover { background: #fee4e2; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 11px; border-radius: 6px; }

/* ── STATUS BOX ── */
.status-box {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.status-row .k { color: var(--text-muted); }
.status-row .v { font-weight: 600; color: var(--text); }
.status-row .v.ok { color: var(--success); }

/* ── IMAGE GRID ── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.img-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 8px;
  font-weight: 600;
  border: 1.5px solid;
  cursor: pointer;
  transition: opacity .15s;
}

.img-cell:hover { opacity: .8; }

.img-cell svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ic-ok { background: #ecfdf3; border-color: #a9efc5; color: #027a48; }
.ic-orphan { background: #fff6ed; border-color: #fddcab; color: #b54708; }
.ic-miss { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.ic-add { background: var(--bg-hover); border-color: #eaecf0; border-style: dashed; color: var(--text-faint); }

.img-legend {
  display: flex;
  gap: 16px;
  font-size: 10px;
  margin-bottom: 8px;
}

.img-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── ORDERS TABLE ── */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: .2px;
}

.orders-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--bg-hover);
  vertical-align: middle;
  font-size: 12px;
}

.orders-table tr:last-child td { border-bottom: none; }

.orders-table tr.pedido-row {
  cursor: pointer;
  transition: background .1s;
}

.orders-table tr.pedido-row:hover td { background: #fafafa; }

.order-name { font-weight: 600; color: var(--text); }
.order-cuit { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.order-date { color: var(--text-muted); }
.order-total { font-weight: 700; color: var(--azul); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
}

.pill-new     { background: #ecfdf3; color: #027a48; border: 1px solid #a9efc5; }
.pill-visto   { background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border); }
.pill-nuevo   { background: #fff6ed; color: #b54708; border: 1px solid #fddcab; }
.pill-en-curso   { background: #e6f0ff; color: var(--azul); border: 1px solid #bfdbfe; }
.pill-terminado  { background: #ecfdf3; color: #027a48; border: 1px solid #a9efc5; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: white;
  border-radius: 12px;
  width: 560px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
}

.modal-header {
  background: var(--azul);
  color: white;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: .8;
}

.modal-close:hover { opacity: 1; }

.modal-body { padding: 20px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #101828;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
  animation: slideIn .2s ease;
  max-width: 360px;
}

.toast.success { background: #027a48; }
.toast.error { background: #b42318; }

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

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── SEARCH MINI ── */
.search-mini {
  height: 32px;
  padding: 0 12px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.search-mini:focus { border-color: var(--azul); }

/* ── PROGRESS BAR ── */
.progress-wrap { margin-top: 12px; }

.progress-bar-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--azul);
  border-radius: 100px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s;
}

.progress-label {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ── STEP INDICATOR ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}

.step-ind {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.step-ind.done .step-num { background: var(--success); color: white; }
.step-ind.active .step-num { background: var(--azul); color: white; }
.step-ind.pending .step-num { background: var(--border-light); color: var(--text-faint); }
.step-ind.done .step-lbl { color: var(--success); font-weight: 600; }
.step-ind.active .step-lbl { color: var(--azul); font-weight: 700; }
.step-ind.pending .step-lbl { color: var(--text-faint); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 10px;
  max-width: 50px;
}

.step-line.done { background: var(--success); }

/* ── PRODUCT PREVIEW GRID ── */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.prod-card {
  background: white;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  position: relative;
  transition: box-shadow .15s;
}

.prod-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }

.prod-card.removing {
  opacity: .5;
  border-color: #fecdca;
  background: #fef3f2;
}

.del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #fecdca;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: all .15s;
}

.del-btn:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.card-img {
  height: 72px;
  background: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* En la vista grid del catálogo admin, imagen más destacada y completa */
#cat-grid .card-img {
  height: 160px;
  background: white;
}

#cat-grid .card-img img {
  object-fit: contain;
  padding: 8px;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-img.has-img { background: #ecfdf3; }

.img-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
}

.img-ok { background: #ecfdf3; color: #027a48; }
.img-miss { background: #fef3f2; color: #b42318; }

.card-body { padding: 9px 10px 10px; }

.card-sku {
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 3px;
}

.card-titulo {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-price { font-size: 13px; font-weight: 800; color: var(--text); }
.card-orig { font-size: 9px; text-decoration: line-through; color: #bbb; }

.card-badge {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #fff3e0;
  color: #b54708;
  font-weight: 700;
}

.card-stock { font-size: 10px; color: var(--text-faint); margin-top: 4px; }

/* ── PREVIEW TOOLBAR Y BOTTOM BAR ── */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-title { font-size: 13px; font-weight: 700; color: var(--text); }
.preview-meta { font-size: 11px; color: var(--text-faint); margin-left: 8px; }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-chip {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  transition: all .15s;
}

.filter-chip.active {
  background: var(--azul);
  color: white;
  border-color: var(--azul);
}

.preview-bottom-bar {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.bb-info { font-size: 12px; color: var(--text-muted); }
.bb-removed { color: var(--error); margin-left: 8px; }

.upload-done-banner {
  background: #ecfdf3;
  border: 1.5px solid #a9efc5;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.udb-icon { font-size: 20px; }

.udb-info .name { font-weight: 700; color: #027a48; font-size: 12px; }
.udb-info .meta { color: var(--success); font-size: 10px; margin-top: 2px; }

.udb-change {
  font-size: 11px;
  color: var(--text-faint);
  text-decoration: underline;
  cursor: pointer;
  margin-left: auto;
  background: none;
  border: none;
  font-family: inherit;
}

/* ── PEDIDO DETALLE ── */
.pedido-cliente-info {
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.pedido-cliente-info strong { color: var(--text); }

.pedido-total-row {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--azul);
}

/* ── ALERTAS COLAPSABLES ── */
.alert-section { margin-bottom: 12px; }

.alert-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
}

.alert-section-title svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform .2s;
}

.alert-section-title.open svg { transform: rotate(90deg); }

.alert-section-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 4px;
}

.alert-item-row {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--bg-hover);
  display: flex;
  gap: 8px;
}

.alert-item-sku {
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
}

/* ── TOGGLE SWITCH ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(16,24,40,.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--azul);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── HAMBURGER BUTTON ── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.menu-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

/* ── OFFCANVAS ── */
.offcanvas-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  z-index: 200;
  opacity: 0;
  transition: opacity .25s ease;
}

.offcanvas-backdrop.open {
  display: block;
  opacity: 1;
}

.offcanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 272px;
  height: 100dvh;
  background: white;
  border-right: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 4px 0 24px rgba(16, 24, 40, .12);
}

.offcanvas.open {
  transform: translateX(0);
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 16px 18px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.offcanvas-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.offcanvas-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.offcanvas-close svg {
  width: 16px;
  height: 16px;
}

.offcanvas-nav {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.offcanvas-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas { transition: none; }
  .offcanvas-backdrop { transition: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #view-login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 32px 24px; }
  .sidebar { display: none; }
  .menu-toggle { display: flex; }
  .topbar-left { gap: 10px; display: flex; align-items: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .panels-grid { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}

/* ── CONFIGURACIÓN ──────────────────────────────────────── */
.config-form { display: flex; flex-direction: column; gap: 14px; }
.config-field { display: flex; flex-direction: column; gap: 5px; }
.config-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.config-field input,
.config-field select {
  height: 40px; padding: 0 14px;
  background: white; border: 1.5px solid var(--input-border);
  border-radius: 8px; font-size: 13px; color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.config-field select { cursor: pointer; }
.config-field input:focus,
.config-field select:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,102,178,.1); }
.config-hint { font-size: 10px; color: var(--text-faint); margin-top: -2px; }
.config-error {
  background: #fef3f2; border: 1.5px solid #fecdca;
  border-radius: 8px; padding: 9px 13px;
  font-size: 12px; color: #b42318; font-weight: 500;
}

/* ── CAT-IMG-GRID (Paso 2) ─────────────────────────────────── */
.cat-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.cat-img-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: white;
  transition: border-color .15s;
}

.cat-img-card.has-img { border-color: #86efac; }
.cat-img-card.no-img  { border-color: #fca5a5; }

.cat-img-thumb {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8faff;
  overflow: hidden;
}

.cat-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-img-info {
  padding: 6px 8px;
}

.cat-img-sku {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.cat-img-nombre {
  font-size: 10px;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}

.cat-img-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
}

.cat-img-badge.badge-ok   { background: #dcfce7; color: #166534; }
.cat-img-badge.badge-miss { background: #fee2e2; color: #991b1b; }

/* ── CAROUSEL (Paso 3) ──────────────────────────────────────── */
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-img {
  width: 100%;
  height: 100%;
}

.carousel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: white;
  border: none;
  border-radius: 4px;
  width: 22px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel:hover .carousel-btn { opacity: 1; }
.carousel-prev { left: 4px; }
.carousel-next { right: 4px; }

.carousel-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: background .15s;
}

.carousel-dot.active { background: white; }

/* ── INLINE EDIT ────────────────────────────────────────────── */
.inline-edit-input {
  width: 100%;
  padding: 2px 6px;
  border: 1.5px solid var(--azul);
  border-radius: 4px;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  background: white;
  outline: none;
  box-sizing: border-box;
}

/* ── PUBLISHED BANNER ───────────────────────────────────────── */
.published-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 10px;
  font-size: 13px;
  color: #166534;
  font-weight: 500;
  margin-bottom: 16px;
}

.link-action {
  color: var(--azul);
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

/* ── LIGHTBOX ───────────────────────────────────────────────── */
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  color: white;
  border: none;
  border-radius: 8px;
  width: 44px;
  height: 64px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-prev { left: -54px; }
.lb-next { right: -54px; }

.lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  color: white;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
}

.lb-close:hover { background: rgba(255,255,255,.28); }

.lb-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  white-space: nowrap;
}

/* ── CATÁLOGO VISTA ─────────────────────────────────────────── */
.cat-acciones-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  margin: 12px 0 4px;
}

.cat-sel-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--azul);
}

.cat-oculto {
  opacity: .5;
}

.cat-vis-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  pointer-events: none;
  z-index: 2;
}

.cat-vis-badge.visible {
  background: #dcfce7;
  color: #166534;
}

.cat-vis-badge.oculto {
  background: #f3f4f6;
  color: #6b7280;
}

.cat-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.cat-categoria {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

.btn-danger {
  background: white;
  border: 1px solid #fca5a5;
  color: var(--error);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.btn-danger:hover {
  background: #fff1f0;
}

/* ── IMGS PREVIEW ───────────────────────────────────────────── */
.imgs-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.imgs-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.imgs-preview-card {
  border: 1.5px solid #86efac;
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.imgs-preview-card.sin-producto {
  border-color: #fcd34d;
}

.imgs-preview-thumbs {
  display: flex;
  gap: 2px;
  background: #f8faff;
  padding: 6px;
  flex-wrap: wrap;
}

.imgs-preview-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.imgs-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imgs-preview-sufijo {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  padding: 1px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imgs-preview-info {
  padding: 6px 10px 8px;
}

.imgs-preview-sku {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.imgs-preview-nombre {
  font-size: 11px;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}

.imgs-preview-alerta {
  font-size: 11px;
  color: #b45309;
  margin-top: 2px;
  font-weight: 600;
}

/* ── GALERÍA IMÁGENES — GRID ────────────────────────────────── */
.img-galeria-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.img-gc {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}

.img-gc.has-img   { border-color: #86efac; }
.img-gc.no-img    { border-color: #fca5a5; }
.img-gc.huerfana  { border-color: #fcd34d; }
.img-gc.img-gc-selected { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,102,178,.15); }

.img-gc-check-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-gc-principal {
  height: 140px;
  background: #f8faff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.img-gc-principal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.img-gc.no-img .img-gc-principal { cursor: default; }

.img-gc-strip {
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  background: #f0f4ff;
  overflow-x: auto;
}

.img-gc-strip-thumb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--border);
}

.img-gc-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-gc-info {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border-light);
}

.img-gc-sku {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.img-gc-nombre {
  font-size: 11px;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}

/* ── VISTA AGRUPADA IMÁGENES ────────────────────────────────── */
.img-agrupada-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.img-agrupada-fila {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
}

.img-agrupada-fila.img-gc-selected {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0,102,178,.12);
}

.img-agrupada-fila.has-img  { border-color: #86efac; }
.img-agrupada-fila.no-img   { border-color: #fca5a5; }
.img-agrupada-fila.huerfana { border-color: #fcd34d; }

.img-agrupada-info {
  min-width: 160px;
  flex-shrink: 0;
}

.img-agrupada-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.img-agrupada-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1.5px solid var(--border);
  background: #f8faff;
  flex-shrink: 0;
}

.img-agrupada-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.img-agrupada-thumb:hover { border-color: var(--azul); }

/* ── CARGA DIVIDER ──────────────────────────────────────────── */
.carga-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.carga-divider::before,
.carga-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── VISTA TOGGLE ───────────────────────────────────────────── */
.vista-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.vista-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background: white;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  transition: background .15s, color .15s;
}

.vista-btn:first-child { border-right: 1px solid var(--border); }

.vista-btn.active {
  background: var(--azul);
  color: white;
}

.vista-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

/* ── TABLA LISTA ────────────────────────────────────────────── */
.cat-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cat-tabla th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
}

.cat-tabla td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}

.cat-tabla tbody tr:hover td {
  background: var(--bg-hover);
}

.cat-tabla tbody tr:last-child td {
  border-bottom: none;
}

.cat-fila-oculta td {
  opacity: .5;
}

.editable-cat {
  border-radius: 4px;
  padding: 1px 3px;
  transition: background .1s;
}

.editable-cat:hover {
  background: #f0f4ff;
}

.cat-thumb-mini {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: zoom-in;
}

.cat-thumb-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Aviso de proceso largo en curso ──────────────────────────
   Fijo arriba de todo: subir imágenes o renombrar códigos sigue corriendo
   aunque el admin cambie de pestaña, y sin esto el avance quedaba invisible. */
.proceso-global {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  background: var(--azul);
  color: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.proceso-global-barra {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
}

.proceso-global-progreso {
  height: 100%;
  width: 0;
  background: var(--naranja);
  transition: width 0.2s;
}

.proceso-global-texto {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Grupos de la subida de imágenes ──────────────────────────
   Se separan las que reemplazan una foto existente de las nuevas, para que
   pisar algo sea siempre una decisión consciente. */
.imgs-grupo {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.imgs-grupo-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}

.imgs-grupo-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 2px;
}

.imgs-grupo-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.imgs-grupo-cuenta {
  font-size: 11px;
  color: var(--text-faint);
  margin-right: auto;
}

.imgs-grupo-pisan .imgs-grupo-titulo { color: #b54708; }

.imgs-grupo-aviso {
  padding: 8px 12px;
  background: #fff6ed;
  color: #b54708;
  font-size: 11px;
  border-bottom: 1px solid #fddcab;
}

.imgs-grupo .imgs-preview-grid { padding: 10px; }

/* La tarjeta pasa a ser seleccionable */
.imgs-preview-card { position: relative; cursor: pointer; }

.imgs-preview-card .imgs-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.imgs-preview-card:has(.imgs-check:checked) {
  outline: 2px solid var(--azul);
  outline-offset: -2px;
}

.imgs-preview-destino {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}

/* ── Cambio de códigos de producto ────────────────────────────── */
.renombrar-tabla {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 12px;
}

.renombrar-tabla th {
  text-align: left;
  padding: 6px 10px;
  background: var(--bg-hover);
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.renombrar-tabla td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, monospace;
}

.renombrar-problemas {
  margin-top: 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  overflow: hidden;
}

.renombrar-problemas-titulo {
  padding: 8px 12px;
  background: #fef3f2;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.renombrar-problema {
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid #fecdca;
}

.renombrar-problema code {
  font-family: ui-monospace, monospace;
  color: var(--text);
  margin-right: 6px;
}

.renombrar-resto {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
  padding: 8px !important;
}
