/* =======================================================
   SMARTCATALOG AI
   PANEL DE ADMINISTRACIÓN
   ======================================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{

    font-family:Segoe UI, Arial, Helvetica, sans-serif;

    background:#eef3f8;

    color:#222;

    overflow-x:hidden;

}

/* ==========================
   HEADER
========================== */

.topbar{

    background:linear-gradient(135deg,#0d6efd,#0b57d0);

    color:#fff;

    padding:20px 40px;

    box-shadow:0 5px 18px rgba(0,0,0,.18);

    display:flex;

    align-items:center;

    justify-content:space-between;

    flex-wrap:wrap;

}

.acciones-topbar{

    display:flex;

    gap:12px;

    flex-wrap:wrap;

}

.boton-logout{

    color:#fff;

    background:rgba(255,255,255,.15);

    padding:8px 16px;

    border-radius:6px;

    text-decoration:none;

    font-size:14px;

    white-space:nowrap;

}

.boton-logout:hover{

    background:rgba(255,255,255,.28);

}

.logo h1{

    font-size:34px;

    font-weight:700;

    margin-bottom:4px;

}

.logo span{

    font-size:15px;

    opacity:.9;

}

/* ==========================
   CONTENEDOR
========================== */

.container{

    width:95%;

    max-width:1700px;

    margin:30px auto;

}

/* ==========================
   DASHBOARD
========================== */

#dashboard{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

    margin-bottom:35px;

}

.stat-card{

    background:#fff;

    border-radius:18px;

    padding:22px;

    display:flex;

    align-items:center;

    gap:18px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

    transition:.25s;

}

.stat-card:hover{

    transform:translateY(-4px);

}

.icon{

    width:65px;

    height:65px;

    border-radius:50%;

    background:#e8f1ff;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:30px;

}

.stat-card h3{

    color:#666;

    font-size:15px;

    margin-bottom:6px;

}

.stat-card p{

    font-size:28px;

    font-weight:bold;

    color:#0d6efd;

}

/* ==========================
   FORMULARIO
========================== */

#formulario{

    background:#fff;

    border-radius:18px;

    padding:30px;

    margin-bottom:35px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

}

#formulario h2{

    margin-bottom:25px;

    color:#0d6efd;

}

.fila{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:18px;

    margin-bottom:18px;

}

#formulario input,
#formulario select,
#formulario textarea{

    width:100%;

    padding:14px;

    border:1px solid #d7dde7;

    border-radius:10px;

    font-size:15px;

    outline:none;

}

#formulario input:focus,
#formulario select:focus,
#formulario textarea:focus{

    border-color:#0d6efd;

}

textarea{

    resize:vertical;

    min-height:120px;

    margin-bottom:18px;

}

input[type=file]{

    margin-bottom:18px;

}

#categoria-nueva{

    grid-column:1 / -1;

    margin-top:-8px;

}

#agregar{

    background:#0d6efd;

    color:#fff;

    border:none;

    padding:14px;

    border-radius:10px;

    font-size:16px;

    cursor:pointer;

    transition:.25s;

}

#agregar:hover{

    background:#084ec2;

}

/* ==========================
   BUSCADOR
========================== */

.buscador{

    margin-bottom:30px;

}

#busqueda{

    width:100%;

    padding:15px 18px;

    border-radius:12px;

    border:1px solid #d7dde7;

    font-size:16px;

}

/* =======================================================
   PRODUCTOS
   ======================================================= */

#productos{

    display:grid;

    grid-template-columns:repeat(5,minmax(0,1fr));

    gap:20px;

}

.card{

    background:#fff;

    border-radius:18px;

    overflow:hidden;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

    transition:.25s;

    display:flex;

    flex-direction:column;

}

.card:hover{

    transform:translateY(-6px);

    box-shadow:0 18px 40px rgba(0,0,0,.15);

}

.producto-img{

    width:100%;

    height:180px;

    object-fit:cover;

    background:#f3f4f6;

}



.card p{

    padding:0 16px;

    margin:6px 0;

    font-size:14px;

}



