body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #f0f0f0;
}

h1 {
    text-align: center;
}

table {
    table-layout: fixed;
    /* fuerza distribución */
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

th,
td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    word-wrap: break-word;
    /* permite cortar palabras largas */
    white-space: normal;
    /* deja que el texto salte de línea */
}

#password,
#email {
    width: 100%;
    padding: 5px;
}

button {
    padding: 8px 12px;
    margin: 5px;
    cursor: pointer;
}

#acciones {
    text-align: center;
    margin-top: 20px;
}

#login-container {
    max-width: 400px;
    height: 400px;
    margin: 100px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#admin-panel {
    display: none;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.precio-anterior {
    text-decoration: line-through;
    color: gray;
}

.precio-actual {
    font-weight: bold;
    color: green;
    font-size: 18px;
}

.etiqueta-descuento {
    background-color: red;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 14px;
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Mantener ancho fijo y columnas equilibradas */
#tabla-productos {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Ajuste de anchos por columna */
#tabla-productos th:nth-child(1),
#tabla-productos td:nth-child(1) {
    width: 170px;
    /* Nombre */
}

#tabla-productos th:nth-child(2),
#tabla-productos td:nth-child(2) {
    width: 70px;
    /* Precio */
}

#tabla-productos th:nth-child(3),
#tabla-productos td:nth-child(3) {
    width: 90px;
    /* Precio anterior */
}

#tabla-productos th:nth-child(4),
#tabla-productos td:nth-child(4) {
    width: 90px;
    /* % Desc. */
}

#tabla-productos th:nth-child(5),
#tabla-productos td:nth-child(5) {
    width: 90px;
    /* Precio Mayorista */
}

#tabla-productos th:nth-child(6),
#tabla-productos td:nth-child(6) {
    width: 90px;
    /* Unidades x Pack */
}

#tabla-productos th:nth-child(7),
#tabla-productos td:nth-child(7) {
    width: 100px;
    /* Categoría */
}

#tabla-productos th:nth-child(8),
#tabla-productos td:nth-child(8) {
    width: 120px;
    /* Tipo de venta */
}

#tabla-productos th:nth-child(9),
#tabla-productos td:nth-child(9) {
    width: 100px;
    /* Imagen */
}

/* Columna de Acciones */
#tabla-productos th:nth-child(10),
#tabla-productos td:nth-child(10) {
    width: 100px;/* ancho fijo para esa columna */
    min-width: 100px;/* asegura espacio mínimo */
    text-align: center;/* centra el botón */
    white-space: nowrap;/* evita saltos raros */
}
#tabla-productos th:nth-child(11),
#tabla-productos td:nth-child(11) {
    width: 100px;
    /* stock */
}
/* Filas alternas para mejor lectura */
#tabla-productos tbody tr:nth-child(odd) {
  background-color: #fafafa;
}
#tabla-productos tbody tr:nth-child(even) {
  background-color: #ffffff;
}


/* Compactar inputs y selects */
#tabla-productos input,
#tabla-productos select {
    width: 100%;
    padding: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

/* Imagen más pequeña */
#tabla-productos img {
  max-width: 150px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: transform 0.2s;
}

#tabla-productos img:hover {
  transform: scale(1.05);
}

/* Bordes y estilo */
#tabla-productos th,
#tabla-productos td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
}

/* Encabezado con fondo */
#tabla-productos th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Contenedor con scroll horizontal si es necesario */
.tabla-contenedor {
    overflow-x: auto;
}

/* Ajustes en pantallas chicas */
@media (max-width: 768px) {
    .tabla-contenedor {
        overflow-x: auto;
        display: block;
    }

    #tabla-productos {
        min-width: 800px;
        /* ancho mínimo de la tabla */
    }
}
#acciones button {
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

#acciones button:nth-child(1) { /* Agregar Producto */
  background-color: #28a745;
  color: white;
}

#acciones button:nth-child(2) { /* Guardar Cambios */
  background-color: #007bff;
  color: white;
}

#acciones button:nth-child(3) { /* Cerrar Sesión */
  background-color: darkred;
  color: white;
}
#acciones button:hover {
  opacity: 0.85;
  transform: scale(1.03);
  transition: 0.2s;
}
/* 🔴 Resalta productos con bajo stock */
.low-stock {
  background-color: #ffcccc !important;
}
#dashboard {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
  gap: 15px;
  flex-wrap: wrap;
}

.card {
  flex: 1;
  min-width: 150px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  padding: 20px;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 16px;
  color: #333;
}

