/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Botón global en la tabla */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animación shake duplicada eliminada - se mantiene la definición de la línea 26 */

.shake-animation {
    animation: shake 0.8s ease-in-out;
    will-change: transform;
}

/* Estilos para el modal de notas estructurado */
.nota-detail-container {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    max-height: 70vh;
    overflow-y: auto;
}

.seccion-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seccion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.seccion-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e9ecef;
}

.seccion-icono {
    font-size: 18px;
    display: inline-block;
    width: 24px;
    text-align: center;
}

.seccion-titulo {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seccion-content {
    padding: 16px;
}

.variable-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    gap: 10px;
}

.variable-item:last-child {
    border-bottom: none;
}

.variable-label {
    font-weight: 500;
    color: #495057;
    font-size: 13px;
    min-width: 40%;
    flex-shrink: 0;
}

.variable-value {
    color: #212529;
    font-size: 13px;
    text-align: right;
    word-break: break-word;
}

.variables-single .variable-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.variables-single .variable-value {
    text-align: left;
    font-weight: 600;
}

.seccion-adicional {
    border-left: 4px solid #6c757d !important;
}

.seccion-adicional .seccion-header {
    background-color: #6c757d15;
}

.seccion-adicional .seccion-titulo {
    color: #6c757d;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .nota-detail-container {
        padding: 15px;
    }
    
    .seccion-content {
        padding: 12px;
    }
    
    .variable-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .variable-value {
        text-align: left;
    }
    
    /* Responsive específico para sectores */
    .nota-detail-container-wide {
        width: 100% !important;
        padding: 10px;
    }
    
    .sector-a .col-md-6,
    .sector-b .col-md-6,
    .sector-d .col-md-6 {
        margin-bottom: 1rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    animation: fadeIn 0.8s ease-out;
}

.logo {
    width: 150px;
    height: auto;
    margin-bottom: 15px;
}

.welcome-text {
    color: #2c3e50;
    font-size: 24px;
    text-align: center;
    margin-bottom: 10px;
}

/* Estilos para el login */
.login-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s, box-shadow 0.3s;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-group select {
    cursor: pointer;
}

.form-group input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.password-container {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #3498db;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-login:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

.error-message {
    color: #e74c3c;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
    transition: all 0.3s;
    animation: shake 0.5s ease-in-out 0s 1 normal none running;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Highlight amarillo para nuevas entradas (clientes/PV) */
.new-entry-highlight {
    animation: newEntryFlash 2s ease-out;
    background-color: #fff3cd !important; /* Amarillo suave */
}

@keyframes newEntryFlash {
    0% { background-color: #fff9db; }
    50% { background-color: #ffe8a1; }
    100% { background-color: transparent; }
}

/* Estilos para la barra superior */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 32050;
    margin: 0;
    border-radius: 0;
}

/* Responsive para la barra superior */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
    }
    
    .container {
        padding-top: 80px;
    }
    
    .top-bar-left {
        gap: 10px;
    }
    
    .header-logo, .header-user-photo {
        width: 40px;
        height: 40px;
    }
    
    .system-title {
        font-size: 16px;
    }
    
    .user-details {
        font-size: 12px;
    }
    
    .user-initials {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    padding: 5px;
}

.header-user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: none;
}

.system-info {
    display: flex;
    flex-direction: column;
}

.system-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 0, 0, 0.3);
}

.user-details {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5), 0 0 6px rgba(0, 0, 0, 0.3);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-initials {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    background-color: #34495e !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-initials:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Estilos para el menú (compatibilidad) */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
}

#user-display {
    margin-right: 15px;
    font-weight: bold;
}

.btn-logout {
    padding: 8px 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c0392b;
}

.menu-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out;
}

.menu-header {
    margin-bottom: 40px;
}

.menu-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.menu-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 2px;
}

.menu-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin-top: 15px;
}

.menu-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    font-size: 18px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
    box-shadow: 0 10px 20px rgba(41, 128, 185, 0.2);
}

.menu-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.menu-btn-text {
    font-weight: bold;
    letter-spacing: 1px;
}

