/* ── Design tokens (from wireframe palette) ── */
:root {
  --ink:         #1f1d1a;
  --ink-soft:    #4a463f;
  --ink-mute:    #8c867c;
  --paper:       #faf7f1;
  --paper-2:     #f3eee3;
  --line:        #2a2724;
  --border:      #d4cec4;
  /* Azul de DYG Ecommerce Store (paleta de la plataforma), tomado de logo-dyg.png
     con sharp — no a ojo, ver views/login.ejs para el detalle del muestreo. */
  --accent:      #0470C7;
  --accent-soft: #CDE2F4;
  /* Antes vivía en --accent/--accent-soft: el rojo original se separa acá
     porque --accent también lo usaban .alert-error/.toast-error/.btn-danger/
     .badge-accent/.required — cambiar --accent a azul sin este split habría
     puesto en azul los mensajes de error y "Sin stock"/"Inactiva", que deben
     seguir leyéndose como negativos. */
  --danger:      #d23a2c;
  --danger-soft: #f4cfca;
  --ok:          #2e7d4f;
  --ok-bg:       #dcecde;
  --warn:        #c97a16;
  --warn-bg:     #f4e1c2;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: 'Inter', Arial, sans-serif;
  min-height: 100vh;
}

/* ───────────────── NAV ───────────────── */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.nav-links { display: flex; gap: 28px; align-items: center; }

.nav-link {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 2px;
  position: relative;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--ink); }

.nav-active { color: var(--accent); }

.nav-active::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: -6px;
  height: 4px;
  background: var(--accent);
  border-radius: 4px;
  transform: rotate(-0.6deg);
}

/* ───────────────── LAYOUT ───────────────── */
.main-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px;
}

/* ───────────────── TYPOGRAPHY ───────────────── */
.page-title {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 36px;
  margin: 0;
  color: var(--ink);
  line-height: 1.05;
}

.page-sub {
  font-family: 'Inter', Arial, sans-serif;
  color: var(--ink-soft);
  font-size: 16px;
  margin: 4px 0 0 0;
}

.page-header { margin-bottom: 4px; }

/* ───────────────── ALERTS ───────────────── */
.alert {
  padding: 11px 16px;
  border-radius: 8px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14px;
}

.alert-success {
  background: var(--ok-bg);
  border: 1.5px solid var(--ok);
  color: var(--ok);
}

.alert-error {
  background: var(--danger-soft);
  border: 1.5px solid var(--danger);
  color: var(--danger);
}

/* ───────────────── FORM CONTAINER ───────────────── */
.form-container {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.registro-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ───────────────── FIELD ROWS ───────────────── */
.field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
}

.required { color: var(--danger); }

.field-input {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px 12px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  height: 40px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a463f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.field-hint { font-size: 11px; color: var(--ink-mute); }

/* ───────────────── INPUT WITH PREFIX ───────────────── */
.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.with-prefix { padding-left: 24px; }

/* ───────────────── GRIDS ───────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ───────────────── UPLOAD ZONE ───────────────── */
.upload-zone {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 20px;
  cursor: pointer;
  position: relative;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-mute);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 17px;
  text-align: center;
}

.paw-placeholder { font-size: 34px; opacity: 0.45; }
.upload-link { color: var(--accent); text-decoration: underline; }

.upload-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.upload-preview { display: none; align-items: center; gap: 16px; }

.upload-thumb {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}

.upload-filename {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  word-break: break-all;
  max-width: 260px;
}

/* ───────────────── BUTTONS ───────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--line);
}

.btn-ghost { background: transparent; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ───────────────── FORM ACTIONS ───────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ───────────────── INVENTARIO ───────────────── */
.inventario-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inventario-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ───────────────── FILTER BAR ───────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--paper);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
}

.filter-select {
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 5px 28px 5px 10px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  height: 34px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a463f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}

.filter-select:focus { border-color: var(--accent); outline: none; }

/* ── RF-07.2: facetas multi-selección del catálogo ── */
.faceta { position: relative; }

.faceta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 5px 28px 5px 10px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a463f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.faceta-toggle:hover { border-color: var(--accent); }

