/* =========================================
   STYLE.CSS - LIBREMENTE
   Estilos Base con Identidad Institucional
   ========================================= */

/* =========================================
   RESET & GLOBAL CONFIG
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: #F5F7FA;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #1A1A1A;
}

/* =========================================
   HEADER
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6B4C7F 0%, #5A9E7F 100%);
    color: white;
    height: 70px;
    z-index: 1051;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px rgba(107, 76, 127, 0.2);
}

/* =========================================
   MAIN CONTENT
   ========================================= */
main {
    background-color: #F5F7FA;
    margin-top: 70px;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    padding-bottom: 80px;
    min-height: calc(100vh - 70px);
}

/* =========================================
   BUTTONS - ESTILO INSTITUCIONAL
   ========================================= */
button,
input[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, #6B4C7F 0%, #5A9E7F 100%);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(107, 76, 127, 0.25);
}

button:hover,
input[type="submit"]:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #5A3F6F 0%, #4A8B6F 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(107, 76, 127, 0.35);
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* =========================================
   SIDEBAR MODERNO - IDENTIDAD LIBREMENTE
   ========================================= */
.sidebar {
    background: linear-gradient(180deg, #6B4C7F 0%, #8B6B9F 100%);
    width: 220px;
    height: calc(100vh - 70px);
    position: fixed;
    top: 70px;
    left: 0;
    padding: 15px 8px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    z-index: 1050;
    color: #e8d5f0;
    font-size: 15px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    display: flex;
    margin-bottom: 20px;
    padding: 0 10px;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    text-align: left !important;
    color: #ffffff;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #e8d5f0;
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding-left: 18px;
    transform: translateX(2px);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(90, 158, 127, 0.3), rgba(255, 255, 255, 0.1));
    color: #ffffff;
    font-weight: 600;
    padding-left: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-menu a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15%;
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, #5A9E7F, #ffffff);
    border-radius: 0 4px 4px 0;
}

.sidebar-menu a.active i {
    color: #5A9E7F;
}

.close-btn {
    display: none;
    background: transparent;
    font-size: 1.5rem;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: left;
    padding: 0;
    background: linear-gradient(135deg, #F5F7FA 0%, #E9ECEF 100%);
    color: rgba(9, 9, 6, 1);
    font-size: 15px;
    position: relative;
    z-index: 100;
    margin-top: auto;
    border-top: 4px solid #6B4C7F;
}

/* =========================================
   FORMS - ESTILO INSTITUCIONAL
   ========================================= */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    padding: 12px 16px;
    border: 2px solid #DEE2E6;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6B4C7F;
    box-shadow: 0 0 0 4px rgba(107, 76, 127, 0.1);
    outline: none;
}

/* =========================================
   ANIMATIONS
   ========================================= */
.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 10px 15px;
    }

    .sidebar {
        transform: translateX(-100%);
        top: 0;
        height: 100vh;
        z-index: 1100;
        padding-top: 70px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
    }

    main, .content {
        margin-left: 0 !important;
        margin-top: 70px;
    }

    footer {
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    .sidebar-menu a {
        font-size: 14px;
        padding: 8px 12px;
    }

    header h1 {
        font-size: 1rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 8px 16px;
    }

    footer {
        font-size: 14px;
    }
}

/* =========================================
   HEADER: LOGOUT BUTTON
   ========================================= */
