/* Reset básico */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    color: #212529;
}

/* Títulos */
h2 {
    margin-top: 20px;
    font-size: 30px;
    color: #343a40;
    text-align: center;
}

/* Botón general */
button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin: 10px 0;
    transition: background-color 0.3s ease;
}
button:hover {
    background-color: #0056b3;
}

/* Tabla general */
table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.1);
}
table th, table td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: center;
    font-size: 14px;
}
table th {
    background-color: #e9ecef;
    color: #495057;
}

/* Scroll horizontal si se desborda */
.table-container {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 10px;
}

/* Modal */
#modalProducto {
    display: none;
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    animation: fadeIn 0.4s ease-in-out;
}

/* Inputs y select */
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
}

/* Mensajes */
.success-message {
    color: #198754;
    font-weight: bold;
    margin-bottom: 10px;
}
.error-message {
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Botón cancelar */
button.cancelar {
    background-color: #6c757d;
}
button.cancelar:hover {
    background-color: #5a6268;
}

/* Botón actualizar */
#btnActualizar {
    background-color: #17a2b8;
}
#btnActualizar:hover {
    background-color: #138496;
}

/* Visor QR */
#preview {
    margin-top: 10px;
}

/* Animación entrada */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive modal */
@media screen and (max-width: 500px) {
    #modalProducto {
        width: 90%;
        padding: 20px;
    }
}

/* Botón Devolver */
.btn-devolver {
    background-color: #28a745;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-devolver:hover {
    background-color: #218838;
}

/* Botón Devuelto */
.btn-devuelto {
    background-color: #6c757d;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Estados */
.estado-pendiente {
    background-color: #ffc107;
    color: #212529;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
}
.estado-devuelto {
    background-color: #17a2b8;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
}

/* Alerta flotante */
.alerta {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #198754;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 15px;
    animation: aparecer 0.4s ease-out;
}
@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contenedor principal */
.contenido-principal {
    margin-left: 200px;
    padding: 20px;
    max-width: 1200px;
    margin-top: 20px;
}
@media (max-width: 768px) {
    .contenido-principal {
        margin-left: 0;
        padding: 15px;
        max-width: 100%;
    }
}

/* Botón QR */
.btn-qr {
    background-color: #0d6efd;
    color: white;
    padding: 6px 10px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-qr:hover {
    background-color: #0b5ed7;
}

/* Botón Registrar */
.btn-registrar {
    background-color: #198754;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-registrar:hover {
    background-color: #157347;
}

.form-grid {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}

.form-grid label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.form-grid input[type="text"],
.form-grid input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-registrar {
    margin-top: 15px;
    background-color: #28a745;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-registrar:hover {
    background-color: #218838;
}

.table-container {
    margin-top: 30px;
    overflow-x: auto;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th,
.table-container td {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.table-container thead {
    background-color: #f1f1f1;
}

.btn-devolver {
    background-color: #dc3545;
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-devolver:hover {
    background-color: #c82333;
}

.btn-add {
    background-color: #198754;
    color: white;
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px 0;
    float: right;
    transition: background-color 0.3s ease;
}

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

/* Menú lateral con submódulos */
.sidebar {
    width: 200px;
    background-color: #343a40;
    color: white;
    position: fixed;
    height: 100%;
    padding-top: 20px;
}

.sidebar a {
    display: block;
    padding: 10px 20px;
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
}

.sidebar a:hover {
    background-color: #495057;
    color: #fff;
}

.sidebar .submenu {
    display: none;
    padding-left: 20px;
    background-color: #3e444a;
}

.sidebar .submenu a {
    padding: 8px 20px;
    font-size: 13px;
    color: #ccc;
}

.sidebar .menu-toggle.active + .submenu {
    display: block;
}

.menu-toggle {
    cursor: pointer;
}

#modalTipo {
    display: none;
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    animation: fadeIn 0.4s ease-in-out;
}

#modalTipo .modal-content {
    position: relative;
}

#modalTipo .close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
}
#modalTipo .close-modal:hover {
    color: #a71d2a;
}

#modalProducto {
    display: none;
    position: fixed;
    top: 8%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

/* Asegura que los inputs estén habilitados */
#modalProducto input,
#modalProducto select {
    opacity: 1 !important;
    pointer-events: auto !important;
}
