/* ===== ADMIN MAIN ===== */
.admin-main {
  background: #f7f3ef;
  min-height: calc(100vh - 82px);
  padding: 48px 0;
}

.admin-container {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 2rem;
  color: #333;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-subtitle {
  color: #999;
  font-size: 0.9rem;
}

.btn-agregar {
  background: #b87563;
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: Arial, sans-serif;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-agregar:hover {
  background: #a5664f;
}

/* ===== TABLA ===== */
.tabla-productos {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tabla-header {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 90px;
  padding: 16px 28px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #333;
  border-bottom: 1px solid #ede8e3;
}

.col-acciones {
  text-align: right;
}

/* ===== FILAS ===== */
.product-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 90px;
  padding: 18px 28px;
  align-items: center;
  border-bottom: 1px solid #f2ede8;
  transition: background 0.15s;
}

.product-row:last-child {
  border-bottom: none;
}

.product-row:hover {
  background: #fdf9f6;
}

.product-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-img-box {
  width: 48px;
  height: 48px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #faf7f4;
}

.product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-box svg {
  color: #bbb;
}

.product-name {
  font-size: 0.93rem;
  color: #333;
}

.product-category {
  color: #777;
  font-size: 0.9rem;
}

.product-price {
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
}

.product-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.btn-edit,
.btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.btn-edit { color: #b87563; }
.btn-delete { color: #d94f4f; }

.btn-edit:hover,
.btn-delete:hover {
  opacity: 0.65;
}

/* ===== ESTADO VACÍO ===== */
.empty-state {
  padding: 48px;
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 14px;
  padding: 36px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.25rem;
  color: #333;
  font-weight: 700;
}

.btn-cerrar {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #bbb;
  line-height: 1;
  padding: 0;
  font-family: Arial, sans-serif;
}

.btn-cerrar:hover {
  color: #555;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0dbd5;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #b87563;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-guardar {
  width: 100%;
  padding: 13px;
  background: #b87563;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s;
}

.btn-guardar:hover {
  background: #a5664f;
}

.btn-guardar:disabled {
  background: #c9a99a;
  cursor: not-allowed;
}

/* ===== CATEGORÍA CON BOTÓN + ===== */
.categoria-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.categoria-row select {
  flex: 1;
}

.btn-nueva-cat {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid #b87563;
  background: white;
  color: #b87563;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: Arial, sans-serif;
}

.btn-nueva-cat:hover {
  background: #b87563;
  color: white;
}

.nueva-cat-form {
  display: none;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.nueva-cat-form.visible {
  display: flex;
}

.nueva-cat-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #e0dbd5;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: 'Poppins', Arial, sans-serif;
  color: #333;
  box-sizing: border-box;
}

.nueva-cat-form input:focus {
  outline: none;
  border-color: #b87563;
}

.btn-guardar-cat {
  padding: 8px 14px;
  background: #b87563;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.83rem;
  font-family: 'Poppins', Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-guardar-cat:hover { background: #a5664f; }

.btn-cancelar-cat {
  padding: 8px 10px;
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-cancelar-cat:hover {
  border-color: #d94f4f;
  color: #d94f4f;
}

.btn-gestionar-cats {
  background: none;
  border: none;
  color: #b87563;
  font-size: 0.82rem;
  font-family: 'Poppins', Arial, sans-serif;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  text-decoration: underline;
  display: block;
}

.lista-categorias {
  margin-top: 8px;
  border: 1.5px solid #e0dbd5;
  border-radius: 8px;
  overflow: hidden;
  max-height: 180px;
  overflow-y: auto;
}

.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: #333;
  border-bottom: 1px solid #f2ede8;
}

.cat-item:last-child { border-bottom: none; }

.cat-item:hover { background: #fdf9f6; }

.btn-eliminar-cat {
  background: none;
  border: none;
  cursor: pointer;
  color: #d94f4f;
  padding: 2px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-eliminar-cat:hover { opacity: 1; }

.cats-vacio {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  padding: 12px;
  margin: 0;
}

/* ===== MODAL CONFIRMACIÓN ===== */
.modal-confirm-box {
  max-width: 360px;
  padding: 2rem;
  text-align: center;
}

.confirm-mensaje {
  font-size: 1rem;
  color: #333;
  font-family: 'Poppins', Arial, sans-serif;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-acciones {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-confirm-cancelar {
  padding: 10px 24px;
  border-radius: 8px;
  border: 1.5px solid #d9d0c8;
  background: white;
  color: #555;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-confirm-cancelar:hover {
  border-color: #b87563;
  color: #b87563;
}

.btn-confirm-aceptar {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: #d94f4f;
  color: white;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirm-aceptar:hover {
  background: #b93c3c;
}

/* ===== GRILLA IMÁGENES MÚLTIPLES ===== */
.imagenes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.img-slot {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.img-slot.empty {
  border: 2px dashed #d9d0c8;
  background: #fdfaf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.2s;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.78rem;
  color: #aaa;
}

.img-slot.empty:hover { border-color: #b87563; color: #b87563; }

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

.img-slot-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.img-slot-remove:hover { background: #d94f4f; }

.img-principal {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: rgba(184,117,99,0.85);
  color: white;
  font-size: 0.68rem;
  font-family: 'Poppins', Arial, sans-serif;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Título de imagen en el slot */
.img-titulo-input {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.52);
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  font-family: 'Poppins', Arial, sans-serif;
  outline: none;
  border-radius: 0 0 8px 8px;
  width: 100%;
  box-sizing: border-box;
}
.img-titulo-input::placeholder { color: rgba(255,255,255,0.5); }

/* ===== UPLOAD IMAGEN ===== */
.upload-area {
  border: 2px dashed #d9d0c8;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  background: #fdfaf8;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area:hover {
  border-color: #b87563;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1.5rem;
  color: #aaa;
  font-family: 'Poppins', Arial, sans-serif;
}

.upload-placeholder span {
  font-size: 0.88rem;
  color: #777;
  font-weight: 500;
}

.upload-placeholder small {
  font-size: 0.78rem;
  color: #bbb;
}

#imagenPreview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.upload-status {
  font-size: 0.8rem;
  margin-top: 5px;
  min-height: 1rem;
  font-family: 'Poppins', Arial, sans-serif;
}

/* ===== SELECT CATEGORÍA ===== */
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0dbd5;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Poppins', Arial, sans-serif;
  color: #333;
  box-sizing: border-box;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group select:focus {
  outline: none;
  border-color: #b87563;
}

/* ===== HEADER ACTIONS ===== */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usuario-nombre {
  font-size: 0.88rem;
  color: #888;
  font-family: 'Poppins', Arial, sans-serif;
}

.btn-logout {
  background: transparent;
  border: 1.5px solid #b87563;
  color: #b87563;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-logout:hover {
  background: #b87563;
  color: white;
}

/* ===== PRODUCTO INACTIVO ===== */
.product-row.inactivo {
  opacity: 0.55;
}

.badge-inactivo {
  font-size: 0.75rem;
  color: #aaa;
  font-style: italic;
  margin-left: 6px;
}

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(247, 243, 239, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-logo img {
  width: 120px;
}

.login-card h2 {
  text-align: center;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
}

.login-error {
  color: #c0392b;
  font-size: 0.83rem;
  text-align: center;
  min-height: 1.2rem;
  margin-bottom: 0.25rem;
  font-family: 'Poppins', Arial, sans-serif;
}

/* ===== VARIANTES ===== */
.variantes-tabla {
  border: 1.5px solid #e0dbd5;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.variantes-header {
  display: grid;
  gap: 6px;
  padding: 9px 12px;
  background: #f5f0ec;
  font-size: 0.73rem;
  font-weight: 600;
  color: #8b6e63;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'Poppins', Arial, sans-serif;
}

.variantes-header-3 {
  grid-template-columns: 1.8fr 100px 80px 36px;
}

.variantes-header-4 {
  grid-template-columns: 1.4fr 1.2fr 90px 70px 36px;
}

.variante-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 90px 70px 36px;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #f0e8e3;
  align-items: center;
}

.variante-row input {
  border: 1px solid #e0d5cf;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.83rem;
  font-family: 'Poppins', Arial, sans-serif;
  color: #3a2e2a;
  background: white;
  width: 100%;
}

.variante-row input:focus {
  outline: none;
  border-color: #b87563;
  box-shadow: 0 0 0 2px rgba(184,117,99,0.12);
}

.btn-del-variante {
  background: none;
  border: 1px solid #e8b4b4;
  border-radius: 6px;
  color: #d94f4f;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  width: 32px;
  height: 32px;
}

.btn-del-variante:hover {
  background: #fdf0f0;
}

.variantes-empty {
  padding: 16px 12px;
  text-align: center;
  color: #c0b0a8;
  font-size: 0.83rem;
  font-family: 'Poppins', Arial, sans-serif;
}

.btn-add-variante {
  background: none;
  border: 1.5px dashed #c9a89f;
  border-radius: 8px;
  color: #b87563;
  font-size: 0.85rem;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 500;
  padding: 9px 16px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 2px;
}

.btn-add-variante:hover {
  background: #fdf7f5;
  border-color: #b87563;
}

/* ===== COLORES CHIPS ===== */
.colores-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
  min-height: 10px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0e8e4;
  border: 1.5px solid #d4bfb8;
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 0.82rem;
  color: #5c4a42;
  font-family: 'Poppins', Arial, sans-serif;
}

.chip-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #b87563;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}

.chip-del:hover { color: #d94f4f; }

.color-input-row {
  display: flex;
  gap: 8px;
}

.input-nuevo-color {
  flex: 1;
  border: 1px solid #e0d5cf;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: 'Poppins', Arial, sans-serif;
  color: #3a2e2a;
}

.input-nuevo-color:focus {
  outline: none;
  border-color: #b87563;
  box-shadow: 0 0 0 2px rgba(184,117,99,0.12);
}

.btn-add-color {
  background: #b87563;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-add-color:hover { background: #a5664f; }

/* ===== BOTÓN MARCAR VENDIDO ===== */
.btn-venta {
  background: none;
  border: 1.5px solid #a8d5a2;
  border-radius: 8px;
  color: #2e7d32;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.btn-venta:hover {
  background: #f0faf0;
  border-color: #2e7d32;
}

/* ===== MODAL VENTA ===== */
.venta-producto-nombre {
  font-size: 1rem;
  font-weight: 600;
  color: #5c4a42;
  font-family: 'Poppins', Arial, sans-serif;
  margin: -8px 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0e8e3;
}

.required-star { color: #d94f4f; }

.variantes-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-variante-admin {
  border: 1.5px solid #d4c5be;
  border-radius: 8px;
  background: white;
  color: #5c4a42;
  font-size: 0.82rem;
  font-family: 'Poppins', Arial, sans-serif;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-variante-admin:hover {
  border-color: #b87563;
  color: #b87563;
}

.btn-variante-admin.activo {
  background: #b87563;
  border-color: #b87563;
  color: white;
}

.btn-variante-admin.sin-stock,
.btn-variante-admin:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #e0d8d3;
  color: #b0a098;
  background: #f8f5f3;
  text-decoration: line-through;
}

.btn-variante-admin.sin-stock:hover,
.btn-variante-admin:disabled:hover {
  border-color: #e0d8d3;
  color: #b0a098;
}

/* ===== ELIMINAR PERMANENTE ===== */
.btn-delete-hard {
  background: none;
  border: 1.5px solid #e8c4c4;
  border-radius: 8px;
  color: #d94f4f;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.btn-delete-hard:hover {
  background: #fdf0f0;
  border-color: #d94f4f;
}

/* ===== PÁGINA VENTAS ===== */

/* Nav activo */
.nav-active {
  color: #b87563 !important;
  font-weight: 600;
}

/* Filtros */
.ventas-filtros {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: white;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filtro-grupo label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filtro-grupo input[type="date"] {
  border: 1.5px solid #e8e0da;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}

.filtro-grupo input[type="date"]:focus {
  border-color: #b87563;
}

.btn-filtrar {
  padding: 9px 22px;
  background: #b87563;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtrar:hover { background: #9e6050; }

.btn-limpiar {
  padding: 9px 18px;
  background: none;
  color: #999;
  border: 1.5px solid #e0d8d2;
  border-radius: 8px;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-limpiar:hover { border-color: #b87563; color: #b87563; }

/* Resumen cards */
.resumen-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.resumen-card {
  background: white;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resumen-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resumen-valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

/* Tabla ventas */
.tabla-ventas-wrap {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.tabla-ventas-header {
  display: grid;
  grid-template-columns: 120px 1fr 90px 90px 110px 60px 110px 1fr;
  gap: 0;
  background: #f7f2ee;
  padding: 12px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f0ebe6;
}

.venta-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px 90px 110px 60px 110px 1fr;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f7f4f1;
  font-size: 0.88rem;
  color: #444;
  transition: background 0.15s;
}

.venta-row:hover { background: #fdf9f6; }

.venta-row:last-child { border-bottom: none; }

.venta-fecha {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.85rem;
  color: #555;
}

.venta-fecha small {
  color: #bbb;
  font-size: 0.76rem;
}

.venta-producto {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: #333;
}

.venta-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #f0ebe6;
  flex-shrink: 0;
}

.venta-img-placeholder {
  width: 36px;
  height: 36px;
  background: #f0ebe6;
  border-radius: 6px;
  flex-shrink: 0;
}

.venta-chip {
  background: #f7f2ee;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.82rem;
  color: #666;
  width: fit-content;
}

.venta-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 8px;
}

.venta-cant {
  text-align: center;
  padding-right: 0;
}

.venta-total {
  font-weight: 700;
  color: #2e7d32;
}

.venta-notas {
  color: #aaa;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 8px;
}

.venta-row-total {
  background: #f7f2ee;
  font-weight: 700;
}

.venta-row-total:hover { background: #f7f2ee; }

.loading-ventas {
  padding: 40px;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .resumen-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .tabla-ventas-header,
  .venta-row {
    grid-template-columns: 100px 1fr 70px 70px 90px 45px 90px;
  }
  .tabla-ventas-header span:last-child,
  .venta-row .venta-notas { display: none; }
}