/* Un criterio con valores elegidos se distingue de un vistazo. */
.faceta-activa { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* `display` explícito le gana al display:none que el atributo `hidden` trae de
   la hoja del navegador, así que hay que reponerlo o el badge queda visible
   vacío cuando el criterio no tiene valores elegidos. */
.faceta-cuenta[hidden],
.filtros-activos[hidden] { display: none; }

.faceta-cuenta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.faceta-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 190px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--line);
}

.faceta-opcion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.faceta-opcion:hover      { background: var(--paper-2); }
.faceta-opcion-label      { flex: 1; }
.faceta-opcion-n          { color: var(--ink-mute); font-size: 11px; }

/* Sin resultados con los filtros actuales: se atenúa pero no se esconde, para
   que el comprador vea que la opción existe y no crea que falta. */
.faceta-opcion-vacia      { opacity: 0.4; }

.filtros-activos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: -6px 0 16px;
}

.chip-activo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip-activo span       { font-size: 11px; opacity: 0.75; }
.chip-activo:hover      { background: var(--accent); color: #fff; }
.chip-activo:hover span { opacity: 1; }

.chip-limpiar {
  border: none;
  background: none;
  color: var(--ink-mute);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.chip-limpiar:hover { color: var(--ink); }

.filter-promo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
}

.filter-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 0 10px;
  height: 34px;
  transition: border-color 0.15s;
}

.filter-search-wrap:focus-within { border-color: var(--accent); }

.filter-input {
  border: none;
  background: transparent;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  outline: none;
  width: 140px;
}

/* ───────────────── PRODUCT LIST ───────────────── */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ───────────────── ROW CARD ───────────────── */
.row-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--line);
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 180px minmax(340px, 380px);
  gap: 18px;
  padding: 14px;
  align-items: center;
}

/* ───────────────── THUMBNAIL ───────────────── */
.row-thumb { width: 80px; height: 80px; flex-shrink: 0; }

.thumb-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}

.thumb-placeholder {
  width: 80px; height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, var(--paper) 0 6px, var(--paper-2) 6px 12px);
  color: var(--ink-mute);
}

/* ───────────────── ROW INFO ───────────────── */
.row-info { display: flex; flex-direction: column; gap: 6px; }