.logout-btn-wrapper {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .logout-btn-wrapper {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .logout-btn-wrapper .btn {
        width: 100%;
        justify-content: center;
        font-size: 15px;
        padding: 10px;
    }
}

.input-group-text i {
    font-size: 1.1rem;
    line-height: 1;
}

.input-group-text {
    padding: 0.756rem 0.75rem;
    display: flex;
    align-items: center;
    height: 100%;
    background: linear-gradient(135deg, #F0E6F5 0%, #E8F5E9 100%);
    border: 2px solid #DEE2E6;
    color: #6B4C7F;
}

.filtros-altos .form-control,
.filtros-altos .form-select {
    margin-bottom: 0 !important;
}

.filtros-altos .btn {
    align-self: flex-end;
    margin-bottom: 0 !important;
}

/* =========================================
   BOTONES ACCIÓN - ESTILO PLATEADO
   ========================================= */
#tablaProductos .btn,
#tablaProductosInactivos .btn,
#tablaMesas .btn,
#tablaTarifas .btn,
#tablaProveedores .btn,
#tablaProveedoresInactivos .btn,
#tablaCompras .btn,
#tablaCuentas .btn,
#tablaAlquileres .btn {
    background: linear-gradient(180deg, #f1f3f5, #dcdfe3) !important;
    color: #343a40 !important;
    border: 1px solid #bfc4ca !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.2s ease-in-out;
    padding: 6px 10px;
    border-radius: 8px;
}

#tablaProductos .btn i,
#tablaProductosInactivos .btn i,
#tablaMesas .btn i,
#tablaTarifas .btn i,
#tablaProveedores .btn i,
#tablaProveedoresInactivos .btn i,
#tablaCompras .btn i,
#tablaCuentas .btn i,
#tablaAlquileres .btn i {
    color: #6B4C7F !important;
    font-size: 1rem;
}

#tablaProductos .btn:hover,
#tablaProductosInactivos .btn:hover,
#tablaMesas .btn:hover,
#tablaTarifas .btn:hover,
#tablaProveedores .btn:hover,
#tablaProveedoresInactivos .btn:hover,
#tablaCompras .btn:hover,
#tablaCuentas .btn:hover,
#tablaAlquileres .btn:hover {
    background: linear-gradient(180deg, #6B4C7F, #5A9E7F) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 76, 127, 0.3);
}

#tablaProductos .btn:hover i,
#tablaProductosInactivos .btn:hover i,
#tablaMesas .btn:hover i,
#tablaTarifas .btn:hover i,
#tablaProveedores .btn:hover i,
#tablaProveedoresInactivos .btn:hover i,
#tablaCompras .btn:hover i,
#tablaCuentas .btn:hover i,
#tablaAlquileres .btn:hover i {
    color: #ffffff !important;
}

/* =========================================
   TEXTAREA PRINCIPAL
   ========================================= */
textarea.altura-grande {
    min-height: 180px !important;
    font-size: 1.1rem !important;
    font-weight: 500;
    line-height: 1.5;
    padding: 16px !important;
    resize: vertical;
    background-color: #fdfefe;
}

textarea.altura-grande:focus {
    border-color: #6B4C7F !important;
    box-shadow: 0 0 0 4px rgba(107, 76, 127, 0.15) !important;
}

/* =========================================
   MODAL PROFESIONAL
   ========================================= */
#modalBuscarProducto .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    background-color: #f8f9fa;
}

#modalBuscarProducto .modal-header,
#modalBuscarProducto .modal-footer {
    background: linear-gradient(135deg, #F0E6F5 0%, #E8F5E9 100%);
    border-color: #dee2e6;
    padding: 1.2rem 1.5rem;
}

#modalBuscarProducto .modal-title {
    color: #6B4C7F;
    font-weight: 700;
}

#modalBuscarProducto .modal-body {
    padding: 1.5rem;
    background-color: #f8f9fa;
}

#modalBuscarProducto .btn-close {
    filter: brightness(0);
}

.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================
   SweetAlert estilo institucional
   ========================================= */
.swal2-border-radius {
    border-radius: 16px !important;
    padding: 1.5rem !important;
}

.swal2-actions {
    gap: 14px !important;
    margin-top: 18px !important;
}

.swal-btn-confirm,
.swal-btn-cancel {
    min-width: 140px;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Poppins', sans-serif;
}

.swal-btn-confirm {
    background: linear-gradient(135deg, #6B4C7F, #5A9E7F);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(107, 76, 127, 0.3);
}

.swal-btn-confirm:hover {
    background: linear-gradient(135deg, #5A3F6F, #4A8B6F);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 76, 127, 0.4);
}

.swal-btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.swal-btn-cancel:hover {
    background-color: #e5e7eb;
    color: #111827;
    transform: translateY(-2px);
}

.swal-btn-confirm:focus-visible,
.swal-btn-cancel:focus-visible {
    box-shadow: 0 0 0 4px rgba(107, 76, 127, 0.3);
}