.menu-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(41, 128, 185, 0.3);
    background: linear-gradient(135deg, #2980b9, #1a5276);
}

/* Asegurar que el botón de logs tenga el mismo tamaño y color */
#btn-logs {
    min-width: 220px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 10px 20px rgba(41, 128, 185, 0.2);
}

#btn-logs:hover {
    background: linear-gradient(135deg, #2980b9, #1a5276);
    box-shadow: 0 15px 30px rgba(41, 128, 185, 0.3);
    transform: translateY(-8px);
}

/* Animación de spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        width: 120px;
    }
    
    .welcome-text {
        font-size: 20px;
    }
    
    /* Barra superior para tablets */
    .top-bar {
        flex-direction: row;
        padding: 12px 20px;
        justify-content: space-between;
        align-items: center;
        height: 80px;
    }
    
    .top-bar-left {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        flex: 1;
    }
    
    .header-logo,
    .header-user-photo {
        width: 50px;
        height: 50px;
    }
    
    .system-title {
        font-size: 18px;
    }
    
    .user-details {
        font-size: 14px;
    }
    
    /* Contenedor principal centrado */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        box-sizing: border-box;
        overflow-x: visible;
        padding-top: 100px;
    }
    
    /* Menú de botones en 2x2 */
    .menu-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 15px;
    }
    
    .menu-btn {
        width: 100%;
        padding: 18px 12px;
        margin-bottom: 0;
        box-sizing: border-box;
        min-height: 95px;
        min-width: 120px;
        max-width: none;
    }
    
    .menu-icon {
        font-size: 2.2em;
        margin-bottom: 8px;
    }
    
    .menu-btn-text {
        font-size: 0.85em;
    }
    
    /* Botón específico de logs en móvil */
    #btn-logs {
        min-height: 95px;
        min-width: 120px;
        max-width: none;
        padding: 18px 12px;
        background: linear-gradient(135deg, #3498db, #2980b9);
    }
    
    /* Centrar la barra superior */
    .top-bar {
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    /* Barra superior horizontal distribuida correctamente */
    .top-bar {
        flex-direction: row;
        padding: 10px 15px;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        height: 70px;
    }
    
    .top-bar-left {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex: 1;
    }
    
    /* Mostrar imagen del usuario o logo */
    .header-logo,
    .header-user-photo {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
    
    .system-title {
        display: none;
    }
    
    .user-details {
        font-size: 12px;
        margin-top: 0;
        font-weight: 600;
    }
    
    .top-bar-right {
        gap: 10px;
        display: flex;
        align-items: center;
    }
    
    .user-initials {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
    
    .btn-logout {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Ajustar padding del contenedor para la barra fija */
    .container {
        padding-top: 90px;
    }
    
    /* Menú de botones más compacto */
    .menu-container {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }
    
    .menu-buttons {
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .menu-btn {
        padding: 12px 8px;
        min-width: auto;
        box-sizing: border-box;
    }
    
    .menu-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .menu-btn-text {
        font-size: 11px;
        letter-spacing: 0;
    }
}

/* Estilos para la página de usuarios */
.usuarios-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px auto;
    max-width: 1200px;
    animation: fadeIn 0.8s ease-out;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title-container {
    flex: 1;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

/* Botón primario independiente */
.btn-primary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    min-width: 120px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #229954, #27ae60);
}

/* Botón secundario independiente */
.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    min-width: 120px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
}

.action-btn.btn-primary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.action-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #229954, #27ae60);
}

.action-btn.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.action-btn.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
}

/* Filtros */
.filters-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
}

/* Estilos consistentes para campos de filtro y búsqueda */
.filter-group select,
.filter-select,
.search-input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.filter-group select:focus,
.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.search-input {
    border-radius: 25px;
    padding: 10px 15px;
    border-width: 2px;
}

.filter-group select,
.filter-select {
    cursor: pointer;
    min-width: 120px;
}

/* Dropdown de sugerencias para filtros (cliente/vendedor) */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
}
.suggestions-dropdown .suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
.suggestions-dropdown .suggestion-item:hover,
.suggestions-dropdown .suggestion-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