.acciones button{

    border:none;

    border-radius:10px;

    padding:12px;

    font-size:14px;

    font-weight:bold;

    cursor:pointer;

    transition:.2s;

    flex:1;

    margin:0;

}

.acciones button:first-child{

    background:#2563eb;

    color:white;

}

.acciones button:first-child:hover{

    background:#1d4ed8;

}

.acciones button:last-child{

    background:#dc3545;

    color:white;

}

.acciones button:last-child:hover{

    background:#b91c1c;

}

/* =======================================================
   RESPONSIVE
   ======================================================= */

@media (max-width:1600px){

    #productos{

        grid-template-columns:repeat(4,1fr);

    }

}

@media (max-width:1200px){

    #dashboard{

        grid-template-columns:repeat(2,1fr);

    }

    #productos{

        grid-template-columns:repeat(3,1fr);

    }

}

@media (max-width:900px){

    .fila{

        grid-template-columns:1fr;

    }

    #productos{

        grid-template-columns:repeat(2,1fr);

    }

}

@media (max-width:600px){

    #dashboard{

        grid-template-columns:1fr;

    }

    #productos{

        grid-template-columns:1fr;

    }

    .topbar{

        padding:20px;

    }

    .logo h1{

        font-size:28px;

    }

}

.info{

    padding:18px;

}

.categoria{

    color:#666;

    font-size:14px;

    margin:8px 0;

}

.card h2{

    font-size:19px;

    color:#1f2937;

    margin:0 16px 8px;

    font-weight:600;

}

.precio{

    font-size:26px;

    font-weight:bold;

    color:#16a34a;

    margin:12px 0;

}

.stock{

    font-weight:bold;

    margin-bottom:15px;

}

.acciones{

    display:flex;

    gap:10px;

}


.preview-imagenes{

    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:15px;
    margin-bottom:20px;

}

.preview-imagenes img{

    width:120px;
    height:120px;
    object-fit:cover;
    border-radius:10px;
    border:2px solid #ddd;
    box-shadow:0 4px 10px rgba(0,0,0,.1);

}

.preview-item{

    position:relative;

    display:inline-block;

}

.preview-item img{

    width:120px;
    height:120px;
    object-fit:cover;

    border-radius:10px;

    border:2px solid #ddd;

}

.btn-eliminar-img{

    position:absolute;

    top:-8px;

    right:-8px;

    width:26px;

    height:26px;

    border:none;

    border-radius:50%;

    background:#dc3545;

    color:white;

    font-weight:bold;

    cursor:pointer;

    box-shadow:0 2px 6px rgba(0,0,0,.3);

}

.btn-eliminar-img:hover{

    background:#b91c1c;

}

#cancelar{

    width:100%;
    padding:14px;
    border:none;
    border-radius:10px;
    color:white;
    cursor:pointer;
    font-size:16px;

}

#cancelar:hover{

    background:#555;

}

/* ==========================================
   CONFIGURACIÓN
========================================== */

#configuracion{

    background:white;

    border-radius:18px;

    padding:30px;

    margin-bottom:35px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

}

/* =========================
   Herramientas de inventario
========================= */

#herramientas-inventario{

    background:white;

    border-radius:18px;

    padding:30px;

    margin-bottom:35px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

}

#herramientas-inventario h2{

    margin-bottom:20px;

    color:#0d6efd;

}

.herramientas-botones{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

}

.btn-herramienta{

    display:inline-flex;

    align-items:center;

    gap:6px;

    background:#f0f4fb;

    color:#0d6efd;

    border:1px solid #d7e2f7;

    padding:12px 18px;

    border-radius:10px;

    font-size:14.5px;

    font-weight:600;

    text-decoration:none;

    cursor:pointer;

    transition:.2s;

    font-family:inherit;

}

.btn-herramienta:hover{

    background:#0d6efd;

    color:white;

}

.btn-herramienta.activo{

    background:#0d6efd;

    color:white;

}

.btn-importar{

    position:relative;

}

.ayuda-importar{

    margin-top:14px;

    font-size:13px;

    color:#6c7688;

}

#resultado-importacion{

    margin-top:14px;

    font-size:14px;

}

#resultado-importacion .exito{

    color:#198754;

    font-weight:600;

}