.row-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.product-code {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.row-details {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.color-detail { display: inline-flex; align-items: center; gap: 6px; }

.color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.2px solid var(--line);
  display: inline-block;
  background: var(--ink-mute);
  flex-shrink: 0;
}

.row-prices {
  font-size: 12px;
  color: var(--ink-mute);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row-prices strong { color: var(--ink-soft); }

/* ───────────────── ROW STOCK ───────────────── */
.row-stock {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.stock-of {
  font-size: 11px;
  color: var(--ink-mute);
}

/* ───────────────── ROW SELL ───────────────── */
.row-sell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.sell-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.sell-row-venta { justify-content: space-between; }

.sell-doc-tipo {
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 0 4px;
  font-size: 12px;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--ink);
  outline: none;
  flex-shrink: 0;
}

.sell-doc-num {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 4px 8px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}

.sell-doc-tipo:focus, .sell-doc-num:focus { border-color: var(--accent); }

.sell-phone, .sell-nombre {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 4px 8px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.sell-phone:focus, .sell-nombre:focus { border-color: var(--accent); }

.sell-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sell-label {
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.sell-qty {
  width: 44px; height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.sell-price {
  width: 78px; height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 4px 6px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.sell-qty:focus, .sell-price:focus { border-color: var(--accent); }

.sell-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ───────────────── BADGES ───────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1.2px solid var(--line);
  border-radius: 999px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  background: var(--paper);
  line-height: 1.3;
  white-space: nowrap;
}

.badge-fill   { background: var(--line);        color: var(--paper); }
.badge-accent { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.badge-ok     { background: var(--ok-bg);       border-color: var(--ok);     color: var(--ok); }
.badge-warn   { background: var(--warn-bg);     border-color: var(--warn);   color: var(--warn); }

/* ───────────────── EMPTY STATE ───────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--ink-mute);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-paw { font-size: 52px; margin-bottom: 12px; }

/* ───────────────── TOAST ───────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 320px;
  box-shadow: 2px 3px 12px rgba(0,0,0,0.14);
}

.toast-success { background: var(--ok-bg);       border: 1.5px solid var(--ok);     color: var(--ok); }
.toast-error   { background: var(--danger-soft); border: 1.5px solid var(--danger); color: var(--danger); }
.toast-show    { opacity: 1; transform: translateY(0); }

/* ───────────────── RESPONSIVE ───────────────── */
@media (max-width: 960px) {
  .row-card {
    grid-template-columns: 80px 1fr 160px;
    grid-template-rows: auto auto;
  }
  .row-sell { grid-column: 1 / -1; }
  .grid-3   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-content  { padding: 16px; }
  .main-nav      { padding: 12px 16px; }
  .grid-2,
  .grid-3        { grid-template-columns: 1fr; }
  .row-card      { grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; }
  .row-stock     { grid-column: 2; }
  .row-sell      { grid-column: 1 / -1; }
  .filter-bar    { flex-direction: column; align-items: stretch; }
  .filter-select,
  .filter-search-wrap { width: 100%; }
  .filter-input  { width: 100%; }
  /* RF-07.2: en móvil las facetas ocupan el ancho y el menú se ancla al bloque. */
  .faceta        { width: 100%; }
  .faceta-toggle { width: 100%; justify-content: space-between; padding-right: 28px; }
  .faceta-menu   { left: 0; right: 0; min-width: 0; }
}

/* ───────────────── PAGE TOOLBAR ───────────────── */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ───────────────── UTILITIES ───────────────── */
.text-muted { color: var(--ink-mute); font-size: 13px; }

/* Pie de las listas paginadas (RNF-06): contador + "mostrar más" */
.lista-paginacion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 0 4px;
}

/* ───────────────── DANGER BUTTON ───────────────── */
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }

/* ───────────────── PRENDAS GRID ───────────────── */
.prendas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.prenda-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prenda-card-thumb { width: 100%; aspect-ratio: 1; background: var(--paper-2); position: relative; }

/* RF-07.2: cinta de promoción sobre la miniatura. Se superpone al render, no
   se quema en la imagen — la imagen es un objeto único de la organización y la
   promoción es por tienda (RF-04.5), así que quemarla la filtraría a tiendas
   donde la prenda está a precio lleno. */
.promo-ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 10px;
  background: var(--warn);
  color: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--line);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;   /* no debe robarle el clic al lightbox */
}
.prenda-card-thumb .thumb-img     { width: 100%; height: 100%; object-fit: cover; border-radius: 0; border: none; }
.prenda-card-thumb .thumb-placeholder { width: 100%; height: 100%; border-radius: 0; border: none; font-size: 40px; }

.prenda-card-body  { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prenda-card-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.prenda-card-tags  { display: flex; gap: 6px; flex-wrap: wrap; }
.prenda-card-meta  { font-size: 12px; color: var(--ink-mute); display: flex; flex-direction: column; gap: 2px; }
.prenda-card-footer { display: flex; gap: 8px; align-items: center; margin-top: auto; }

.prenda-card-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
}
.prenda-card-actions form { margin: 0; }
.prenda-card-actions .btn { flex: 1; justify-content: center; }

/* ───────────────── EXISTING IMAGES ───────────────── */
.existing-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.existing-thumb {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}

.delete-img-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--danger);
  cursor: pointer;
}

/* ───────────────── MULTI IMAGE PREVIEW ───────────────── */
.upload-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}

/* ───────────────── PEDIDO LAYOUT ───────────────── */
.pedido-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.pedido-catalog { display: flex; flex-direction: column; }

.catalog-list { display: flex; flex-direction: column; gap: 10px; }

.catalog-row {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.catalog-info  { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.catalog-tags  { display: flex; gap: 6px; flex-wrap: wrap; }
.catalog-action { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 120px; }

.add-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ───────────────── CART PANEL ───────────────── */
.cart-panel {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--line);
  padding: 16px;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cart-empty {
  color: var(--ink-mute);
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cart-item-info { display: flex; flex-direction: column; gap: 2px; }
.cart-item-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.btn-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding-top: 6px;
  border-top: 1.5px solid var(--line);
}

/* ───────────────── PEDIDOS LIST ───────────────── */
.pedidos-list { display: flex; flex-direction: column; gap: 12px; }

.pedido-row {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--line);
  overflow: hidden;
}

.pedido-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  gap: 16px;
  flex-wrap: wrap;
}

