* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Helvetica Neue', Arial, sans-serif; }
body { background: #FDFBF7; color: #333; }

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 380px;
  background: white;
  border: 1px solid #e2e4e8;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.login-logo { text-align: center; font-size: 30px; margin-bottom: 6px; }
.login-brand { text-align: center; font-size: 20px; font-weight: 800; color: #22301F; margin-bottom: 4px; }
.login-heading { text-align: center; font-size: 14px; color: #888; margin-bottom: 26px; }
.field-label { font-size: 13px; color: #555; margin-bottom: 6px; font-weight: 600; display:block; }
.field-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #dcdfe4;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 16px;
}
.btn-primary {
  width: 100%;
  background: #22301F;
  color: white;
  text-align: center;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.btn-primary:hover { background: #2E4029; }
.error-box {
  background: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5c2c0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.login-badge { text-align: center; font-size: 11.5px; color: #aaa; margin-top: 20px; padding-top: 14px; border-top: 1px solid #f0f0f0; }

/* ---- app shell ---- */
.topbar {
  background: #22301F;
  color: white;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .hola { font-size: 18px; font-weight: 700; }
.topbar .sub { font-size: 13px; color: #cfd0e0; margin-top: 2px; }
.topbar a { color: #cfd0e0; font-size: 13px; text-decoration: none; }
.topbar a:hover { color: white; }

.page-wrap { max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }

.banner {
  background: #FFF7EC;
  border: 2px solid #FFE1B3;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14.5px;
  color: #444;
}

/* ---- catalogo table ---- */
.catalog-frame {
  background: white;
  border: 1px solid #e2e4e8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
table.catalog { width: 100%; border-collapse: collapse; }
table.catalog th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #888;
  background: #f7f8fa;
  padding: 12px 20px;
  border-bottom: 2px solid #eee;
}
table.catalog td {
  padding: 12px 20px;
  font-size: 14.5px;
  border-bottom: 1px solid #f1f1f1;
  vertical-align: middle;
}
.prod-name { font-weight: 700; color: #22301F; }
.prod-sub { font-size: 12px; color: #999; }

.price-field {
  width: 110px;
  padding: 7px 9px;
  border: 1.5px solid #dcdfe4;
  border-radius: 6px;
  font-weight: 700;
  color: #22301F;
  font-size: 14px;
}
.price-field.saved { border-color: #4CAF50; background: #f3fbf3; }
.price-field.saving { border-color: #FF7A00; }
.price-field.error { border-color: #d9534f; background: #fdecea; }
.price-field.advertencia { border-color: #b8860b; background: #fff8e6; }
.mult-field { width: 80px; }

.status-tag { font-size: 11px; font-weight: 700; margin-left: 8px; }
.status-tag.saved { color: #4CAF50; }
.status-tag.saving { color: #FF7A00; }
.status-tag.error { color: #d9534f; }
.status-tag.advertencia { color: #b8860b; }

.toggle {
  width: 42px; height: 24px;
  border-radius: 20px;
  position: relative;
  display: inline-block;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle.on { background: #23B561; }   /* verde de marca Morapp */
.toggle.off { background: #ccc; }
.toggle .knob {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 3px;
  transition: left 0.15s, right 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on .knob { right: 3px; }
.toggle.off .knob { left: 3px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-bar { flex: 1; min-width: 240px; }
.search-bar input {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  border: 1.5px solid #dcdfe4;
  border-radius: 8px;
  font-size: 14px;
}
.filtro-estado {
  display: flex;
  gap: 6px;
  background: #FDFBF7;
  padding: 4px;
  border-radius: 8px;
}
.filtro-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}
.filtro-btn.activo {
  background: white;
  color: #22301F;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ---- confirmar precios ---- */
.confirm-card {
  background: white;
  border: 1px solid #e2e4e8;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.confirm-card.done { opacity: 0.5; }
.confirm-card .info .name { font-weight: 700; color: #22301F; font-size: 15px; }
.confirm-card .info .meta { font-size: 12.5px; color: #999; margin-top: 2px; }
.confirm-card .action { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.confirm-card .estimado { font-size: 12px; color: #888; }
.btn-confirm {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.progress-bar-wrap { background: #eee; border-radius: 20px; height: 10px; overflow: hidden; margin: 14px 0 26px; }
.progress-bar-fill { background: #4CAF50; height: 100%; transition: width 0.2s; }

/* ---- confirmar precios: 3 estados (disponible / sin stock / no lo trabajo) ---- */
.btn-no-trabajo, .btn-sin-stock {
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-no-trabajo { background: #eee; color: #666; }
.btn-no-trabajo:hover { background: #e2e2e2; }
.btn-sin-stock { background: #FFF3E0; color: #B8860B; border: 1px solid #f0d38a; }
.btn-sin-stock:hover { background: #FCE8C6; }
.confirm-card .action button:disabled { opacity: 0.55; cursor: default; }

/* ---- catálogo: producto archivado ("no lo trabajo") ---- */
.badge-no-trabajado {
  display: inline-block;
  background: #eee;
  color: #777;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-link-small {
  color: #888;
  font-size: 11.5px;
  text-decoration: underline;
}
.btn-link-small:hover { color: #22301F; }
.fila-no-trabajado { opacity: 0.6; }
.fila-no-trabajado .prod-name { color: #888; }

.sin-resultados {
  display: none;
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 40px 20px;
}

/* ---- admin ---- */
.btn-link {
  color: #22301F;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

.badge-alerta {
  display: inline-block;
  background: #fff3d6;
  color: #9a6a00;
  border: 1px solid #f0d38a;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-revisar {
  margin-left: 8px;
  background: none;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}
.btn-revisar:hover { background: #f7f8fa; }
.precio-real-admin { font-weight: 700; color: #22301F; }

.badge-bloqueo {
  display: inline-block;
  background: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5c2c0;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-frame-admin table.catalog { min-width: 900px; }

/* ---- import/export de Excel (formato Rappi) ---- */
.flash-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.flash-ok { background: #e8f5e9; color: #256029; border: 1px solid #b7dfb9; }
.flash-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c2c0; }

.import-export-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.import-form, .export-bar {
  background: #f7f8fa;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 280px;
}
.import-label { display: flex; flex-direction: column; gap: 1px; font-size: 13px; font-weight: 700; color: #22301F; }
.export-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #555; white-space: nowrap; }
.export-bar { margin-bottom: 16px; }

/* ---- responsive: proveedores chicos suelen entrar desde el celular ---- */
@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
  }
  .page-wrap { padding: 18px 12px 50px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-bar { min-width: 0; }
  .search-bar input { max-width: none; }
  .filtro-estado { justify-content: space-between; }
  .filtro-btn { flex: 1; padding: 8px 6px; font-size: 12px; }

  /* la tabla no se aplasta: se puede deslizar horizontalmente en vez de
     volverse ilegible en una pantalla angosta */
  .catalog-frame { overflow-x: auto; }
  table.catalog { min-width: 620px; }
  .catalog-frame-admin table.catalog { min-width: 820px; }

  .confirm-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .confirm-card .action { justify-content: space-between; }
  .confirm-card .action .price-field { flex: 1 1 100%; order: -1; }
  .confirm-card .action button { flex: 1; }

  .login-card { width: 100%; padding: 32px 22px; }

  /* inputs a 16px+ para que Safari/iOS no haga zoom automático al enfocar
     un campo -- con 14px el navegador "acerca" la pantalla solo, que en un
     formulario de precios usado todo el día es muy molesto */
  .price-field, .field-input, .search-bar input, .mult-field {
    font-size: 16px;
  }

  /* la barra de buscador/filtro queda pegada arriba al hacer scroll en una
     lista larga (233 productos) -- evita tener que volver arriba cada vez
     que se quiere buscar o cambiar de filtro */
  .toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #FDFBF7;
    padding: 10px 0 12px;
    margin-bottom: 6px;
  }

  /* el toggle de disponibilidad es chico para el dedo -- se agranda el
     área tocable sin agrandar tanto el dibujo */
  .toggle { width: 50px; height: 30px; }
  .toggle .knob { width: 22px; height: 22px; top: 4px; }

  .import-export-bar { flex-direction: column; }
  .import-form, .export-bar { flex-direction: column; align-items: stretch; }
  .toggle.on .knob { right: 4px; }
  .toggle.off .knob { left: 4px; }
  table.catalog td { padding: 14px 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   Catálogo en celular: tarjetas en vez de tabla
   ───────────────────────────────────────────────────────────────
   Antes la tabla hacía scroll horizontal, y las dos columnas que el
   proveedor viene a tocar —precio y disponibilidad— quedaban fuera
   de la pantalla. Había que arrastrar de costado para hacer lo único
   que importa. Como la mayoría entra desde el teléfono, en pantallas
   angostas cada fila pasa a ser una tarjeta con todo a la vista.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .catalog-frame { overflow-x: visible; border: 0; background: transparent; padding: 0; }

  /* El min-width de 620px de la regla anterior es lo que forzaba el
     scroll horizontal. Acá ya no hay tabla, así que se anula. */
  table.catalog { min-width: 0 !important; }
  table.catalog, table.catalog tbody { display: block; width: 100%; }
  table.catalog thead { display: none; }

  table.catalog tr.fila-producto {
    display: block;
    background: #fff;
    border: 1px solid #e3e7de;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(34,48,31,.05);
  }

  table.catalog td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    padding: 7px 0;
  }

  /* El nombre encabeza la tarjeta, sin rótulo: se entiende solo. */
  table.catalog td.prod-name {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 0 0 8px;
    border-bottom: 1px solid #f0f2ee;
    margin-bottom: 6px;
  }

  table.catalog td[data-rotulo]:not(.prod-name)::before {
    content: attr(data-rotulo);
    color: #5f6b5c;
    font-size: .85rem;
    font-weight: 600;
    flex: none;
  }

  /* Campo de precio grande y cómodo de tocar. 16px evita que iOS
     haga zoom automático al enfocar el campo. */
  table.catalog td .price-field {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    width: 130px;
    padding: 11px 12px;
  }

  /* El toggle y "No lo trabajo" en la misma línea, alineados a la derecha. */
  table.catalog td[data-rotulo="¿Tenés stock?"] > div {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  table.catalog td[data-rotulo="¿Tenés stock?"] br { display: none; }
  table.catalog td[data-rotulo="¿Tenés stock?"] .toggle {
    width: 54px; height: 32px;
  }
  table.catalog td[data-rotulo="¿Tenés stock?"] .toggle .knob {
    width: 26px; height: 26px;
  }
  table.catalog td[data-rotulo="¿Tenés stock?"] .toggle.on .knob {
    transform: translateX(22px);
  }

  table.catalog tr.fila-no-trabajado { opacity: .6; }

  /* La barra de búsqueda y los filtros quedan pegados arriba al
     scrollear una lista de 233 productos. */
  .toolbar {
    position: sticky; top: 0; z-index: 20;
    background: #F2F5EF; padding: 10px 0; margin: 0 0 10px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Fotos de producto
   Alto y ancho fijos y `object-fit: contain` para que la tabla no
   salte mientras cargan (las imágenes llegan de a poco por lazy-load
   y sin medidas fijas el catálogo "baila" mientras el proveedor lee).
   ═══════════════════════════════════════════════════════════════════ */
.th-foto { width: 64px; }
.foto-cel { width: 64px; }
.foto-prod {
  width: 52px; height: 52px; object-fit: contain;
  border-radius: 6px; background: #f4f4f2; display: block;
}
.foto-mini {
  width: 38px; height: 38px; object-fit: contain;
  border-radius: 5px; background: #fff; flex: 0 0 auto;
}
.foto-conf {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 6px; background: #f4f4f2; margin-right: 12px; flex: 0 0 auto;
}
.foto-vacia {
  font-size: 10px; color: #aaa; display: inline-flex;
  align-items: center; justify-content: center; text-align: center;
}

/* ═══ Recordatorio de productos apagados hace mucho ═══ */
.recordatorio {
  background: #fff8e6; border: 1px solid #f0d999; border-left: 4px solid #e0a800;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 16px;
}
.recordatorio-titulo { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.recordatorio-sub { font-size: 13px; color: #6b6b5f; margin: 0 0 10px; }
.recordatorio-lista { display: flex; flex-direction: column; gap: 6px; }
.recordatorio-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #eee3c8; border-radius: 6px; padding: 6px 10px;
}
.recordatorio-nombre { flex: 1 1 200px; font-size: 14px; }
.recordatorio-dias { color: #a08040; font-size: 12px; display: block; }
.btn-mini {
  font-size: 12px; padding: 5px 10px; border-radius: 5px;
  border: 1px solid #ccc; background: #fff; cursor: pointer;
}
.btn-mini-si { background: #2f6f4f; color: #fff; border-color: #2f6f4f; }

/* ═══ Solicitudes de artículo nuevo ═══ */
.form-articulo {
  background: #fff; border: 1px solid #e4e4de; border-radius: 8px;
  padding: 18px; max-width: 560px; margin-bottom: 20px;
}
.campo { display: block; margin-bottom: 14px; }
.campo-rotulo { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.campo input[type=text], .campo input[type=number], .campo textarea {
  width: 100%; box-sizing: border-box; padding: 9px 10px;
  border: 1px solid #ccc; border-radius: 6px; font-size: 15px; font-family: inherit;
}
.campo-ayuda { display: block; font-size: 12px; color: #888; margin-top: 4px; }
.btn-ancho { width: 100%; padding: 12px; font-size: 15px; }

.solicitud {
  display: flex; gap: 16px; background: #fff; border: 1px solid #e4e4de;
  border-radius: 8px; padding: 14px; margin-bottom: 12px;
}
.solicitud-foto { flex: 0 0 110px; }
.solicitud-foto img {
  width: 110px; height: 110px; object-fit: contain;
  border-radius: 6px; background: #f4f4f2;
}
.solicitud-datos { flex: 1 1 auto; min-width: 0; }
.solicitud-nombre { font-size: 16px; font-weight: 600; }
.solicitud-desc { font-size: 13px; color: #555; margin: 6px 0; }
.solicitud-form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px;
}
.solicitud-form label { font-size: 12px; color: #666; }
.solicitud-form input[type=text], .solicitud-form input[type=number] {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px;
}
.estado-pendiente { color: #a07800; font-weight: 600; }
.estado-aprobado  { color: #2f6f4f; font-weight: 600; }
.estado-rechazado { color: #b04a3f; font-weight: 600; }
.propuestas-caja {
  background: #fff; border: 1px solid #e4e4de; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 14px;
}
.propuestas-titulo { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.propuesta-linea { font-size: 13px; padding: 3px 0; }
.propuesta-motivo { color: #888; }

/* ═══ Revisión de sincronización: saltos de precio ═══ */
tr.salto-grande { background: #fdeceb; }
tr.salto-grande td { border-color: #f3c9c5; }
.var-alerta { color: #b04a3f; font-weight: 700; }
td.ref { color: #888; }
.aviso-fuerte {
  background: #fdeceb; border: 1px solid #e9b4ae; border-left: 4px solid #b04a3f;
  border-radius: 6px; padding: 10px 14px; margin: 10px 0; font-size: 14px;
}
.pill {
  display: inline-block; background: #b04a3f; color: #fff; border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.badge-apagado { color: #a07800; font-weight: 600; }