.card p {
  font-size: 22px;
  font-weight: bold;
  margin: 0;
  color: #111;
}

.low-stock-card {  
  color: #856404;
  background-color: #fff3cd;
}

.no-stock-card {
  background-color: #f8d7da;
  color: #721c24;
}

#configuracion-tienda {
  display: none;
}
/* ✨ Animación de aparición y desaparición */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-5px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

/* Estilo del mensaje de confirmación */
#mensaje-confirmacion-plan {
  text-align: center;
  color: green;
  font-weight: bold;
  margin-top: 10px;
  display: none;
  animation: fadeInOut 6s ease-in-out forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-5px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

#mensaje-confirmacion-categorias {
  animation: fadeInOut 3s ease-in-out forwards;
}

/* === RESPONSIVE GLOBAL === */
@media (max-width: 992px) {
  body {
    padding: 0 10px;
  }
  header, nav, footer {
    flex-direction: column;
    text-align: center;
  }
  nav a {
    margin: 6px 0;
  }
  table {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  input, select, button, textarea {
    width: 100% !important;
    font-size: 15px !important;
  }
  .grid, .row, .form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .card, .plan, .producto {
    max-width: 100%;
  }
  img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  h1, h2 {
    font-size: 1.4rem !important;
  }
  table {
    font-size: 12px;
  }
  #acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}
@media (max-width: 768px) {
  .tabla-contenedor {
    overflow-x: auto;
  }
  #tabla-productos {
    min-width: 900px;
  }
}

/* ===== PAGINACIÓN FINAL COMPACTA ===== */
#paginacion button {
  all: unset; /* 🔥 elimina TODO estilo heredado */
  display: inline-block;
  background: #198754; /* Verde moderno */
  color: white;
  border: none;
  padding: 3px 10px; /* 🔹 menos alto */
  margin: 3px;
  border-radius: 5px;
  font-size: 12px; /* 🔹 texto pequeño */
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2; /* 🔹 reduce altura interna */
  min-width: 28px;  /* 🔹 tamaño mínimo */
  max-width: 40px;  /* 🔹 evita agrandarse */
  box-sizing: border-box;
}

#paginacion button:hover {
  background: #157347;
  transform: scale(1.05);
}

/* 📱 Móviles aún más compactos */
@media (max-width: 480px) {
  #paginacion button {
    padding: 2px 8px;
    font-size: 11px;
    margin: 2px;
    min-width: 24px;
    max-width: 36px;
  }
}

/* === CORRECCIÓN RESPONSIVE DEFINITIVA === */
#buscador-admin {
  display: block;
  width: 50% !important;       /* 🔹 escritorio */
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin: 0 auto;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#buscador-admin:focus {
  outline: none;
  border-color: #0b5ed7;
  box-shadow: 0 0 4px rgba(11,94,215,0.4);
}

/* 🟢 Tablet */
@media (max-width: 768px) {
  #buscador-admin {
    width: 70% !important;     /* 🔹 se achica a 70% del contenedor */
    font-size: 13px;
    padding: 5px 6px;
  }
}

/* 📱 Celular */
@media (max-width: 480px) {
  #buscador-admin {
    width: 60% !important;     /* 🔹 ocupa casi todo el ancho */
    font-size: 12px;
    padding: 4px 6px;
  }
}

/* ==========================================================
   🧩 CORRECCIÓN DEFINITIVA VISUALIZACIÓN COLUMNA "STOCK"
   ========================================================== */

/* Columna STOCK optimizada para pantallas grandes */
#tabla-productos td:last-child input[type="number"] {
  width: 55px;          /* 🔹 más angosto que antes (70px) */
  max-width: 60px;      /* 🔹 límite de ancho */
  text-align: center;   /* 🔹 número centrado */
  margin: 0 auto;
  display: block;
  padding: 4px;         /* 🔹 menos relleno para compactar */
  font-size: 13px;
}

/* Encabezado STOCK ajustado */
#tabla-productos th:last-child {
  width: 70px;           /* 🔹 ancho fijo proporcional al texto “Stock” */
  text-align: center;
  white-space: nowrap;
}

/* 🔹 En pantallas chicas, se mantiene más flexible */
@media (max-width: 768px) {
  #tabla-productos th:last-child,
  #tabla-productos td:last-child {
    width: 65px !important;
    min-width: 60px;
  }

  #tabla-productos td:last-child input[type="number"] {
    width: 50px;
    max-width: 55px;
    font-size: 12px;
    padding: 3px;
  }
}

