/* =====================================================
   RESET
===================================================== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    min-height:100%;
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* =====================================================
   LOGIN
===================================================== */
.login-page{
    min-height:100vh;

    display:flex;
    justify-content:center;
    align-items:center;

    background:
    linear-gradient(
        135deg,
        #0f172a 0%,
        #1e293b 50%,
        #334155 100%
    );
}

.login-wrapper{
    width:100%;
    max-width:450px;
    padding:20px;
}

.login-card{
    background:#ffffff;

    border-radius:20px;

    padding:40px;

    box-shadow:
        0 20px 60px rgba(0,0,0,.25);

    animation:fadeIn .4s ease;
}

.logo-box{
    text-align:center;
    margin-bottom:30px;
}

.logo-box h1{
    color:#0f172a;
    font-size:32px;
    font-weight:700;
    margin-bottom:5px;
}

.logo-box span{
    color:#64748b;
    font-size:14px;
}

.form-group{
    margin-bottom:20px;
}

.form-group label{
    display:block;
    margin-bottom:8px;

    color:#334155;

    font-size:14px;
    font-weight:600;
}

.form-group input{
    width:100%;
    height:50px;

    border:1px solid #dbe2ea;
    border-radius:12px;

    padding:0 15px;

    font-size:15px;

    transition:.3s;
}

.form-group input:focus{
    outline:none;

    border-color:#2563eb;

    box-shadow:
        0 0 0 4px rgba(37,99,235,.15);
}

.login-card button{
    width:100%;
    height:50px;

    border:none;
    border-radius:12px;

    background:#2563eb;

    color:#fff;

    font-size:15px;
    font-weight:600;

    cursor:pointer;

    transition:.3s;
}

.login-card button:hover{
    background:#1d4ed8;
}

.login-card button:disabled{
    opacity:.7;
    cursor:not-allowed;
}

.alert{
    margin-top:15px;

    padding:12px;

    border-radius:10px;

    text-align:center;

    font-size:14px;
}

.success{
    background:#dcfce7;
    color:#166534;
}

.error{
    background:#fee2e2;
    color:#991b1b;
}

/* =====================================================
   DASHBOARD
===================================================== */

.dashboard-page{
    background:#f1f5f9;
}

.layout{
    display:flex;
    width:100%;
    min-height:100vh;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar-logo img{
    width: 180px;
    max-width: 100%;
    display: block;
    margin: 10px auto 10px;
}

.sidebar{
    width:260px;
    min-height:100vh;

    background:#0f172a;

    color:#ffffff;

    padding:25px;

    position:fixed;
    left:0;
    top:0;
}

.brand{
    font-size:24px;
    font-weight:700;

    margin-bottom:40px;

    letter-spacing:1px;
}

.sidebar ul{
    list-style:none;
}

.sidebar li{
    margin-bottom:8px;
}

.sidebar a{
    display:block;

    text-decoration:none;

    color:#ffffff;

    padding:14px 16px;

    border-radius:10px;

    transition:.3s;
}

.sidebar a:hover{
    background:#1e293b;
}

.sidebar a.active{
    background:#2563eb;
}

/* =====================================================
   CONTENIDO
===================================================== */

.content{
    flex:1;

    margin-left:260px;

    min-height:100vh;
}

/* =====================================================
   TOPBAR
===================================================== */

.topbar{
    height:70px;

    background:#ffffff;

    padding:0 30px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    border-bottom:1px solid #e2e8f0;

    position:sticky;
    top:0;
    z-index:10;
}

.topbar strong{
    color:#0f172a;
}

/* =====================================================
   TARJETAS
===================================================== */

.cards{
    padding:30px;

    display:grid;

    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));

    gap:20px;
}

.card{
    background:#ffffff;

    border-radius:16px;

    padding:25px;

    box-shadow:
        0 5px 15px rgba(0,0,0,.05);

    transition:.3s;
}

.card:hover{
    transform:translateY(-4px);

    box-shadow:
        0 10px 25px rgba(0,0,0,.08);
}

.card h2{
    font-size:42px;

    color:#2563eb;

    margin-bottom:10px;
}

.card p{
    color:#64748b;
    font-size:15px;
}

/* =====================================================
   PANEL PRINCIPAL
===================================================== */

