/* Animación cartoon para letras del logo en login */
.logo-letters-anim {
    min-height: 36px;
    margin-bottom: 0.5rem;
    text-align: center;
    user-select: none;
    width: 100%;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.08em;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 1.15rem;
    max-width: 100%;
}
/* --- Login Modern Glassmorphism & Animaciones Futuristas --- */
.login-modern-glass {
    background: rgba(255,255,255,0.18);
    box-shadow: 0 8px 32px 0 rgba(31,38,135,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1.5px solid rgba(74,144,226,0.18);
    position: relative;
    overflow: hidden;
    animation: loginGlassFadeIn 1.2s cubic-bezier(.77,0,.18,1);
}

@keyframes loginGlassFadeIn {
    0% { opacity: 0; transform: translateY(60px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-anim {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 0 12px #4A90E2aa);
}

.login-title-futuristic {
    font-family: 'Orbitron', 'Poppins', 'Roboto', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.12em;
    color: var(--primary-color);
    text-shadow: 0 2px 16px #4A90E233, 0 1px 0 #fff;
    margin-bottom: 2.2rem;
    animation: titleFadeIn 1.2s 0.2s backwards cubic-bezier(.77,0,.18,1);
}

@keyframes titleFadeIn {
    0% { opacity: 0; transform: translateY(-30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.btn-login-anim {
    background: linear-gradient(90deg, #4A90E2 0%, #357ABD 100%);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.35), 0 1.5px 0 #fff inset;
    border: none;
    color: #fff;
    font-family: 'Orbitron', 'Poppins', 'Roboto', sans-serif;
    font-size: 1.18rem;
    letter-spacing: 0.09em;
    border-radius: 9999px;
    transition: all 0.25s cubic-bezier(.77,0,.18,1), box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}
.btn-login-anim.btn-pressed {
    transform: scale(0.97);
    box-shadow: 0 2px 8px #4A90E2aa;
}
.btn-login-anim:hover {
    background: linear-gradient(90deg, #357ABD 0%, #4A90E2 100%);
    box-shadow: 0 16px 32px #4A90E255, 0 1.5px 0 #fff inset;
    filter: brightness(1.08);
    transform: translateY(-2px) scale(1.03);
}

.form-group.focused label {
    color: var(--primary-color);
    letter-spacing: 0.09em;
    font-weight: 700;
    text-shadow: 0 0 8px #4A90E233;
    transition: all 0.18s cubic-bezier(.77,0,.18,1);
}
.form-group.focused .form-control {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px #4A90E233, 0 1px 3px #4A90E211 inset;
    background: #fff;
    transition: all 0.18s cubic-bezier(.77,0,.18,1);
}
/* =========================================
   Modern & Elegant Stylesheet for GTS_DLX
   ========================================= */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- Modern Color Palette & Variables --- */
:root {
    --primary-color: #4A90E2;       /* A calmer, more professional blue */
    --primary-hover-color: #357ABD;
    --secondary-color: #2c3e50;     /* A deep, neutral navy */
    --accent-color: #f39c12;        /* A warm accent for highlights */
    --background-color: #f7f8fc;   /* A very light, clean gray */
    --content-bg-color: #ffffff;
    --text-color: #34495e;          /* A softer, less harsh black */
    --text-light-color: #ffffff;
    --border-color: #e8e8e8;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* --- OVERRIDE para asegurar el correcto posicionamiento del main-content-wrapper --- */
#mainContentWrapper {
    margin-left: 250px !important; /* Initial margin for open sidebar */
    width: calc(100% - 250px) !important; /* Adjust width based on sidebar */
}

#sidebar.collapsed + #mainContentWrapper {
    margin-left: 70px !important; /* Adjust margin for collapsed sidebar */
    width: calc(100% - 70px) !important;
}
/* --- FIN OVERRIDE --- */

/* --- Global Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    font-weight: 400;
}

/* --- New Layout with Sidebar --- */
.page-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden; /* Prevent content overflow */
}

.sidebar {
    width: 250px;
    background-color: #000000;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
    z-index: 1000;
    padding-bottom: 3.5rem; /* Espacio para el footer animado */
}

.sidebar.collapsed {
    width: 70px; /* Collapsed width */
}

.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: space-between; /* Distribute logo and toggle button */
    align-items: center;
    min-height: 70px; /* Consistent height */
    width: 100%;
}

.sidebar.collapsed .sidebar-header {
    padding: 0.5rem; /* Reduced padding for collapsed state */
    justify-content: center; /* Center the toggle button */
}

.sidebar-logo {
    color: var(--text-light-color);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.18);
    border-radius: 9px;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-logo-accent {
    font-weight: 400;
    opacity: 0.65;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    width: 0;
    padding: 0; /* Ensure no residual space */
    margin: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-light-color); /* Changed to white */
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: block;
    transition: color var(--transition-speed) ease;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0;
}

.sidebar.collapsed .sidebar-nav {
    padding: 0.5rem 0; /* Reduced padding for collapsed nav */
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 1rem 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.8rem 1.2rem;
    color: var(--text-light-color); /* Changed to white */
    text-decoration: none;
    font-weight: 500;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease, padding var(--transition-speed) ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-nav li a {
    justify-content: center; /* Center icons */
    padding: 0.8rem 0; /* Minimal padding when collapsed */
}

.sidebar-nav li a i {
    margin-right: 1rem;
    font-size: 1.2rem;
    width: 20px; /* Fixed width for icons */
    text-align: center;
}

.sidebar.collapsed .sidebar-nav li a i {
    margin-right: 0; /* Remove margin when collapsed */
}

.sidebar-nav li a span {
    transition: opacity var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-nav li a span {
    opacity: 0;
    width: 0;
    display: none; /* Ensure it's hidden */
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: #ffffff;
    color: #000000;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.sidebar.collapsed .sidebar-header .sidebar-toggle {
    /* Restore its own padding for visibility */
    padding: 0.5rem !important;
}

/* Main Content Area */
.content {
    flex-grow: 1; /* Allow content to grow */
    padding: 2rem; /* Add padding around the content */
    position: relative;
    z-index: 1;
}

/* --- New Sidebar User Profile --- */
.sidebar-user-profile {
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-light-color);
    margin-top: auto; /* Empuja el perfil de usuario hacia abajo */
}

.sidebar.collapsed .sidebar-user-profile {
    display: none !important; /* Hide completely when collapsed */
}

.sidebar-user-profile .user-avatar {
    width: 60px;
    height: 60px;
    background-color: #3b4d66; /* A slightly lighter dark blue */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--text-light-color);
    margin-bottom: 0.5rem;
}

/* Fallback/Generic icon style */
.sidebar-user-profile .user-avatar i {
    font-size: 2rem; /* Ensure Font Awesome icon is large */
}

.sidebar-user-profile .user-greeting {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-user-profile .btn-edit-account {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    width: 100%; /* Make button full width in sidebar */
    max-width: 150px; /* Limit width */
}

.sidebar-user-profile .btn-edit-account:hover {
    background-color: #e0e0e0;
    color: #000000;
}

.sidebar-user-profile .logout-button {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color var(--transition-speed) ease;
}

.sidebar-user-profile .logout-button:hover {
    color: var(--text-light-color);
}


/* --- Modal Styles --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Optional: blur background */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    padding-top: 60px; /* Location of the modal content */
}

.modal-content {
    background-color: var(--content-bg-color);
    margin: 5% auto; /* 5% from the top and centered */
    padding: 2.5rem;
    border: none;
    border-radius: var(--border-radius);
    width: 90%; /* Could be more responsive */
    max-width: 600px;
    box-shadow: var(--shadow);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

/* Animation for modal */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.modal-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.modal-header .close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-header .close-button:hover,
.modal-header .close-button:focus {
    color: var(--danger-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.modal-body p strong {
    color: var(--secondary-color);
}

.modal-body form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.modal-body form input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #fdfdfd;
}

.modal-body form .btn-primary {
    width: auto;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    margin-top: 1rem;
}

#signaturePreview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

#signaturePreview img {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px;
    background-color: #fff;
}

#noSignatureText {
    color: #7f8c8d;
    font-style: italic;
    margin-top: 10px;
}

.modal-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.modal-footer .btn-secondary {
    width: auto;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
}

/* --- Rediseño exclusivo modal estándar (no gerencia) --- */
#editAccountModal.modal-standard {
    background: radial-gradient(circle at 20% 20%, rgba(20, 20, 20, 0.28), rgba(0, 0, 0, 0.62));
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

#editAccountModal.modal-standard .modal-content {
    max-width: 700px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.26);
    overflow: hidden;
    padding: 0;
}

#editAccountModal.modal-standard .modal-header {
    margin: 0;
    padding: 1rem 1.4rem;
    border-bottom: none;
    background: linear-gradient(135deg, #111 0%, #2b2b2b 100%);
}

#editAccountModal.modal-standard .modal-header h2 {
    color: #fff;
    letter-spacing: 0.02em;
    font-size: 1.25rem;
}

#editAccountModal.modal-standard .modal-header .close-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    transition: transform 0.15s ease, background-color 0.2s ease;
}

#editAccountModal.modal-standard .modal-header .close-button:hover,
#editAccountModal.modal-standard .modal-header .close-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
}

#editAccountModal.modal-standard .modal-body {
    padding: 1.4rem;
    margin-bottom: 0;
    background: linear-gradient(180deg, #f7f8fb 0%, #fff 100%);
}

#editAccountModal.modal-standard .modal-body > p {
    margin: 0 0 0.6rem;
    padding: 0.58rem 0.8rem;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    background: #fff;
}