/* ===============================
   🟣 MODAL BASE
================================*/
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  padding: 20px;
}

.modal-content {
  background: white;
  max-width: 700px;
  width: 100%;
  margin: 50px auto;
  border-radius: 14px;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: modalFade .25s ease-out;
}

@keyframes modalFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   🟣 HEADER & TITLE
================================*/
.modal-title {
  text-align: center;
  color: #6610f2;
  margin-bottom: 10px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-shrink: 0; /* 🚀 evita que se estire */
}



.modal-close:hover {
  background: #b02a37;
  transform: scale(1.1);
}


/* ===============================
   🟣 FORM
================================*/
.form-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.form-grid input,
.form-grid select,
textarea {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

textarea {
  width: 100%;
  resize: none;
  height: 70px;
}

.btn-success,
.btn-primary {
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.btn-success { background: #198754; color: white; }
.btn-primary { background: #0d6efd; color: white; }

.modal-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===============================
   🟣 TABLA RESPONSIVE
================================*/
.tabla-responsive {
  overflow-x: auto;
}

#tablaRegistros th {
  background: #6610f2;
  color: white;
  padding: 8px;
}

#tablaRegistros td {
  padding: 8px;
  text-align: center;
}

/* ===============================
   📱 RESPONSIVE
================================*/
@media (max-width: 768px) {
  .form-grid {
    flex-direction: column;
  }

  .modal-header-actions {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .modal-content {
    margin: 10px auto;
    padding: 15px;
  }
}


/* ===============================
   📱 RESPONSIVE
================================*/
@media (max-width: 480px) {
  .modal-close {
  flex: 0 0 auto !important;
  max-width: 32px !important;
}

}




/* ===============================
   MATES GUAY - SaaS Profesional V1
   =============================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --card:#ffffff;
  --primary:#2563eb;
  --text:#111827;
  --radius:18px;
  --shadow:0 10px 30px rgba(0,0,0,.08);
}

*{
  box-sizing:border-box;
}

body{
  font-family:'Inter',sans-serif !important;
  background:linear-gradient(to bottom,#f8fafc,#eef4ff);
  color:var(--text);
}

.card,
.producto,
.panel,
.seccion,
.tarjeta{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  transition:.3s ease;
}

.card:hover,
.producto:hover,
.tarjeta:hover{
  transform:translateY(-3px);
}

button,
.btn{
  border-radius:14px !important;
  font-weight:700 !important;
  transition:.25s ease !important;
}

button:hover,
.btn:hover{
  transform:translateY(-2px);
}

input,
select,
textarea{
  border-radius:14px !important;
  border:1px solid #dbe2ea !important;
  padding:12px !important;
}

h1,h2,h3{
  font-weight:800;
}

@media(max-width:768px){

  #acciones{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  button{
    width:100%;
    font-size:13px !important;
  }

  h1{
    font-size:24px !important;
  }
}




/* ===============================
   MATES GUAY - SaaS Profesional V2
   Landing + Panel + Mobile Premium
   =============================== */
:root{
  --vv-primary:#2563eb;
  --vv-primary-2:#1d4ed8;
  --vv-dark:#0f172a;
  --vv-soft:#f8fafc;
  --vv-card:#ffffff;
  --vv-border:#e5e7eb;
  --vv-text:#111827;
  --vv-muted:#64748b;
  --vv-green:#16a34a;
  --vv-orange:#f59e0b;
  --vv-radius:22px;
  --vv-shadow:0 18px 45px rgba(15,23,42,.10);
}

body{ background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 45%,#f8fafc 100%) !important; }

/* Top cards para monetizacion */
.saas-hero-panel,
.saas-pro-banner,
.saas-kpis,
.saas-template-picker,
.saas-commercial-block{
  max-width:1120px;
  margin:20px auto;
  padding:0 14px;
}

.saas-pro-banner{
  background:linear-gradient(135deg,#0f172a,#1d4ed8);
  color:#fff;
  border-radius:24px;
  padding:22px;
  display:grid;
  grid-template-columns:1.6fr .8fr;
  gap:16px;
  align-items:center;
  box-shadow:var(--vv-shadow);
}
.saas-pro-banner h2{margin:0 0 8px;font-size:26px;color:#fff!important;}
.saas-pro-banner p{margin:0;color:#dbeafe;line-height:1.5;}
.saas-pro-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;}
.saas-chip{display:inline-flex;align-items:center;gap:6px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);color:#fff;border-radius:999px;padding:8px 12px;font-weight:800;font-size:13px;}
.saas-btn-primary,.saas-btn-secondary{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:15px;padding:12px 16px;font-weight:800;transition:.25s ease;}
.saas-btn-primary{background:#fff;color:#1d4ed8;box-shadow:0 10px 25px rgba(255,255,255,.12);}
.saas-btn-secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.22);}
.saas-btn-primary:hover,.saas-btn-secondary:hover{transform:translateY(-2px);}

.saas-kpis{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;}
.saas-kpi-card{background:#fff;border:1px solid var(--vv-border);border-radius:20px;padding:18px;box-shadow:0 12px 30px rgba(15,23,42,.07);}
.saas-kpi-card span{display:block;color:var(--vv-muted);font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.saas-kpi-card strong{display:block;font-size:28px;margin-top:6px;color:var(--vv-dark);}
.saas-kpi-card small{color:var(--vv-muted);font-weight:700;}

/* Selector visual de plantillas */
.saas-template-picker{background:#fff;border:1px solid var(--vv-border);border-radius:24px;padding:20px;box-shadow:var(--vv-shadow);}
.saas-template-picker h2{margin:0 0 6px;color:var(--vv-dark);}
.saas-template-picker p{margin:0 0 16px;color:var(--vv-muted);}
.saas-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;}
.saas-template-card{border:1px solid var(--vv-border);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff,#f8fafc);cursor:pointer;text-align:left;transition:.25s ease;min-height:112px;}
.saas-template-card:hover,.saas-template-card.active{border-color:var(--vv-primary);box-shadow:0 12px 28px rgba(37,99,235,.14);transform:translateY(-2px);}
.saas-template-icon{font-size:28px;display:block;margin-bottom:8px;}
.saas-template-card strong{display:block;color:var(--vv-dark);font-size:15px;}
.saas-template-card small{color:var(--vv-muted);font-weight:700;}

/* Forms y tablas mas premium */
#admin-panel, .wrap{max-width:1180px!important;margin-left:auto!important;margin-right:auto!important;}
#admin-panel h1,.wrap h1{text-align:center;color:var(--vv-dark)!important;}
section, .card, .login-card, #login-container{border:1px solid rgba(226,232,240,.9)!important;box-shadow:var(--vv-shadow)!important;}
table{border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 12px 28px rgba(15,23,42,.06);} 
th{font-weight:800!important;}

/* Landing premium */
.saas-landing-upgrade{max-width:1120px;margin:24px auto;padding:0 16px;}
.saas-landing-hero{background:radial-gradient(circle at top left,#dbeafe,#ffffff 42%,#eff6ff 100%);border:1px solid #dbeafe;border-radius:30px;padding:34px;box-shadow:var(--vv-shadow);display:grid;grid-template-columns:1.2fr .8fr;gap:24px;align-items:center;}
.saas-landing-hero h1{font-size:clamp(32px,5vw,58px);line-height:1.02;margin:10px 0;color:#0f172a;}
.saas-landing-hero p{font-size:17px;line-height:1.6;color:#475569;}
.saas-badges{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0;}
.saas-badges span{background:#fff;border:1px solid #dbeafe;border-radius:999px;padding:8px 12px;font-weight:800;color:#1d4ed8;}
.saas-preview-box{background:#0f172a;color:#fff;border-radius:26px;padding:22px;box-shadow:0 22px 55px rgba(15,23,42,.22);}
.saas-preview-box h3{color:#fff;margin-top:0;}
.saas-preview-box ul{padding-left:18px;line-height:1.9;color:#dbeafe;}
.saas-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:16px;}
.saas-step{background:#fff;border:1px solid var(--vv-border);border-radius:20px;padding:18px;box-shadow:0 12px 30px rgba(15,23,42,.06);}
.saas-step strong{display:block;font-size:18px;margin-bottom:6px;color:#0f172a;}
.saas-step p{margin:0;color:#64748b;}

/* Barra mobile */
.mobile-sticky-cta{display:none;}

@media(max-width:780px){
  .saas-pro-banner,.saas-landing-hero{grid-template-columns:1fr;padding:20px;border-radius:22px;}
  .saas-pro-actions{justify-content:flex-start;}
  .saas-kpis{grid-template-columns:1fr 1fr;}
  .saas-kpi-card{padding:14px;}
  .saas-kpi-card strong{font-size:22px;}
  .saas-steps{grid-template-columns:1fr;}
  .saas-template-grid{grid-template-columns:1fr 1fr;}
  .row,.horarios-grid-4{grid-template-columns:1fr!important;}
  nav img{height:86px!important;}
  nav{gap:8px;}
  nav a:not(.cta){display:none;}
  .mobile-sticky-cta{display:flex;position:fixed;bottom:12px;left:12px;right:12px;z-index:50;gap:10px;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border:1px solid #e5e7eb;border-radius:20px;padding:10px;box-shadow:0 16px 45px rgba(15,23,42,.18);}
  .mobile-sticky-cta a{flex:1;text-align:center;text-decoration:none;border-radius:14px;padding:12px;font-weight:900;}
  .mobile-sticky-cta a:first-child{background:#2563eb;color:white;}
  .mobile-sticky-cta a:last-child{background:#0f172a;color:white;}
  body{padding-bottom:76px;}
}



/* ==========================================================
   MATES GUAY - ADMIN PRO V5
   Limpieza visual + tabla profesional responsive
   ========================================================== */

/* Oculta el bloque comercial superior anterior si por caché quedó en pantalla */
.saas-pro-banner,
.saas-kpis {
  display: none !important;
}

body {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 42%, #f8fafc 100%) !important;
  padding: 18px !important;
  color: #0f172a;
}

#admin-panel {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 8px 40px !important;
}

.admin-title,
#admin-panel > h1 {
  font-size: clamp(24px, 4vw, 34px) !important;
  margin: 18px 0 8px !important;
  color: #0f172a !important;
  letter-spacing: -0.7px;
}

/* Acciones superiores más compactas y profesionales */
#acciones {
  background: rgba(255,255,255,.82);
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 14px 35px rgba(15,23,42,.07);
}

#acciones button {
  min-height: 42px;
  border-radius: 14px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

/* Dashboard limpio */
#dashboard {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 14px !important;
  max-width: 950px;
  margin: 18px auto !important;
}

#dashboard .card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  padding: 16px !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.07) !important;
}

#dashboard .card h3 {
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b !important;
}

#dashboard .card p {
  font-size: 28px !important;
  color: #0f172a !important;
}

/* Buscador profesional */
#buscador-admin {
  width: min(620px, 92%) !important;
  height: 46px !important;
  border-radius: 16px !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0 16px !important;
  font-size: 15px !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}

#buscador-admin:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12) !important;
}

/* Contenedor tabla */
.tabla-contenedor {
  width: 100%;
  overflow-x: auto;
  margin: 18px auto 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
  padding: 8px;
}

/* Tabla más ancha para que no se corten precios/inputs */
#tabla-productos {
  width: 100% !important;
  min-width: 1280px !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 18px !important;
  overflow: hidden;
  font-size: 14px !important;
}

#tabla-productos thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-bottom: 1px solid #dbe4ef !important;
  padding: 13px 8px !important;
  font-size: 13px !important;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

#tabla-productos td {
  background: #fff;
  border-color: #e5e7eb !important;
  padding: 10px 7px !important;
  vertical-align: middle;
}

#tabla-productos tbody tr:nth-child(even) td {
  background: #f8fafc;
}

#tabla-productos tbody tr:hover td {
  background: #eff6ff !important;
}

/* Anchos correctos para las 12 columnas */
#tabla-productos th:nth-child(1),  #tabla-productos td:nth-child(1)  { width: 210px !important; }
#tabla-productos th:nth-child(2),  #tabla-productos td:nth-child(2)  { width: 90px !important; }
#tabla-productos th:nth-child(3),  #tabla-productos td:nth-child(3)  { width: 110px !important; }
#tabla-productos th:nth-child(4),  #tabla-productos td:nth-child(4)  { width: 100px !important; }
#tabla-productos th:nth-child(5),  #tabla-productos td:nth-child(5)  { width: 115px !important; }
#tabla-productos th:nth-child(6),  #tabla-productos td:nth-child(6)  { width: 105px !important; }
#tabla-productos th:nth-child(7),  #tabla-productos td:nth-child(7)  { width: 130px !important; }
#tabla-productos th:nth-child(8),  #tabla-productos td:nth-child(8)  { width: 95px !important; }
#tabla-productos th:nth-child(9),  #tabla-productos td:nth-child(9)  { width: 130px !important; }
#tabla-productos th:nth-child(10), #tabla-productos td:nth-child(10) { width: 135px !important; }
#tabla-productos th:nth-child(11), #tabla-productos td:nth-child(11) { width: 105px !important; }
#tabla-productos th:nth-child(12), #tabla-productos td:nth-child(12) { width: 85px !important; }

/* Inputs/selects visibles y cómodos */
#tabla-productos input,
#tabla-productos select {
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

/* Números centrados para que se lean completos */
#tabla-productos input[type="number"] {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

/* Nombre e imagen URL: mejor lectura */
#tabla-productos td:nth-child(1) input,
#tabla-productos td:nth-child(10) input {
  text-align: left !important;
}

/* Imagen más ordenada */
#tabla-productos img {
  max-width: 80px !important;
  max-height: 70px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  border: 1px solid #dbe4ef !important;
  background: #fff;
  padding: 4px;
  display: block;
  margin: 8px auto 0;
}

/* Botón eliminar sin romper columna */
#tabla-productos button {
  width: 86px !important;
  min-height: 38px !important;
  margin: 0 auto !important;
  padding: 8px 9px !important;
  border-radius: 13px !important;
  font-size: 12px !important;
  line-height: 1.1;
  box-shadow: none !important;
  white-space: normal !important;
}

/* Stock bien visible */
#tabla-productos td:nth-child(12) input {
  width: 62px !important;
  max-width: 62px !important;
  margin: 0 auto !important;
  display: block;
}

/* Mobile: tabla con scroll, no se aplasta */
@media (max-width: 768px) {
  body {
    padding: 8px !important;
  }

  #acciones {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  #acciones button {
    width: 100% !important;
    font-size: 12px !important;
    padding: 10px 8px !important;
  }

  .tabla-contenedor {
    border-radius: 18px;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
  }

  #tabla-productos {
    min-width: 1260px !important;
    font-size: 13px !important;
  }

  #tabla-productos input,
  #tabla-productos select {
    font-size: 13px !important;
    height: 40px !important;
  }

  .admin-title,
  #admin-panel > h1 {
    font-size: 23px !important;
  }
}