.pedido-summary:hover { background: var(--paper-2); }

.pedido-id { display: flex; align-items: center; gap: 10px; }
.pedido-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; align-items: center; flex: 1; }
.pedido-toggle { color: var(--ink-mute); font-size: 12px; }

.pedido-detalle { border-top: 1px solid var(--border); }

/* ───────────────── TABLES ───────────────── */
.table-wrapper { overflow-x: auto; }

.detalle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detalle-table th {
  background: var(--paper-2);
  border-bottom: 1.5px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.detalle-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.detalle-table tr:last-child td { border-bottom: none; }
.detalle-table tr:hover td { background: var(--paper-2); }

/* ───────────────── RESUMEN BAR ───────────────── */
.resumen-bar {
  display: flex;
  gap: 24px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

.resumen-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resumen-item strong { font-size: 20px; color: var(--ink); }

/* ───────────────── RESPONSIVE (new pages) ───────────────── */
@media (max-width: 960px) {
  .pedido-layout { grid-template-columns: 1fr; }
  .cart-panel    { position: static; }
}

@media (max-width: 640px) {
  .prendas-grid  { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .catalog-row   { flex-wrap: wrap; }
  .catalog-action { min-width: 0; width: 100%; flex-direction: row; align-items: center; }
  .pedido-meta   { gap: 8px; }
  .nav-links     { gap: 12px; flex-wrap: wrap; }
}

/* ───────────────── BUYER AUTOCOMPLETE ───────────────── */
.sell-autocomplete-wrap { position: relative; }

.sell-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 280px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  z-index: 300;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.sell-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  white-space: nowrap;
}

.sell-dropdown-item:last-child { border-bottom: none; }
.sell-dropdown-item:hover      { background: var(--paper-2); }

.sell-dropdown-new {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ok);
  font-weight: 600;
}

/* ───────────────── DASHBOARD ───────────────── */
.dash-period-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dash-period-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.dash-period-btn:hover { border-color: var(--accent); color: var(--accent); }

.dash-period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dash-period-bar:has(+ .dash-period-custom) { margin-bottom: 10px; }

.dash-period-custom { gap: 12px; align-items: center; }

.dash-period-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--paper);
}

.dash-period-group.active { border-color: var(--accent); }

.dash-period-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.dash-period-group.active .dash-period-label { color: var(--accent); }

.dash-period-group .dash-period-input { width: auto; padding: 4px 8px; font-size: 13px; }

.dash-period-nav {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  padding: 2px 4px;
}

.dash-period-nav:hover { color: var(--accent); }
.dash-period-nav.disabled { opacity: 0.3; }

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dash-kpi-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.15s;
}

.dash-kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

.dash-kpi-card.dash-kpi-ok  { border-color: var(--ok);   background: var(--ok-bg); }
.dash-kpi-card.dash-kpi-warn { border-color: var(--warn); background: var(--warn-bg); }
.dash-kpi-card.dash-kpi-bad  { border-color: var(--danger); background: var(--danger-soft); }

.dash-kpi-icon { font-size: 28px; line-height: 1; flex-shrink: 0; margin-top: 2px; }

.dash-kpi-body { flex: 1; min-width: 0; }

.dash-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.dash-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-sub {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.dash-chart-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}

.dash-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.dash-chart-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 6px;
}

.dash-bars { display: flex; flex-direction: column; gap: 10px; }

.dash-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 52px;
  align-items: center;
  gap: 10px;
}

.dash-bar-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-bar-track {
  height: 10px;
  background: var(--paper-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dash-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.4s ease;
  min-width: 4px;
}

.dash-bar-fill-alt { background: var(--ok); }

.dash-bar-value {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
  font-weight: 600;
}

.dash-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}

.dash-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.dash-suggest-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.dash-suggest-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-suggest-icon { font-size: 24px; flex-shrink: 0; }

.dash-suggest-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.dash-suggest-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}

.dash-suggest-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-suggest-table td {
  padding: 6px 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok);
}

.dash-empty {
  color: var(--ink-mute);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

.dash-empty-sm { padding: 12px 0; font-size: 13px; }

@media (max-width: 1100px) {
  .dash-kpi-grid        { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-grid     { grid-template-columns: 1fr; }
  .dash-suggestions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
}