#editAccountModal.modal-standard .modal-body > p strong {
    color: #111;
    min-width: 140px;
    display: inline-block;
}

#editAccountModal.modal-standard #singleSignatureSection > p {
    margin: 1rem 0 0.65rem;
    font-weight: 700;
    color: #111;
}

#editAccountModal.modal-standard .signature-manager {
    border: 1px solid #dbe0ea;
    border-radius: 14px;
    background: #fff;
    padding: 1rem;
}

#editAccountModal.modal-standard .signature-preview-box {
    border: 2px solid #b7bfcd;
    border-radius: 12px;
    background: #fbfcff;
    padding: 1.5rem;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#editAccountModal.modal-standard .current-signature-img {
    max-height: 180px;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
}

#editAccountModal.modal-standard .upload-signature-form {
    margin-top: 0.9rem;
}

#editAccountModal.modal-standard .upload-signature-form input[type="file"] {
    border-radius: 10px;
    border: 1px solid #d3dae6;
    background: #f8faff;
}

#editAccountModal.modal-standard .upload-signature-form .btn-primary {
    width: 100%;
    margin-top: 0.25rem;
    border-radius: 10px;
    background: #111;
    border-color: #111;
    color: #fff;
    font-weight: 700;
}

#editAccountModal.modal-standard .upload-signature-form .btn-primary:hover,
#editAccountModal.modal-standard .upload-signature-form .btn-primary:focus {
    background: #262626;
    border-color: #262626;
}