#resultado-importacion .errores-import{

    margin-top:8px;

    color:#c0392b;

    font-size:13px;

    max-height:120px;

    overflow-y:auto;

}

#configuracion h2{

    margin-bottom:20px;

    color:#0d6efd;

}

#configuracion input,
#configuracion textarea{

    width:100%;

    padding:14px;

    margin-bottom:15px;

    border:1px solid #d7dde7;

    border-radius:10px;

    font-size:15px;

}

#guardar-configuracion{

    width:100%;

    background:#198754;

    color:white;

    border:none;

    padding:14px;

    border-radius:10px;

    cursor:pointer;

    font-size:16px;

}

#guardar-configuracion:hover{

    background:#157347;

}

#preview-logo{

    margin-bottom:20px;

}

#preview-logo img{

    width:130px;

    height:130px;

    object-fit:contain;

    border:1px solid #ddd;

    border-radius:10px;

    background:white;

    padding:8px;

}

.logo{

    display:flex;

    align-items:center;

    gap:18px;

}

#logo-negocio{

    width:120px;
    height:120px;

    border-radius:12px;

    object-fit:cover;

    background:#fff;

    padding:0;

    border:0px solid white;

    box-shadow:0 4px 12px rgba(0,0,0,.25);

}

/*==========================
  MENSAJES
==========================*/

.toast{

    position:fixed;

    top:20px;

    right:20px;

    background:#198754;

    color:#fff;

    padding:15px 25px;

    border-radius:10px;

    font-weight:bold;

    box-shadow:0 8px 20px rgba(0,0,0,.25);

    opacity:0;

    transform:translateY(-20px);

    transition:.3s;

    z-index:99999;

}

.toast.mostrar{

    opacity:1;

    transform:translateY(0);

}
/* =========================
   Clasificador de clientes (IA)
========================= */

#clasificador{

    background:white;
    border-radius:18px;
    padding:30px;
    margin-bottom:35px;
    box-shadow:0 10px 25px rgba(0,0,0,.08);

}

#clasificador h2{

    margin-bottom:12px;
    color:#0d6efd;

}

#clasificador-texto{

    width:100%;
    padding:14px;
    border:1px solid #d7e2f7;
    border-radius:10px;
    font-family:inherit;
    font-size:14.5px;
    resize:vertical;
    margin-bottom:14px;

}

#clasificador-texto:focus{

    outline:2px solid #0d6efd;
    outline-offset:1px;

}

#clasificador-resultado{

    margin-top:18px;

}

.clasificacion-card{

    border-radius:14px;
    padding:20px;
    border:2px solid;

}

.clasificacion-card.interes-alto{
    background:#e9f9ef;
    border-color:#198754;
}

.clasificacion-card.interes-medio{
    background:#fff8e6;
    border-color:#f5a524;
}

.clasificacion-card.interes-bajo{
    background:#fdecec;
    border-color:#c0392b;
}

.clasificacion-nivel{

    display:inline-block;
    font-weight:800;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.03em;
    padding:5px 14px;
    border-radius:20px;
    margin-bottom:12px;
    color:white;

}

.interes-alto .clasificacion-nivel{ background:#198754; }
.interes-medio .clasificacion-nivel{ background:#f5a524; }
.interes-bajo .clasificacion-nivel{ background:#c0392b; }

.clasificacion-card p{

    font-size:14.5px;
    line-height:1.6;
    margin-bottom:10px;
    color:#333;

}

.clasificacion-card strong{
    display:block;
    margin-bottom:4px;
    font-size:13px;
    color:#555;
}

.clasificacion-error{

    background:#fdecec;
    color:#c0392b;
    padding:14px;
    border-radius:10px;
    font-size:14px;

}

/* =========================
   Selector de color de marca
========================= */

.campo-color{

    display:flex;
    align-items:center;
    gap:14px;
    margin:14px 0;

}

.campo-color label{

    font-size:14.5px;
    color:#333;

}

.campo-color input[type="color"]{

    width:48px;
    height:38px;
    border:1px solid #d7e2f7;
    border-radius:8px;
    padding:2px;
    cursor:pointer;

}