/* Tabla responsive */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.users-table th {
    background: #f8f9fa;
    color: #495057;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #dee2e6;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.users-table tr:hover {
    background-color: #f8f9fa;
}

.actions-cell {
    white-space: nowrap;
}

.btn-action {
    padding: 6px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    background: #6c757d;
    color: white;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: #495057;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-action i {
    font-size: 14px;
    color: white;
}

/* Botones específicos con colores descriptivos */
.btn-view {
    background: #17a2b8 !important;
}

.btn-view:hover {
    background: #138496 !important;
}

.btn-edit {
    background: #ffc107 !important;
    color: #212529 !important;
}

.btn-edit:hover {
    background: #e0a800 !important;
    color: #212529 !important;
}

.btn-delete {
    background: #dc3545 !important;
}

.btn-delete:hover {
    background: #c82333 !important;
}

.btn-movements {
    background: #6f42c1 !important;
}

.btn-movements:hover {
    background: #5a32a3 !important;
}

/* Status badges */
.status-active {
    color: #27ae60;
    font-weight: 600;
}

.status-inactive {
    color: #e74c3c;
    font-weight: 600;
}

/* Foto de usuario */
.user-photo-container {
    position: relative;
    width: 45px;
    height: 45px;
}

.user-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: absolute;
    top: 0;
    left: 0;
}

.user-initials {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    background-color: #34495e !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-initials:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Upload de foto */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-input {
    display: none;
}

.photo-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.photo-preview:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.photo-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-photo {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: #6c757d;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-photo:hover {
    background: #495057;
    transform: translateY(-1px);
}

/* Estilos para el modal de recorte */
.crop-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-circle {
    width: 200px;
    height: 200px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(1px);
}

.crop-text {
    color: white;
    font-size: 14px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    padding: 10px;
}

.crop-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.crop-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.crop-controls input[type="range"] {
    width: 150px;
}

.crop-controls button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.crop-controls button:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