#editAccountModal.modal-standard #uploadStatusMessage {
    margin-top: 0.7rem !important;
    min-height: 1.2rem;
    font-weight: 600;
    color: #2f3d56;
}

#editAccountModal.modal-standard .modal-footer {
    margin: 0;
    padding: 1rem 1.4rem;
    background: #fff;
    border-top: 1px solid #e5e8f0;
}

#editAccountModal.modal-standard .modal-footer .btn-secondary {
    border-radius: 10px;
    background: #f0f2f7;
    border-color: #d8dcea;
    color: #1f2a3d;
    font-weight: 700;
}

#editAccountModal.modal-standard .modal-footer .btn-secondary:hover {
    background: #e6eaf2;
}

/* Estilos para Carrusel de Firmas (Gerencia) */
#editAccountModal.modal-gerencia .modal-body {
    padding: 2rem;
}

#editAccountModal.modal-gerencia .signature-carousel {
    gap: 15px !important;
    min-height: 350px;
}

#editAccountModal.modal-gerencia #activeSignatureContainer {
    background: white !important;
    border-radius: 15px;
    padding: 2rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#editAccountModal.modal-gerencia .signature-manager {
    background: white;
    padding: 1.5rem;
}

#editAccountModal.modal-gerencia .signature-preview-box {
    border: 2px solid #b7bfcd;
    border-radius: 12px;
    background: #fbfcff;
    padding: 2rem 1.5rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

