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

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

/* =======================
   HEADER
========================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 10px 20px;
    background-color: #6b4c7f;
    color: white;
    height: 60px;
    z-index: 1051;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* =======================
   MAIN CONTENT
========================== */
main {
    background-color: #e8e8e8;
    margin-top: 60px;
    padding: 20px;
    border-radius: 10px;
    padding-bottom: 80px;
}

/* =======================
   BUTTONS
========================== */
button,
input[type="submit"] {
    background-color: #5a9e7f;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover,
input[type="submit"]:hover {
    background-color: #4a8b6f;
}

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

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

/* =========================================
   HEADER - IDENTIDAD Libremente
   ========================================= */

.header-pos-logo {
    font-size: 1.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-separator {
    color: #5a9e7f;
    font-weight: 500;
}

.header-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.85;
    align-self: flex-end;
    margin-bottom: 2px;
}

/* =======================
   SIDEBAR MODERNO
========================== */

.sidebar {
    background: linear-gradient(180deg, #6b4c7f, #8b6b9f);
    width: 200px;
    height: calc(100vh - 60px);
    position: fixed;
    top: 60px;
    left: 0;
    padding: 10px 6px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    z-index: 1050;
    color: #e8d5f0;
    font-size: 15px;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    display: flex;
    margin-bottom: 15px;
}

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

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

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

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 2px;
    color: #e8d5f0;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0;
    transition: 
        background-color 0.25s ease,
        color 0.25s ease,
        padding-left 0.25s ease,
        transform 0.25s ease;
}

.sidebar-menu a i {
    font-size: .8rem;
}

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

.sidebar-menu a.active {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.45),
        rgba(255, 255, 255, 0.15)
    );
    color: #ffffff;
    font-weight: 500;
    padding-left: 10px;
    box-shadow:
        inset 0 0 0 rgba(0,0,0,0),
        0 2px 6px rgba(0,0,0,0.12);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.sidebar-menu a.active i {
    color: #5a9e7f;
    font-size: 0.95rem;
}

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

.sidebar-menu a {
    position: relative;
}

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

/* =======================
   FOOTER
========================== */
footer {
    text-align: left;
    padding: 0;
    background-color: rgba(170, 170, 170, 0.56);
    color: rgba(9, 9, 6, 1);
    font-size: 15px;
    position: relative;
    z-index: 100;
    margin-top: auto;
}

/* =======================
   FORMS
========================== */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6b4c7f;
    box-shadow: 0 0 0 0.2rem rgba(107, 76, 127, 0.25);
    outline: none;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    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: 60px;
    }

    .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: 6px 10px;
    }

    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: 8px;
  }
}

.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%;
}

.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 CON ICONOS PÚRPURA
==================================================== */

#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: 4px 8px;
    border-radius: 6px;
}

#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, #e9ecef, #ced4da) !important;
    color: #212529 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

#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: #8b6b9f !important;
}

#tablaProductos .btn-danger:hover,
#tablaProductosInactivos .btn-danger:hover,
#tablaMesas .btn-danger:hover,
#tablaTarifas .btn-danger:hover,
#tablaProveedores .btn-danger:hover,
#tablaProveedoresInactivos .btn-danger:hover,
#tablaCompras .btn-danger:hover,
#tablaCuentas .btn-danger:hover,
#tablaAlquileres .btn-danger:hover {
    background: linear-gradient(180deg, #dee2e6, #adb5bd) !important;
}

#tablaProductos .btn-primary:hover,
#tablaProductosInactivos .btn-primary:hover,
#tablaMesas .btn-primary:hover,
#tablaTarifas .btn-primary:hover,
#tablaProveedores .btn-primary:hover,
#tablaProveedoresInactivos .btn-primary:hover,
#tablaCompras .btn-primary:hover,
#tablaCuentas .btn-primary:hover,
#tablaAlquileres .btn-primary:hover {
    background: linear-gradient(180deg, #e7f1ff, #cfe2ff) !important;
}

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

textarea.altura-grande:focus {
    border-color: #6b4c7f !important;
    box-shadow: 0 0 0 0.25rem rgba(107, 76, 127, 0.35) !important;
}

/* =======================================================
   ESTILOS PARA MODAL PROFESIONAL
======================================================= */

#modalBuscarProducto .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background-color: #f8f9fa;
}

#modalBuscarProducto .modal-header,
#modalBuscarProducto .modal-footer {
    background-color: #cfece8;
    border-color: #dee2e6;
    padding: 1.2rem 1.5rem;
}

#modalBuscarProducto .modal-title {
    color: #343a40;
    font-weight: 600;
}

#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 profesional */
.swal2-border-radius {
    border-radius: 12px !important;
    padding: 1.5rem !important;
}

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

.swal-btn-confirm,
.swal-btn-cancel {
    min-width: 140px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.25s ease;
    border: none;
}

.swal-btn-confirm {
    background-color: #6b4c7f;
    color: #fff;
}

.swal-btn-confirm:hover {
    background-color: #5a3f6f;
    transform: translateY(-1px);
}

.swal-btn-cancel {
    background-color: #d6d8db;
    color: #333;
}

.swal-btn-cancel:hover {
    background-color: #c2c5c9;
    transform: translateY(-1px);
}

.swal-btn-confirm {
    background: linear-gradient(135deg, #6b4c7f, #5a3f6f);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(107, 76, 127, 0.2), 0 2px 4px -1px rgba(107, 76, 127, 0.1);
}

.swal-btn-confirm:hover {
    background: linear-gradient(135deg, #5a3f6f, #4a335a);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(107, 76, 127, 0.3), 0 4px 6px -2px rgba(107, 76, 127, 0.1);
}

.swal-btn-confirm:active {
    transform: translateY(0);
}

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

.swal-btn-cancel:hover {
    background-color: #e5e7eb;
    color: #111827;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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