* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #f5f7fb;
    color: #1d2939;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #0d2a4d;
    color: white;
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 28px;
}

.sidebar a {
    display: block;
    color: #dbe7f5;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: #1769aa;
    color: white;
}

.logout-form {
    margin-top: 25px;
}

.logout-form button {
    width: 100%;
    border: none;
    background: #dc3545;
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 68px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid #e4e7ec;
}

.topbar strong {
    color: #0d2a4d;
}

.usuario {
    font-size: 14px;
    color: #475467;
}

.content {
    padding: 30px;
}

.content h1 {
    font-size: 28px;
    color: #0d2a4d;
    margin-bottom: 8px;
}

.content > p {
    color: #667085;
    margin-bottom: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    display: block;
    background: white;
    border-radius: 10px;
    padding: 22px;
    text-decoration: none;
    color: #1d2939;
    border: 1px solid #eaecf0;
    box-shadow: 0 3px 12px rgba(16, 24, 40, 0.07);
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
}

.card h3 {
    color: #0d2a4d;
    margin-bottom: 8px;
    font-size: 17px;
}

.card p {
    color: #667085;
    font-size: 13px;
}

.filters {
    background: white;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    border: 1px solid #eaecf0;
}

.filters select,
.filters input {
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    min-width: 170px;
}

.filters button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.table-container {
    background: white;
    border-radius: 10px;
    border: 1px solid #eaecf0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #eef4fb;
    color: #344054;
    text-align: left;
    padding: 12px;
    font-size: 13px;
    white-space: nowrap;
}

td {
    padding: 12px;
    border-top: 1px solid #eaecf0;
    font-size: 13px;
    vertical-align: middle;
}

tr:hover td {
    background: #fafcff;
}