#editAccountModal.modal-gerencia .current-signature-img {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

#editAccountModal.modal-gerencia .upload-signature-form input[type="file"] {
    margin-bottom: 1rem;
}

/* Responsive adjustments for modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    .modal-header h2 {
        font-size: 1.2rem;
    }
    .modal-body p {
        font-size: 0.9rem;
    }

    #editAccountModal.modal-standard .modal-content {
        padding: 0;
        max-width: 96%;
    }

    #editAccountModal.modal-standard .modal-body {
        padding: 1rem;
    }

    #editAccountModal.modal-standard .modal-header,
    #editAccountModal.modal-standard .modal-footer {
        padding: 0.85rem 1rem;
    }
}
/* --- Elegant Form Styles (Login, etc.) - MODERN FUTURISTIC --- */
.form-container {
    max-width: 450px;
    margin: 5rem auto;
    padding: 3rem;
    background-color: var(--content-bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative; /* Para posibles pseudoelementos o efectos */
    overflow: hidden; /* Para contener efectos de borde */
}

.form-container h1 {
    margin-bottom: 2.5rem;
    color: var(--secondary-color);
    font-weight: 700; /* Más audaz */
    font-size: 2.2rem; /* Más grande */
    letter-spacing: 0.05em; /* Espaciado futurista */
    text-shadow: 0 0 5px rgba(74, 144, 226, 0.4); /* Efecto sutil */
}

.form-group {
    margin-bottom: 1.8rem; /* Mayor espacio entre grupos */
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary-color);
    text-transform: uppercase; /* Para un look más moderno */
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 1.1rem 1.4rem; /* Más padding */
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Más redondeado */
    font-size: 1.05rem;
    background-color: #fdfdfd;
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.08); /* Sombra de enfoque y interna */
    background-color: #fff;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 1.2rem 1.5rem; /* Más padding */
    border: none;
    border-radius: 9999px; /* Botón tipo píldora */
    background-color: var(--primary-color);
    color: var(--text-light-color);
    font-size: 1.15rem; /* Más grande */
    font-weight: 700; /* Más audaz */
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3); /* Sombra más pronunciada */
    letter-spacing: 0.05em; /* Espaciado para futurismo */
    text-transform: uppercase;
}

.btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-3px) scale(1.02); /* Efecto de "levantar" y crecer */
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.4); /* Sombra aún más pronunciada */
}

.btn-secondary {
    background-color: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
    border-radius: 9999px; /* También píldora */
}
.btn-secondary:hover {
    background-color: #1a2531;
    box-shadow: 0 12px 30px rgba(44, 62, 80, 0.4);
}

/* --- Main Content Wrapper --- */
.main-content-wrapper {
    flex-grow: 1;
    min-width: 0;
}

/* --- Floating Sidebar Toggle (Mobile) --- */
.sidebar-float-toggle {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: var(--secondary-color);
    color: var(--text-light-color);
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    cursor: pointer;
}

.sidebar-float-toggle:hover {
    background-color: var(--primary-hover-color);
}