.panel{
    margin:0 30px 30px;

    background:#ffffff;

    border-radius:16px;

    padding:30px;

    box-shadow:
        0 5px 15px rgba(0,0,0,.05);
}

.panel h3{
    margin-bottom:15px;
    color:#0f172a;
}

.panel p{
    color:#64748b;
    line-height:1.7;
}

/* =====================================================
   ANIMACIONES
===================================================== */

@keyframes fadeIn{

    from{
        opacity:0;
        transform:translateY(20px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media(max-width:900px){

    .sidebar{
        width:220px;
    }

    .content{
        margin-left:220px;
    }
}

@media(max-width:768px){

    .layout{
        flex-direction:column;
    }

    .sidebar{
        position:relative;
        width:100%;
        min-height:auto;
    }

    .content{
        margin-left:0;
    }

    .topbar{
        padding:15px;
    }

    .cards{
        grid-template-columns:1fr;
        padding:20px;
    }

    .panel{
        margin:0 20px 20px;
    }
}

.tabla{
    width:100%;
    border-collapse:collapse;
}

.tabla th,
.tabla td{
    border-bottom:1px solid #e5e7eb;
    padding:12px;
    text-align:left;
}

.modal{

    display:none;

    position:fixed;

    top:0;
    left:0;

    width:100%;
    height:100%;

    background:
    rgba(0,0,0,.5);

    justify-content:center;
    align-items:center;
}

.modal-content{

    background:white;

    width:600px;

    max-width:95%;

    padding:25px;

    border-radius:15px;
}

textarea{
    width:100%;
    min-height:120px;
    padding:10px;
}

select{
    width:100%;
    height:45px;
}


/* ====================================
   CATEGORIAS
==================================== */

.ctg-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin:30px;
}
.ctg-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* ====================================
   BOTON NUEVO
==================================== */

.ctg-new {
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.ctg-new:hover {
    background: #1d4ed8;
}

/* ====================================
   PANEL
==================================== */

.ctg-panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ====================================
   TABLA
==================================== */

.ctg-tbl {
    width: 100%;
    border-collapse: collapse;
}

.ctg-tbl thead th {
    text-align: left;
    padding: 14px;
    font-weight: 700;
    border-bottom: 1px solid #d1d5db;
}

.ctg-tbl tbody td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

/* ====================================
   IMAGEN
==================================== */

.ctg-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

/* ====================================
   ESTADO
==================================== */

.ctg-st-on {
    color: #16a34a;
    font-weight: 600;
}

.ctg-st-off {
    color: #dc2626;
    font-weight: 600;
}

/* ====================================
   ACCIONES
==================================== */

.ctg-act{
    display:flex;
    gap:12px;
    align-items:center;
}

.ctg-edit,
.ctg-del{
    font-size:20px;
    cursor:pointer;
    padding:6px;
    border-radius:8px;
    transition:.2s;
    user-select:none;
}

.ctg-edit:hover{
    background:#dbeafe;
}

.ctg-del:hover{
    background:#fee2e2;
}

.ctg-edit:active,
.ctg-del:active{
    transform:scale(0.9);
}

/* ====================================
   MODAL
==================================== */

.ctg-modal {
	animation:modalIn .25s ease;
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}

.ctg-box {
    width: 600px;
    max-width: 95%;
    margin: 50px auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
	max-height:90vh;
	overflow-y:auto;
}

.ctg-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ====================================
   CAMPOS
==================================== */

.ctg-grp {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ctg-lbl {
    font-weight: 600;
}

.ctg-inp,
.ctg-txt,
.ctg-sel {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.ctg-txt {
    min-height: 100px;
    resize: vertical;
}

/* ====================================
   BOTON GUARDAR
==================================== */

.ctg-save {
    border: none;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
}

.ctg-save:hover {
    background: #15803d;
}

.ctg-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.ctg-close{
    font-size:20px;
    cursor:pointer;
    font-weight:bold;
    color:#64748b;
}

.ctg-close:hover{
    color:#dc2626;
}

.ctg-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}
.ctg-actions button{
    min-width:120px;
    height:44px;
}

.ctg-cancel{
    background:#e5e7eb;
    color:#111827;
    border:none;
    padding:12px 20px;
    border-radius:10px;
    cursor:pointer;
}

.ctg-save{
    background:#16a34a;
    color:#fff;
    border:none;
    padding:12px 20px;
    border-radius:10px;
}

/* ====================================
   USUARIOS
==================================== */

.usr-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:30px;
}

.usr-title{
    margin:0;
    font-size:28px;
    font-weight:700;
    color:#111827;
}

.usr-new{
    border:none;
    border-radius:10px;
    background:#2563eb;
    color:#fff;
    padding:12px 24px;
    cursor:pointer;
    font-weight:600;
}

.usr-new:hover{
    background:#1d4ed8;
}

.usr-panel{
    background:#fff;
    border-radius:16px;
    padding:24px;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.usr-tbl{
    width:100%;
    border-collapse:collapse;
}

.usr-tbl th{
    text-align:left;
    padding:14px;
    border-bottom:1px solid #d1d5db;
}

.usr-tbl td{
    padding:14px;
    border-bottom:1px solid #e5e7eb;
}

.usr-act{
    display:flex;
    gap:12px;
}

.usr-edit,
.usr-del{
    cursor:pointer;
    padding:6px;
    border-radius:8px;
    font-size:20px;
}

.usr-edit:hover{
    background:#dbeafe;
}

.usr-del:hover{
    background:#fee2e2;
}

.usr-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    justify-content:center;
    align-items:center;
    z-index:999;
}

.usr-box{
    width:600px;
    max-width:95%;
    background:#fff;
    border-radius:16px;
    padding:24px;
}

.usr-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.usr-close{
    cursor:pointer;
    font-size:20px;
}

.usr-close:hover{
    color:#dc2626;
}

.usr-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}

.usr-cancel{
    border:none;
    background:#e5e7eb;
    color:#111827;
    padding:12px 20px;
    border-radius:10px;
    cursor:pointer;
}

.usr-save{
    border:none;
    background:#16a34a;
    color:#fff;
    padding:12px 20px;
    border-radius:10px;
    cursor:pointer;
}

/* ====================================
   PRODUCTOS
==================================== */

.prd-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:30px;
}

.prd-title{
    font-size:28px;
    font-weight:700;
}

.prd-new{
    border:none;
    background:#2563eb;
    color:#fff;
    padding:12px 24px;
    border-radius:10px;
    cursor:pointer;
}

.prd-new:hover{
    background:#1d4ed8;
}

.prd-panel{
    background:#fff;
    padding:24px;
    border-radius:16px;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.prd-tbl{
    width:100%;
    border-collapse:collapse;
}

.prd-tbl th,
.prd-tbl td{
    padding:14px;
    border-bottom:1px solid #e5e7eb;
}

.prd-act{
    display:flex;
    gap:12px;
}

.prd-edit,
.prd-del{
    cursor:pointer;
    font-size:20px;
    padding:6px;
    border-radius:8px;
}

.prd-edit:hover{
    background:#dbeafe;
}

.prd-del:hover{
    background:#fee2e2;
}

.prd-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    justify-content:center;
    align-items:center;
    z-index:999;
}

.prd-box{
    width:800px;
    max-width:95%;
    max-height:90vh;
    overflow-y:auto;
    background:#fff;
    border-radius:16px;
    padding:24px;
}

.prd-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.prd-close{
    cursor:pointer;
    font-size:20px;
}

.prd-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}

.prd-cancel{
    background:#e5e7eb;
    border:none;
    padding:12px 20px;
    border-radius:10px;
}

.prd-save{
    background:#16a34a;
    color:#fff;
    border:none;
    padding:12px 20px;
    border-radius:10px;
}




.img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.img-box {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    background: #fafafa;
}

.img-box img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.img-box input[type="file"] {
    width: 100%;
    font-size: 12px;
}

.img-box input[type="file"] {
    margin-top: 5px;
    cursor: pointer;
}

.img-box:hover {
    opacity: 0.8;
    transform: scale(1.02);
    border-color: #999;
    background: #f0f0f0;
}

.btn-remove{
    position:absolute;
    top:5px;
    right:5px;
    width:24px;
    height:24px;
    border:none;
    border-radius:50%;
    background:#dc2626;
    color:#fff;
    cursor:pointer;
    display:block;
    z-index:10;
}

.btn-remove:hover{
    background:#b91c1c;
}