/* =====================================================
   LINK PÚBLICO EN PANEL ADMIN - MODAL PROFESIONAL
   ===================================================== */
.admin-public-link-toolbar {
  max-width: 980px;
  margin: 8px auto 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-public-link-toolbar strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.admin-public-link-toolbar span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.admin-public-link-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-public-link-toolbar-actions button,
.admin-public-link-toolbar-actions a {
  border: none;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

#btnAbrirModalLinkTienda {
  background: #0d6efd;
  color: #ffffff;
}

#btnAbrirTiendaPublicaMini {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.admin-link-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.admin-link-modal.is-open {
  display: flex;
}

.admin-link-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(4px);
}

.admin-link-modal-box {
  position: relative;
  width: min(680px, 100%);
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  border: 1px solid rgba(13, 110, 253, .18);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  padding: 26px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: adminModalIn .18s ease-out;
}

@keyframes adminModalIn {
  from { transform: translateY(10px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.admin-link-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  font-weight: 900;
}

.admin-public-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}

.admin-link-modal-box h2 {
  margin: 6px 42px 8px 0;
  color: #0f172a;
  font-size: clamp(22px, 4vw, 30px);
}

.admin-link-modal-box p {
  margin: 0 0 15px;
  color: #475569;
  font-weight: 700;
}

.admin-link-modal-box input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.admin-public-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.admin-public-link-actions a,
.admin-public-link-actions button {
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.admin-public-link-actions a:hover,
.admin-public-link-actions button:hover,
.admin-public-link-toolbar-actions button:hover,
.admin-public-link-toolbar-actions a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, .14);
}

#btnAbrirTiendaPublica {
  background: #0d6efd;
  color: #ffffff;
}

#btnCopiarLinkTienda {
  background: #111827;
  color: #ffffff;
}

#btnCompartirWhatsappTienda {
  background: #16a34a;
  color: #ffffff;
}

.admin-public-link-msg {
  display: block;
  margin-top: 11px;
  color: #15803d;
  font-weight: 900;
}

@media (max-width: 640px) {
  .admin-public-link-toolbar {
    margin: 8px 10px 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-public-link-toolbar-actions,
  .admin-public-link-actions {
    flex-direction: column;
  }

  .admin-public-link-toolbar-actions button,
  .admin-public-link-toolbar-actions a,
  .admin-public-link-actions a,
  .admin-public-link-actions button {
    width: 100%;
    text-align: center;
  }

  .admin-link-modal-box {
    padding: 22px 18px;
  }
}