.badge {
    display: inline-block;
    background: #eaf2ff;
    color: #175cd3;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.btn-agregar,
.btn-primary {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-editar {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-eliminar {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secundario {
    background: #e4e7ec;
    color: #344054;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.form-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #eaecf0;
    max-width: 950px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.campo {
    display: flex;
    flex-direction: column;
}

.campo-completo {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
}

input,
select,
textarea {
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0d6efd;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.acciones {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guardar {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.cancelar {
    background: #e4e7ec;
    color: #344054;
    padding: 11px 20px;
    border-radius: 6px;
    text-decoration: none;
}

.vacio {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eaecf0;
    color: #667085;
}

.acciones-tabla {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cantidad-input {
    width: 65px;
    padding: 7px;
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .campo-completo {
        grid-column: auto;
    }
}


@media (max-width: 750px) {

    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .topbar {
        padding: 15px 18px;
    }

    .content {
        padding: 20px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters select,
    .filters input,
    .filters button {
        width: 100%;
    }
}





/* ==============================
   LOGIN NUEVO
============================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;

    background:
        linear-gradient(
            rgba(255, 255, 255, 0.72),
            rgba(255, 255, 255, 0.72)
        ),
        
		url("/img/cieteeeeessss (1).webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-wrapper {
    width: 100%;
    max-width: 1100px;
    min-height: 560px;
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

/* LADO IZQUIERDO */
.login-left {
    position: relative;
    background: linear-gradient(135deg, #0b5ed7, #084298);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    overflow: hidden;
}

.login-left-content {
    position: relative;
    z-index: 2;
    max-width: 380px;
}

.login-left h1 {
    font-size: 44px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.login-left h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 18px;
}

.login-left p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.92);
}

/* CÍRCULOS DECORATIVOS */
.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #2a8cff, #0056b3);
    opacity: 0.95;
}

.circle-1 {
    width: 220px;
    height: 220px;
    bottom: -40px;
    left: -40px;
}

.circle-2 {
    width: 170px;
    height: 170px;
    bottom: 40px;
    right: 60px;
}

/* LADO DERECHO */
.login-right {
    background: #ffffff;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right h2 {
    font-size: 34px;
    color: #0d2a4d;
    margin-bottom: 10px;
    text-align: center;
}

.login-right > p {
    color: #667085;
    text-align: center;
    margin-bottom: 28px;
    font-size: 14px;
}

.login-right .form-group {
    margin-bottom: 18px;
}

.login-right label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #344054;
    margin-bottom: 7px;
}

.login-right input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
}

.login-right input:focus {
    outline: none;
    border-color: #0d6efd;
    background: #fff;
}

.login-btn {
    width: 100%;
    border: none;
    background: #0d4ea6;
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.login-btn:hover {
    background: #083b7a;
}

.mensaje {
    margin-bottom: 15px;
    padding: 11px;
    border-radius: 7px;
    font-size: 13px;
    text-align: center;
}

.mensaje.error {
    background: #ffe5e5;
    color: #b42318;
}

.mensaje.logout {
    background: #e9f7ef;
    color: #067647;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }

    .login-left {
        min-height: 280px;
        padding: 35px;
    }

    .login-left h1 {
        font-size: 34px;
    }

    .login-left h2 {
        font-size: 22px;
    }

    .login-right {
        padding: 35px 25px;
    }
}


.login-logo {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 28px auto;

    object-fit: contain;

    /* Como el logo tiene partes oscuras,
       le damos una base blanca muy suave */
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 16px;
    border-radius: 10px;
}


/* =================================
   TABLA COMPACTA - CANALIZACIÓN
================================= */

.tabla-compacta th {
    padding: 9px 7px;
    font-size: 11px;
}

.tabla-compacta td {
    padding: 9px 7px;
    font-size: 11px;
    line-height: 1.25;
}

/* Código */
.tabla-compacta th:nth-child(2),
.tabla-compacta td:nth-child(2) {
    width: 105px;
}

/* Marca */
.tabla-compacta th:nth-child(3),
.tabla-compacta td:nth-child(3) {
    width: 80px;
}

/* Categoría */
.tabla-compacta th:nth-child(4),
.tabla-compacta td:nth-child(4) {
    width: 115px;
}

/* Tipo */
.tabla-compacta th:nth-child(5),
.tabla-compacta td:nth-child(5) {
    width: 110px;
}

/* Medida */
.tabla-compacta th:nth-child(6),
.tabla-compacta td:nth-child(6) {
    width: 85px;
}

/* Longitud */
.tabla-compacta th:nth-child(7),
.tabla-compacta td:nth-child(7) {
    width: 65px;
}

/* Material */
.tabla-compacta th:nth-child(8),
.tabla-compacta td:nth-child(8) {
    width: 65px;
}

/* Color */
.tabla-compacta th:nth-child(9),
.tabla-compacta td:nth-child(9) {
    width: 70px;
}

/* Presentación */
.tabla-compacta th:nth-child(10),
.tabla-compacta td:nth-child(10) {
    width: 90px;
}

/* Unidad */
.tabla-compacta th:nth-child(11),
.tabla-compacta td:nth-child(11) {
    width: 55px;
}

/* Descripción */
.tabla-compacta th:nth-child(12),
.tabla-compacta td:nth-child(12) {
    min-width: 190px;
    max-width: 240px;
}

/* Moneda */
.tabla-compacta th:nth-child(13),
.tabla-compacta td:nth-child(13) {
    width: 55px;
}

/* Precios */
.tabla-compacta th:nth-child(14),
.tabla-compacta td:nth-child(14),
.tabla-compacta th:nth-child(15),
.tabla-compacta td:nth-child(15) {
    width: 75px;
}

/* Proveedor */
.tabla-compacta th:nth-child(16),
.tabla-compacta td:nth-child(16) {
    width: 100px;
}

/* Acción */
.tabla-compacta th:last-child,
.tabla-compacta td:last-child {
    min-width: 155px;
}

/* Mantener acciones juntas */
.tabla-compacta .acciones-tabla {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.tabla-compacta .acciones-tabla form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.tabla-compacta .cantidad-input {
    width: 43px;
    padding: 6px;
    font-size: 11px;
}

.tabla-compacta .btn-agregar,
.tabla-compacta .btn-eliminar {
    padding: 7px 9px;
    font-size: 11px;
    white-space: nowrap;
}

/* =================================
   RESUMEN FINAL
================================= */

.resumen-totales {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.total-card {
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 18px 25px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.total-card span {
    display: block;
    font-size: 13px;
    color: #667085;
    margin-bottom: 5px;
}

.total-card strong {
    display: block;
    font-size: 22px;
    color: #0d2a4d;
}

/* LOGO SIDEBAR */

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px 20px 10px;
}

.sidebar-logo img {
    width: 230px;
    max-width: 140%;
    height: auto;
    object-fit: contain;
}


/* =================================
   TARJETAS DEL INICIO CON IMÁGENES
================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;

    width: 100%;
    max-width: none;

    margin-top: 20px;
}

.card-categoria {
    padding: 0;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e4e7ec;
    min-height: 310px;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.card-categoria:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.card-imagen {
    width: 100%;
    height: 210px;
    display: block;
    object-fit: cover;
}

.card-info {
    padding: 18px 20px 20px;
}

.card-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0d2a4d;
}

.card-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #667085;
}


/* TABLET */
@media (max-width: 1100px) {

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* CELULAR */
@media (max-width: 700px) {

    .grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card-imagen {
        height: 190px;
    }

}


/* =================================
   INICIO - GRID ANCHO COMPLETO
================================= */

.content .grid {
    width: 100%;
    max-width: 1350px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    	gap: 32px 36px;

    margin: 22px auto 0 auto;
}

/* TARJETAS MÁS GRANDES */
.content .grid .card-categoria {
    width: 100%;
    max-width: none;
    min-width: 0;

    padding: 0;
    overflow: hidden;

    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e4e7ec;

    text-decoration: none;
    color: inherit;

    transition: 0.25s ease;
}


.content .grid .card-categoria:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}


/* IMAGEN GRANDE */
.content .grid .card-imagen {
    width: 110%;
    height: 210px;

    display: block;
    object-fit: cover;
}


/* TEXTO */
.content .grid .card-info {
    padding: 20px 22px 24px;
}


.content .grid .card-info h3 {
    margin: 0 0 8px;

    font-size: 19px;
    font-weight: 700;

    color: #0d2a4d;
}


.content .grid .card-info p {
    margin: 0;

    font-size: 14px;
    line-height: 1.5;

    color: #667085;
}


/* TABLET */
@media (max-width: 1100px) {

    .content .grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* CELULAR */
@media (max-width: 700px) {

    .content .grid {
        grid-template-columns: 1fr;
    }

    .content .grid .card-imagen {
        height: 200px;
    }

}