/* Overlay para sidebar en móviles */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- Responsive Layout --- */
@media (max-width: 1100px) {
    .content {
        padding: 1.5rem;
    }
    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .content {
        padding: 1.2rem;
    }
    .form-row {
        flex-direction: column;
    }
    .form-group {
        min-width: 100% !important;
    }
    .acceptance-section {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    .approval-actions.center-actions-clean {
        flex-direction: column;
        gap: 1.25rem;
    }
}

@media (max-width: 700px) {
    .list-container .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .list-container .list-header .btn.btn-primary {
        width: 100% !important;
    }
    .card {
        padding: 1.25rem;
    }
    .card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .material-details {
        overflow-x: auto;
    }
    .material-items-header,
    .material-item-row {
        min-width: 640px;
    }
}

@media (max-width: 600px) {
    #mainContentWrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-float-toggle {
        display: inline-flex;
    }
}

/* ========================================= 
   RESPONSIVE DESIGN - MOBILE FIRST
   ========================================= */

/* Tablets y pantallas medianas (768px - 1024px) */
@media (max-width: 1024px) {
    .page-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .content {
        padding: 1.5rem 1rem;
    }
    
    /* Tablas responsive con scroll horizontal */
    .table-scroll,
    .table-scroll-logistica {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 800px;
    }
    
    /* Filtros responsive */
    .table-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: 100%;
    }
}

/* Móviles (hasta 768px) */
@media (max-width: 768px) {
    /* Sidebar mobile */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar-float-toggle {
        display: inline-flex !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 999;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    #mainContentWrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    main {
        padding: 1rem;
        padding-top: 4rem; /* Espacio para el botón hamburguesa */
    }
    
    /* Cabeceras de listas */
    .list-container .list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .list-container .list-header h1 {
        font-size: 1.75rem;
    }
    
    .list-container .list-header .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Tarjetas */
    .card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    /* Tablas - forzar scroll horizontal */
    .table-scroll,
    .table-scroll-logistica,
    .card table {
        overflow-x: auto;
        display: block;
    }
    
    table {
        min-width: 700px;
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.4rem 0.6rem !important;
        white-space: nowrap;
    }
    
    /* Botones de acción más compactos */
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-log {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }
    
    /* Formularios responsive */
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-group {
        min-width: 100% !important;
        width: 100%;
    }
    
    /* Modales responsive */
    .modal-upload > div,
    .modal > div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto;
    }
    
    /* Filtros responsive */
    .table-filters {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .filter-select {
        font-size: 0.85rem;
    }
    
    /* Estados y badges */
    .status {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    /* Acciones de logística en columna */
    .logistica-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .list-container .list-header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    table {
        font-size: 0.75rem;
        min-width: 600px;
    }
    
    th, td {
        padding: 0.35rem 0.5rem !important;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.85rem;
    }
    
    .sidebar {
        width: 220px;
        left: -220px;
    }
    
    /* Login responsive */
    .login-modern-glass {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .login-title-futuristic {
        font-size: 1.75rem;
    }
    
    .form-control {
        font-size: 0.9rem;
    }
}

/* Landscape móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }
    
    main {
        padding-top: 3rem;
    }
    
    .footer-ticker {
        position: relative;
    }
}

/* Impresión */
@media print {
    .sidebar,
    .sidebar-float-toggle,
    .footer-ticker,
    .btn,
    .logistica-actions,
    .table-filters {
        display: none !important;
    }
    
    #mainContentWrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    main {
        padding: 0;
    }
    
    table {
        page-break-inside: avoid;
    }
}

/* Sidebar Dropdown Styles */
.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-dropdown-toggle .dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    max-height: 400px;
}

.sidebar-dropdown-menu li a {
    padding-left: 2.5rem !important;
    font-size: 0.9rem;
    opacity: 0.9;
}

.sidebar-dropdown-menu li a:hover {
    opacity: 1;
}