/* Responsive para modal de recorte en móvil */
@media (max-width: 768px) {
    .crop-container {
        margin-bottom: 15px;
    }
    
    .crop-circle {
        width: 150px;
        height: 150px;
    }
    
    .crop-text {
        font-size: 11px;
        padding: 5px;
    }
    
    .crop-controls {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .crop-controls label {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .crop-controls input[type="range"] {
        width: 200px;
    }
    
    .crop-controls button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Modal de detalles */
.user-detail-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.user-photo-section {
    flex-shrink: 0;
}

.user-photo-large {
    width: 120px;
    height: 120px;
    position: relative;
}

.user-photo-large-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    position: absolute;
    top: 0;
    left: 0;
}

.user-initials-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 36px;
    color: white;
    background-color: #34495e;
    border: 3px solid #3498db;
}

.user-info-section {
    flex: 1;
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.info-row label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 140px;
    margin-right: 15px;
}

.info-row span {
    color: #34495e;
    font-size: 16px;
}

/* Responsive para usuarios */
@media (max-width: 768px) {
    .usuarios-container {
        padding: 20px;
        margin: 10px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .page-title {
        font-size: 24px;
        justify-content: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 12px;
        min-width: 44px;
        justify-content: center;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .btn-action {
        padding: 4px 6px;
        margin: 0 1px;
        min-width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .user-detail-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .info-row {
        flex-direction: column;
        text-align: center;
    }
    
    .info-row label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .users-table {
        font-size: 11px;
    }
    
    .users-table th,
    .users-table td {
        padding: 6px 2px;
    }
    
    .btn-action {
        padding: 3px 4px;
        min-width: 24px;
        height: 24px;
        font-size: 9px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .action-btn {
        padding: 10px;
        font-size: 12px;
    }
}

/* ===== ESTILOS PARA PÁGINA DE LOGS ===== */
.logs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.logs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logs-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logs-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.logs-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.filters-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filters-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-filter {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-apply {
    background: #28a745;
    color: white;
}

.btn-apply:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-clear {
    background: #6c757d;
    color: white;
}

.btn-clear:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-export {
    background: #17a2b8;
    color: white;
}

.btn-export:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.logs-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.logs-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logs-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.logs-table tr:hover {
    background-color: #f8f9fa;
}

.timestamp {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

.action-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.action-login {
    background: #d4edda;
    color: #155724;
}

.action-logout {
    background: #f8d7da;
    color: #721c24;
}

.action-user-create {
    background: #d1ecf1;
    color: #0c5460;
}

.action-user-edit {
    background: #fff3cd;
    color: #856404;
}

.action-user-delete {
    background: #f5c6cb;
    color: #721c24;
}

.action-user-view {
    background: #e2e3e5;
    color: #383d41;
}

.action-module-access {
    background: #cce5ff;
    color: #004085;
}

.action-default {
    background: #e9ecef;
    color: #495057;
}

.user-info {
    font-weight: 600;
    color: #2c3e50;
}

.user-info small {
    display: block;
    font-weight: normal;
    color: #6c757d;
    font-size: 11px;
}

.log-details {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

.log-details small {
    color: #6c757d;
    font-size: 11px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.btn-pagination {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-pagination:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-data i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #495057;
}

.no-data p {
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive para logs */
@media (max-width: 1200px) {
    .logs-container {
        padding: 15px;
    }
    
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .logs-title {
        font-size: 24px;
    }
    
    .logs-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-actions {
        justify-content: center;
    }
    
    .logs-table {
        font-size: 12px;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 8px 6px;
    }
    
    .log-details {
        max-width: 200px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .logs-header {
        padding: 20px;
    }
    
    .logs-title {
        font-size: 20px;
    }
    
    .logs-stats {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        padding: 15px;
    }
    
    .logs-table {
        font-size: 11px;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 6px 4px;
    }
    
    .log-details {
        max-width: 150px;
    }
    
    .btn-filter {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Estilos generales para modales */
.modal {
    display: none;
    position: fixed;
    z-index: 100050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 15px; /* Reducido de 20px */
    border-radius: 8px; /* Reducido de 12px */
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); /* Reducido */
    animation: modalSlideIn 0.3s ease-out;
}

#globalTimbradoResultModal {
    z-index: 2147483647 !important;
}
#globalTimbradoResultModal .modal-content {
    margin: 2vh auto !important;
    max-width: 1600px !important;
    width: 98% !important;
    height: 96vh !important;
    max-height: 96vh !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    position: relative !important;
}
#globalTimbradoResultModal .modal-header {
    flex: 0 0 auto !important;
}
#globalTimbradoResultModal .modal-body {
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px !important;
    height: 100% !important;
}
#globalTimbradoResultModal .modal-body > div:last-child {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    height: 100% !important;
}
#globalTimbradoResultModal iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 8px !important;
    display: block !important;
}
#globalTimbradoResultModal .modal-body > div:last-child iframe {
    flex: 1 1 0% !important;
    min-height: 0 !important;
}

/* Modal extra ancho para notas detalladas */
.modal-content.modal-xl {
    max-width: 1400px;
    width: 95%;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    color: #ffffff;
}
.modal-header h3 {
    color: #ffffff;
}

.modal-body {
    padding: 12px;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 8px 8px;
}

.json-pretty {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Courier New", monospace;
    font-size: 13px;
    line-height: 1.4;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    max-height: 70vh;
    overflow: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive para modal extra ancho */
@media (max-width: 1400px) {
    .modal-content.modal-xl {
        width: 95%;
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .modal-content.modal-xl {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
    max-height: 100vh;
    }
}

.close {
    color: #ffffff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #ffffff;
    text-decoration: none;
}

/* Mensaje informativo en secciones de pago */
.payment-info-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1976d2;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}

.payment-info-message i {
    color: #2196f3;
    font-size: 16px;
}

.payment-info-message span {
    font-weight: 500;
}

/* Animaciones adicionales para sugerencias y transiciones */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================================================ */
/* ESTILOS PARA CERTIFICADOS SAT CON DRAG & DROP */
/* ============================================================================ */

.certificates-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.certificate-upload-zone {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.certificate-upload-zone:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.certificate-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
}

.certificate-header i {
    font-size: 18px;
    color: #007bff;
}

.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.drop-zone:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.drop-zone.drag-over {
    border-color: #28a745;
    background: #f8fff9;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-zone-content i {
    font-size: 32px;
    color: #6c757d;
    margin-bottom: 5px;
}

.drop-zone-content p {
    margin: 0;
    color: #495057;
    font-weight: 500;
}

.drop-zone-content span {
    color: #6c757d;
    font-size: 14px;
}

.btn-select-file {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-select-file:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.hidden-file-input {
    display: none;
}

.certificate-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.file-loaded {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #28a745;
}

.file-loaded i {
    font-size: 16px;
}

.file-loaded .file-name {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

.file-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* Animaciones para drag & drop */
@keyframes dragPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.drop-zone.drag-over {
    animation: dragPulse 0.6s ease-in-out;
}

/* Responsive para certificados */
@media (max-width: 768px) {
    .certificates-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .drop-zone {
        padding: 20px 15px;
    }
    
    .drop-zone-content i {
        font-size: 24px;
    }
}

/* Estilos para badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

/* Estilos para tabla de notas */
.notes-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    min-width: 800px; /* Ancho mínimo para mantener legibilidad */
}

.notes-table th,
.notes-table td {
    padding: 8px 6px; /* Reducido de 12px 8px */
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    white-space: nowrap; /* Evitar que el texto se corte */
    font-size: 0.85rem; /* Reducido el tamaño de fuente */
    line-height: 1.3; /* Reducido el interlineado */
}

.notes-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.notes-table tbody tr:hover {
    background-color: #f8f9fa;
}

.notes-table .btn {
    margin: 0 1px; /* Reducido de 0 2px */
    padding: 3px 6px; /* Reducido de 4px 8px */
    font-size: 11px; /* Reducido de 12px */
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 768px) {
    .notes-table th,
    .notes-table td {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    .notes-table .btn {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }
}

/* Contenedor más ancho para la nueva estructura por sectores */
.nota-detail-container-wide {
    max-width: 1400px !important;
    width: 95% !important;
    margin: 0 auto;
    padding: 20px;
}

/* Estilos para los sectores con columnas reales - COMPACTOS */
.sector-a, .sector-b, .sector-c, .sector-d, .sector-e {
    margin-bottom: 1rem; /* Reducido de 2rem */
}

/* Forzar columnas lado a lado en sectores específicos */
.sector-a .row, .sector-b .row, .sector-d .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px;
}

.sector-a .col-md-6, .sector-b .col-md-6, .sector-d .col-md-6 {
    flex: 1 !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}

/* Ajustes responsivos para sectores */
@media (max-width: 768px) {
    .nota-detail-container-wide {
        width: 100% !important;
        padding: 10px;
    }
    
    .sector-a .row, .sector-b .row, .sector-d .row {
        flex-wrap: wrap !important;
    }
    
    .sector-a .col-md-6,
    .sector-b .col-md-6,
    .sector-d .col-md-6 {
        flex: 1 1 100% !important;
        margin-bottom: 1rem;
    }
}

/* Mejoras visuales para las tarjetas de sección */
.seccion-card {
    background: #fff;
    border-radius: 8px; /* Reducido de 12px */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* Reducido */
    margin-bottom: 0.5rem; /* Reducido de 0.75rem para menos espacio entre sectores */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.seccion-card:hover {
    transform: translateY(-2px); /* Reducido de -3px */
    box-shadow: 0 4px 16px rgba(0,0,0,0.12); /* Reducido */
}

.seccion-header {
    padding: 8px 12px; /* Reducido de 10px 15px para menos espacio vertical */
    border-radius: 8px 8px 0 0; /* Reducido de 12px */
    display: flex;
    align-items: center;
    gap: 6px; /* Reducido de 8px */
    font-weight: 600;
}

.seccion-icono {
    font-size: 1rem; /* Reducido de 1.1rem */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.seccion-titulo {
    margin: 0;
    font-weight: 700;
    font-size: 0.85rem; /* Reducido de 0.9rem */
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.seccion-content {
    padding: 8px 12px; /* Reducido de 12px 15px para menos espacio vertical */
}

/* Contenedor de variables mejorado y compacto */
.variables-container {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Reducido aún más de 6px */
}

.variable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0; /* Reducido de 6px */
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    min-height: 20px; /* Altura mínima muy reducida */
}

.variable-item:hover {
    background-color: #f8f9fa;
    margin: 0 -15px; /* Reducido de -20px */
    padding-left: 15px; /* Reducido de 20px */
    padding-right: 15px; /* Reducido de 20px */
    border-radius: 4px; /* Reducido de 6px */
}

.variable-item:last-child {
    border-bottom: none;
}

.variable-label {
    font-weight: 400; /* Reducido a normal para eliminar negritas */
    color: #495057;
    font-size: 0.8rem; /* Reducido de 0.85rem */
    line-height: 1.2; /* Reducido el interlineado */
}

.variable-value {
    font-weight: 500; /* Reducido a medio para eliminar negritas */
    color: #212529;
    text-align: right;
    font-size: 0.8rem; /* Reducido de 0.85rem */
    line-height: 1.2; /* Reducido el interlineado */
}
}

/* TABLA PROFESIONAL PARA PRODUCTOS CON SCROLL HORIZONTAL */
.productos-table-container-scroll {
    width: 100%;
    overflow-x: auto !important; /* Forzar scroll horizontal */
    overflow-y: visible;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    /* Asegurar que el scroll sea visible */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto; /* Cambio de thin a auto para mayor visibilidad */
    scrollbar-color: #495057 #e9ecef; /* Colores más contrastantes */
}

/* Estilos para la barra de scroll - más visible */
.productos-table-container-scroll::-webkit-scrollbar {
    height: 12px; /* Aumentado de 8px para mayor visibilidad */
}

.productos-table-container-scroll::-webkit-scrollbar-track {
    background: #e9ecef; /* Color más contrastante */
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.productos-table-container-scroll::-webkit-scrollbar-thumb {
    background: #495057; /* Color más oscuro y visible */
    border-radius: 6px;
    border: 1px solid #343a40;
}

.productos-table-container-scroll::-webkit-scrollbar-thumb:hover {
    background: #343a40; /* Más oscuro al hover */
}

.productos-table-wrapper {
    min-width: 100%;
    width: max-content;
}

.productos-table-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Estilos de .productos-table movidos a productos.html para evitar conflictos */

/* Estilos para tablas mejoradas generales */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    border-top: none;
    font-size: 0.9rem;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table td.text-right {
    text-align: right;
    font-weight: 600;
}

/* Colores de texto para diferentes tipos de valores */
.text-success {
    color: #28a745 !important;
}

.text-primary {
    color: #007bff !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #17a2b8 !important;
}

/* Espaciado mejorado */
.mb-4 {
    margin-bottom: 2rem !important;
}

/* Ajustes para el modal más ancho */
.modal-xl {
    max-width: 1400px !important;
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1400px;
    }
}

/* Modal extra ancho para notas detalladas */
.modal-content.modal-xl {
    max-width: 1400px;
    width: 95%;
}

/* Responsive para modal extra ancho */
@media (max-width: 1400px) {
    .modal-content.modal-xl {
        width: 95%;
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .modal-content.modal-xl {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    /* Estilos de .productos-table movidos a productos.html para evitar conflictos */
    
    /* Asegurar que el contenedor de scroll funcione en móviles */
    .productos-table-container-scroll {
        width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}
/* Selección visual en resultados de búsqueda y modal de productos */
.product-search-result {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.product-search-result:hover {
    background: #f6f9ff;
}
.product-search-result.selected {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
}
.result-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.result-item:hover {
    background: #f6f9ff;
}
.result-item.selected {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
}

/* Selección activa en resultados de búsqueda */
.search-result-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}
