/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body específico para login */
body.login-page { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* Body general para otras páginas */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0;
    padding: 0;
}

/* Contenedor del formulario de login */
.login-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 300;
}

/* Estilos para inputs */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #8d7053;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(141, 112, 83, 0.1);
}

.form-group input::placeholder {
    color: #95a5a6;
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(141, 112, 83, 0.4);
}

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

/* Mensaje de error */
.error-message {
    background-color: #fee;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #fed7d7;
    font-size: 14px;
    text-align: left;
}

/* Alertas para formularios */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    border: 1px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Media Queries para Login */
@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .login-container h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn-login {
        padding: 14px;
        font-size: 16px;
    }
}

/* Estilos para las páginas internas */
.main-content {
    background: #ffffff;
    min-height: 100vh;
    padding: 30px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-content h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 300;
}

/* Dashboard Layout */
.dashboard-layout {
    background: #f5f7fa;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header del Dashboard */
.dashboard-header {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-content h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.welcome-text {
    font-size: 14px;
    opacity: 0.9;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content del Dashboard */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Stats Grid - Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.warning {
    border-left: 4px solid #f39c12;
}

.stat-card.profit {
    border-left: 4px solid #27ae60;
}

/* ESTILOS PARA MÓDULO DE CONFIGURACIÓN */
.config-layout {
    background: #f5f7fa;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.config-header {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.config-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.config-section {
    background: white;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.config-section h2 {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 20px 25px;
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    border-bottom: 2px solid #e1e8ed;
}

.config-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
}

/* Formulario de usuarios */
.user-form {
    padding: 25px;
}

.user-form select {
    padding: 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    width: 100%;
}

.user-form select:focus {
    outline: none;
    border-color: #8d7053;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(141, 112, 83, 0.1);
}

.btn-add-user {
    padding: 14px 24px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-add-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(39, 174, 96, 0.4);
}

/* Lista de usuarios */
.users-section {
    padding: 25px;
    border-top: 1px solid #e1e8ed;
}

.users-container {
    display: grid;
    gap: 15px;
}

.user-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    padding: 20px;
    border: 2px solid #f1f3f4;
    border-radius: 10px;
    transition: all 0.3s ease;
    align-items: center;
}

.user-item:hover {
    border-color: #8d7053;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.user-item.inactive {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.user-details h4 {
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
}

.username {
    color: #7f8c8d;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-style: italic;
}

.user-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.role-badge, .status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.role-administrador {
    background: #e74c3c;
    color: white;
}

.role-vendedor {
    background: #3498db;
    color: white;
}

.status-active {
    background: #27ae60;
    color: white;
}

.status-inactive {
    background: #95a5a6;
    color: white;
}

.date-created {
    color: #95a5a6;
    font-size: 12px;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
    align-items: flex-end;
}

.btn-activate, .btn-deactivate {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.btn-activate {
    background: #27ae60;
    color: white;
}

.btn-activate:hover {
    background: #229954;
}

.btn-deactivate {
    background: #e74c3c;
    color: white;
}

.btn-deactivate:hover {
    background: #c0392b;
}

.current-user-badge {
    background: #f39c12;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.btn-edit-user, .btn-schedule {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 4px;
    width: 100%;
}

.btn-edit-user {
    background: #3498db;
    color: white;
}

.btn-edit-user:hover {
    background: #2980b9;
}

.btn-schedule {
    background: #9b59b6;
    color: white;
}

.btn-schedule:hover {
    background: #8e44ad;
}

.horario-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.horario-activo {
    background: #27ae60;
    color: white;
}

.horario-inactivo {
    background: #e74c3c;
    color: white;
}

/* ESTILOS PARA MODALES */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-content.schedule-modal {
    max-width: 600px;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-content form {
    padding: 25px;
}

.btn-save {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(39, 174, 96, 0.4);
}

/* ESTILOS PARA HORARIOS */
.schedule-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.schedule-day {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.day-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #7f8c8d;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 5px;
}

.time-inputs {
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
}

.time-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.time-group label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.time-group input[type="time"] {
    padding: 8px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.time-group input[type="time"]:focus {
    outline: none;
    border-color: #8d7053;
    box-shadow: 0 0 0 2px rgba(141, 112, 83, 0.1);
}

/* Media Queries para Modales */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-content form {
        padding: 20px 15px;
    }
    
    .schedule-day {
        padding: 12px;
    }
    
    .day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .time-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-edit-user, .btn-schedule {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 5% auto;
        width: 98%;
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-content form {
        padding: 15px 10px;
    }
    
    .schedule-grid {
        gap: 10px;
    }
    
    .schedule-day {
        padding: 10px;
    }
}

.no-users-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-users-message .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-users-message h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Información del sistema */
.system-info {
    padding: 25px;
    border-top: 1px solid #e1e8ed;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #8d7053;
}

.info-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.stats-list p, .security-info p {
    margin-bottom: 8px;
    color: #34495e;
    font-size: 14px;
}

.stats-list strong {
    color: #2c3e50;
}

/* Estilos admin-only */
.admin-only {
    border: 2px solid #e74c3c;
    position: relative;
}

.admin-only::before {
    content: "👑 ADMIN";
    position: absolute;
    top: -8px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

/* Media Queries para Configuración */
@media (max-width: 768px) {
    .config-main {
        padding: 15px 10px;
    }
    
    .config-section {
        margin-bottom: 20px;
    }
    
    .config-section h2 {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .user-form,
    .users-section {
        padding: 20px 15px;
    }
    
    .user-item {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    
    .user-actions {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
    
    .system-info {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .config-main {
        padding: 10px 8px;
    }
    
    .config-section h2 {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .user-form,
    .users-section {
        padding: 15px 10px;
    }
    
    .user-item {
        padding: 15px;
    }
    
    .user-details h4 {
        font-size: 15px;
    }
    
    .user-meta {
        justify-content: center;
    }
    
    .info-card {
        padding: 15px;
    }
}

.stat-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1;
}

.stat-info p {
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-size: 13px;
    line-height: 1.2;
}

/* Quick Actions - Responsive */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 500;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.action-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: #8d7053;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.action-card h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 500;
}

.action-card p {
    color: #7f8c8d;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* Recent Products Section - Responsive */
.recent-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 500;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.product-card h4 {
    padding: 12px 12px 5px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.product-card .price {
    padding: 0 12px;
    color: #8d7053;
    font-weight: 600;
    font-size: 16px;
    margin: 3px 0;
}

.product-card .stock {
    padding: 0 12px 12px;
    color: #7f8c8d;
    font-size: 12px;
    margin: 0;
}

.no-products {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 30px;
    grid-column: 1 / -1;
}

.no-products a {
    color: #8d7053;
    text-decoration: none;
    font-weight: 500;
}

.no-products a:hover {
    text-decoration: underline;
}

/* Media Queries para Dashboard */
@media (max-width: 768px) {
    .dashboard-main {
        padding: 15px 10px;
    }
    
    .header-content {
        padding: 0 10px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-content h1 {
        font-size: 18px;
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-icon {
        font-size: 24px;
        width: 45px;
        height: 45px;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .action-card {
        padding: 20px;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .quick-actions h2,
    .recent-section h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 10px 8px;
    }
    
    .header-content {
        padding: 0 8px;
    }
    
    .stats-grid {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-info h3 {
        font-size: 18px;
    }
    
    .actions-grid {
        gap: 10px;
    }
    
    .action-card {
        padding: 15px;
    }
    
    .action-card h3 {
        font-size: 15px;
    }
    
    .action-card p {
        font-size: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .product-card img {
        height: 80px;
    }
    
    .product-card h4 {
        font-size: 13px;
        padding: 10px 10px 4px;
    }
    
    .product-card .price {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .product-card .stock {
        padding: 0 10px 10px;
        font-size: 11px;
    }
}

/* Navegación principal */
.main-nav {
    margin-top: 20px;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    margin-right: 15px;
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(141, 112, 83, 0.4);
}

.nav-link.logout {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.nav-link.logout:hover {
    box-shadow: 0 7px 20px rgba(231, 76, 60, 0.4);
}

/* ESTILOS PARA PÁGINA DE PRODUCTOS */
.products-layout {
    background: #f5f7fa;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.products-header {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.products-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Acceso restringido */
.access-restricted {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    text-align: center;
    border: 2px dashed #e1e8ed;
}

.restriction-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.access-restricted h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

.access-restricted p {
    color: #7f8c8d;
    font-style: italic;
}

.vendor-info {
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.products-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.products-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Formulario de productos */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
}

.product-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input {
    padding: 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #8d7053;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(141, 112, 83, 0.1);
}

.readonly-field {
    background-color: #e9ecef !important;
    color: #6c757d;
    cursor: not-allowed;
}

.readonly-field:focus {
    border-color: #ced4da !important;
    box-shadow: none !important;
}

.btn-add-product {
    padding: 14px 24px;
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    -webkit-tap-highlight-color: transparent;
}

.btn-add-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(141, 112, 83, 0.4);
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

/* Lista de productos */
.products-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.products-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
}

.products-container {
    display: grid;
    gap: 15px;
}

.product-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 15px;
    padding: 15px;
    border: 2px solid #f1f3f4;
    border-radius: 10px;
    transition: all 0.3s ease;
    align-items: center;
}

.product-item:hover {
    border-color: #8d7053;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.product-item.low-stock {
    border-color: #f39c12;
    background-color: #fef9e7;
}

.product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.product-details h3 {
    color: #2c3e50;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 500;
}

.product-pricing {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.price-row.main-price {
    border-top: 1px solid #e1e8ed;
    padding-top: 8px;
    margin-top: 6px;
    font-weight: 600;
}

.price-row .label {
    color: #7f8c8d;
    font-size: 13px;
}

.cost-price {
    color: #e74c3c;
    font-weight: 500;
}

.profit-margin {
    color: #27ae60;
    font-weight: 500;
}

.sale-price {
    color: #8d7053;
    font-weight: 600;
    font-size: 16px;
}

.stock-info {
    color: #34495e;
    font-weight: 500;
}

.profit-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f3f4;
}

.profit-info small {
    color: #95a5a6;
    font-size: 12px;
}

.warning-badge {
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 5px;
    display: inline-block;
}

.product-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.no-products-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-products-message h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

.no-products-message p {
    font-style: italic;
    line-height: 1.5;
}

/* Media Queries para Productos */
@media (max-width: 768px) {
    .products-main {
        padding: 15px 10px;
    }
    
    .products-header .header-content {
        padding: 0 10px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .products-header h1 {
        font-size: 18px;
        min-width: auto;
    }
    
    .form-section,
    .products-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .btn-add-product {
        width: 100%;
        padding: 12px;
    }
    
    .product-item {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    
    .product-image {
        justify-self: center;
    }
    
    .product-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .btn-edit, .btn-delete {
        flex: 1;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .products-main {
        padding: 10px 8px;
    }
    
    .products-header .header-content {
        padding: 0 8px;
    }
    
    .form-section,
    .products-section {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .product-item {
        padding: 12px;
        gap: 10px;
    }
    
    .product-image img {
        width: 60px;
        height: 60px;
    }
    
    .product-details h3 {
        font-size: 15px;
    }
    
    .price-row {
        font-size: 13px;
    }
    
    .sale-price {
        font-size: 15px;
    }
    
    .profit-info small {
        font-size: 11px;
    }
    
    .no-products-message {
        padding: 25px 15px;
    }
    
    .empty-icon {
        font-size: 36px;
    }
}

/* Estilos para formularios en páginas internas */
.form-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 300;
}

/* Tablas mejoradas - Responsive */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

table { 
    border-collapse: collapse; 
    width: 100%; 
    min-width: 600px; /* Ancho mínimo para scroll horizontal */
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td { 
    border: none;
    padding: 12px 16px; 
    text-align: left; 
}

th {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
}

td img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

/* Elementos generales responsive */
input, button { 
    margin: 5px 0; 
    padding: 10px 12px;
    border-radius: 6px;
    border: 2px solid #e1e8ed;
    font-size: 14px;
    transition: all 0.3s ease;
}

button {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(141, 112, 83, 0.3);
}

/* Estilos específicos para botones de ventas */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1.5;
}

input:focus {
    outline: none;
    border-color: #8d7053;
    box-shadow: 0 0 0 3px rgba(141, 112, 83, 0.1);
}

img { 
    border-radius: 4px; 
    max-width: 100%;
    height: auto;
}

/* Utilidades responsive */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.hidden-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

/* Media Queries Generales */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
    
    /* Ajustes para inputs y botones en móvil */
    input, button {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
        margin: 8px 0;
    }
    
    /* Tablas en móvil - stack vertical */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }
    
    td {
        border: none;
        padding: 8px 10px;
        position: relative;
        padding-left: 50% !important;
        white-space: nowrap;
    }
    
    td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #2c3e50;
    }
}

@media (max-width: 480px) {
    /* Ajustes adicionales para pantallas muy pequeñas */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    
    .form-container {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    input, button {
        padding: 10px 12px;
        margin: 6px 0;
    }
    
    td {
        padding-left: 45% !important;
        font-size: 13px;
    }
    
    td:before {
        width: 40%;
        font-size: 12px;
    }
}

/* =================================================================== */
/* ESTILOS PARA GASTOS E INVERSIONES */
/* =================================================================== */

/* FINANCIAL SUMMARY */
.financial-summary {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(141, 112, 83, 0.1);
}

.financial-summary h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.summary-card {
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid;
}

.summary-card.positive {
    background: #f8fffe;
    border-left-color: #27ae60;
}

.summary-card.neutral {
    background: #f8fbff;
    border-left-color: #3498db;
}

.summary-card.negative {
    background: #fef9f9;
    border-left-color: #e74c3c;
}

.summary-card.highlight {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-left-color: #d35400;
    color: white;
}

.summary-card.highlight .summary-info h4,
.summary-card.highlight .summary-info p,
.summary-card.highlight .summary-info small {
    color: white;
}

.summary-icon {
    font-size: 28px;
    opacity: 0.8;
}

.summary-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.summary-amount {
    margin: 5px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.summary-info small {
    font-size: 12px;
    color: #7f8c8d;
}

/* STAT CARDS EXTRAS */
.stat-card.expense {
    border-left-color: #e74c3c;
}

.stat-card.investment {
    border-left-color: #3498db;
}

/* GASTOS E INVERSIONES LAYOUT */
.gastos-layout, .inversiones-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.gastos-header, .inversiones-header {
    background: linear-gradient(135deg, #8d7053 0%, #a0846c 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gastos-main, .inversiones-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.gastos-section, .inversiones-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(141, 112, 83, 0.1);
}

.gastos-section h2, .inversiones-section h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* FORMS */
.gastos-form, .inversiones-form {
    display: grid;
    gap: 20px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
}

.readonly-field {
    background: #f8f9fa !important;
    color: #6c757d;
    cursor: not-allowed;
}

.precio-info {
    font-size: 12px;
    margin-top: 5px;
}

/* BUTTONS */
.btn-add-gasto, .btn-add-inversion {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-gasto:hover, .btn-add-inversion:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(39, 174, 96, 0.4);
}

.btn-clear-filters {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-clear-filters:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* STATS AND LISTS */
.gastos-stats, .inversiones-stats {
    margin-bottom: 20px;
}

.categoria-breakdown {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.categoria-list {
    display: grid;
    gap: 8px;
}

.categoria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #8d7053;
}

.categoria-nombre {
    font-weight: 500;
    color: #2c3e50;
}

.categoria-monto {
    font-weight: 600;
    color: #27ae60;
}

/* FILTERS */
.gastos-filters, .inversiones-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form input, .filter-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* ITEM LISTS */
.gastos-list, .inversiones-list {
    display: grid;
    gap: 15px;
}

.gasto-item, .inversion-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #8d7053;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.gasto-item:hover, .inversion-item:hover {
    box-shadow: 0 4px 15px rgba(141, 112, 83, 0.15);
    transform: translateX(5px);
}

.gasto-item.categoria-operativo { border-left-color: #3498db; }
.gasto-item.categoria-administrativo { border-left-color: #9b59b6; }
.gasto-item.categoria-marketing { border-left-color: #e91e63; }
.gasto-item.categoria-mantenimiento { border-left-color: #ff9800; }
.gasto-item.categoria-servicios { border-left-color: #00bcd4; }
.gasto-item.categoria-otros { border-left-color: #607d8b; }

.gasto-info, .inversion-info {
    flex: 1;
}

.gasto-concepto h4, .inversion-producto h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.gasto-categoria {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.gasto-descripcion {
    margin: 10px 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.4;
}

.gasto-meta, .inversion-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.gasto-meta span, .inversion-meta span {
    font-size: 12px;
    color: #7f8c8d;
}

.gasto-comprobante {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.gasto-comprobante:hover {
    text-decoration: underline;
}

.gasto-monto, .inversion-monto {
    text-align: right;
    min-width: 120px;
}

.monto-valor {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    display: block;
}

.monto-tipo {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 500;
}

.inversion-detalles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.detalle-cantidad, .detalle-precio, .detalle-proveedor {
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #2c3e50;
}

.inversion-notas {
    margin: 10px 0;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
    line-height: 1.4;
}

/* EMPTY STATES */
.no-gastos-message, .no-inversiones-message {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* RESPONSIVE PARA GASTOS E INVERSIONES */
@media (max-width: 768px) {
    .gastos-main, .inversiones-main {
        padding: 20px 15px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gasto-item, .inversion-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .gasto-monto, .inversion-monto {
        text-align: left;
        min-width: auto;
    }
    
    .gasto-meta, .inversion-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions {
        margin: 15px 0;
    }
}

/* ============================================
   ESTILOS PARA SISTEMA DE VENTAS
   ============================================ */

/* Clases adicionales para stat cards */
.stat-card.success { border-left: 4px solid #8BC34A; }
.stat-card.info { border-left: 4px solid #00BCD4; }

/* Estilos para clientes */
.cliente-card, .vendedor-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cliente-card:hover, .vendedor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cliente-card.inactivo, .vendedor-card.inactivo {
    border-left-color: #f44336;
    opacity: 0.7;
}

.cliente-header, .vendedor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cliente-header h4, .vendedor-header h4 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.cliente-estado, .vendedor-estado {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.cliente-estado.activo, .vendedor-estado.activo {
    background: #d4edda;
    color: #155724;
}

.cliente-estado.inactivo, .vendedor-estado.inactivo {
    background: #f8d7da;
    color: #721c24;
}

.cliente-info, .vendedor-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.cliente-actions, .vendedor-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.clientes-grid, .vendedores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

/* Estilos para ventas */
.venta-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.venta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.venta-card.estado-cancelada {
    border-left-color: #f44336;
    opacity: 0.8;
}

.venta-card.estado-pendiente {
    border-left-color: #FF9800;
}

.venta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.venta-numero {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.venta-numero strong {
    font-size: 18px;
    color: #333;
}

.venta-total {
    font-size: 20px;
    font-weight: bold;
    color: #2E7D32;
}

.venta-estado {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 10px;
}

.venta-estado.estado-completada {
    background: #d4edda;
    color: #155724;
}

.venta-estado.estado-cancelada {
    background: #f8d7da;
    color: #721c24;
}

.venta-estado.estado-pendiente {
    background: #fff3cd;
    color: #856404;
}

.venta-info {
    margin: 15px 0;
}

.info-row {
    display: flex;
    margin: 8px 0;
    align-items: flex-start;
}

.info-row strong {
    min-width: 120px;
    color: #555;
    font-size: 14px;
}

.venta-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.ventas-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
}

/* Estilos para formulario de venta */
.vendedor-form, .cliente-form {
    display: grid;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.productos-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.productos-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.productos-lista {
    margin-top: 15px;
}

.producto-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.producto-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.producto-controls input {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.producto-controls span {
    font-weight: bold;
    color: #555;
}

.venta-calculadora {
    background: #e8f5e8;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.venta-calculadora h3 {
    color: #2E7D32;
    margin-bottom: 15px;
    text-align: center;
}

.totales-display {
    margin: 15px 0;
}

.totales-display > div {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 16px;
    padding: 5px 0;
}

.total-display {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
    border-top: 2px solid #4CAF50;
    padding-top: 10px;
    margin-top: 15px;
}

/* Estilos para detalle de venta */
.venta-detalle {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.venta-header-detalle {
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.venta-numero-detalle {
    font-size: 28px;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 10px;
}

.venta-fecha {
    color: #666;
    font-size: 16px;
}

.info-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 15px;
}

.productos-tabla {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.productos-tabla th,
.productos-tabla td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.productos-tabla th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.productos-tabla tr:hover {
    background-color: #f9f9f9;
}

.productos-tabla tr:last-child td {
    border-bottom: none;
}

.totales-section {
    background: #e8f5e8;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

.totales-section h3 {
    color: #2E7D32;
    margin-bottom: 15px;
    text-align: center;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 16px;
    padding: 5px 0;
}

.total-final {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
    border-top: 2px solid #4CAF50;
    padding-top: 15px;
    margin-top: 15px;
}

.estado-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
}

.estado-badge.estado-completada {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.estado-badge.estado-cancelada {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.estado-badge.estado-pendiente {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* RESPONSIVE PARA SISTEMA DE VENTAS */
@media (max-width: 768px) {
    .clientes-grid, .vendedores-grid {
        grid-template-columns: 1fr;
    }
    
    .ventas-lista {
        grid-template-columns: 1fr;
    }
    
    .producto-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .venta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cliente-header, .vendedor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .total-row {
        font-size: 14px;
    }
    
    .total-final {
        font-size: 20px;
    }
    
    .venta-detalle {
        padding: 20px;
        margin: 10px;
    }
    
    .productos-tabla {
        font-size: 14px;
    }
    
    .productos-tabla th,
    .productos-tabla td {
        padding: 8px;
    }
    
    .venta-calculadora {
        position: static;
        margin: 15px 0;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    
    .venta-detalle {
        box-shadow: none;
        border: 1px solid #000;
        padding: 20px;
    }
    
    .info-section {
        background: white !important;
        border: 1px solid #ddd;
    }
    
    .totales-section {
        background: white !important;
        border: 2px solid #000 !important;
    }
}

/* Estilos específicos para Cierre de Caja */
.cierre-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.filtros-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.resumen-financiero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.resumen-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

.resumen-card:hover {
    transform: translateY(-2px);
}

.resumen-card.ingresos {
    border-left: 5px solid #28a745;
}

.resumen-card.gastos {
    border-left: 5px solid #dc3545;
}

.resumen-card.inversiones {
    border-left: 5px solid #ffc107;
}

.resumen-card.flujo {
    border-left: 5px solid #007bff;
}

.resumen-card h3 {
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: bold;
}

.resumen-card p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}

.detalle-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tabla-simple {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tabla-simple th,
.tabla-simple td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.tabla-simple th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.tabla-simple tr:hover {
    background-color: #f8f9fa;
}

.tabla-simple tr:nth-child(even) {
    background-color: #fdfdfd;
}

.btn-imprimir {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-imprimir:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .cierre-container {
        padding: 10px;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
    }
    
    .resumen-financiero {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        text-align: center;
        border-bottom: 1px solid #e9ecef;
    }
    
    .tabla-simple {
        font-size: 12px;
    }
    
    .tabla-simple th,
    .tabla-simple td {
        padding: 8px 4px;
    }
}

@media print {
    .filtros-section,
    .btn-imprimir,
    .tabs,
    .no-print {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .resumen-financiero {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .resumen-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .detalle-section {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .tabla-simple {
        font-size: 10px;
    }
    
    .tabla-simple th,
    .tabla-simple td {
        padding: 4px;
        border: 1px solid #000;
    }
}

/* Estilos para tarjetas clickeables */
.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.clickable small {
    color: #666;
    font-size: 0.8em;
    margin-top: 5px;
    display: block;
}

/* Estilos para modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* Tabla de stock */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.stock-table th,
.stock-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stock-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.stock-table tr:hover {
    background-color: #f5f5f5;
}

.stock-table tr.critico {
    background-color: #ffebee;
}

.stock-table tr.bajo {
    background-color: #fff3e0;
}

.stock-table .badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.stock-table .badge.critico {
    background-color: #f44336;
    color: white;
}

.stock-table .badge.bajo {
    background-color: #ff9800;
    color: white;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

.error {
    text-align: center;
    padding: 40px;
    color: #f44336;
    font-weight: bold;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #005a8b;
}

.btn-primary {
    background-color: #007cba;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Estilos para tarjetas en construcción */
.action-card.construction {
    opacity: 0.7;
    border: 2px dashed #f39c12;
    position: relative;
}

.action-card.construction:hover {
    opacity: 0.9;
    border-color: #e67e22;
    cursor: help;
    transform: translateY(-2px);
}

.action-card.construction::after {
    content: "🚧";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
}

.action-card.construction .action-text p {
    color: #f39c12;
    font-style: italic;
}

/* Estilos para botones de productos */
.btn-edit {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
    transition: background 0.3s;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-save {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #219a52;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background 0.3s;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Mensajes de confirmación */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

/* Estilos para el buscador de productos */
.producto-buscar-container {
    position: relative;
    width: 100%;
}

.producto-buscar-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.producto-buscar-container input[type="text"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.productos-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.producto-resultado {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.producto-resultado:hover {
    background-color: #f8f9fa;
}

.producto-resultado:last-child {
    border-bottom: none;
}

.producto-resultado.ya-agregado {
    background-color: #f1f8ff;
    cursor: default;
    position: relative;
}

.producto-resultado.ya-agregado:hover {
    background-color: #e3f2fd;
}

.producto-info {
    flex: 1;
}

.producto-nombre {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.producto-precio {
    font-size: 14px;
    color: #27ae60;
    font-weight: 600;
}

.producto-stock {
    font-size: 12px;
    color: #7f8c8d;
    margin-left: 10px;
}

.ya-agregado-badge {
    background: #27ae60;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 8px;
}

.no-resultados {
    padding: 15px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

.buscar-info {
    margin-top: 5px;
}

.buscar-info small {
    color: #7f8c8d;
    font-size: 12px;
}

/* Responsive para el buscador */
@media (max-width: 768px) {
    .productos-dropdown {
        max-height: 200px;
    }
    
    .producto-resultado {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .producto-stock {
        margin-left: 0;
        margin-top: 4px;
    }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive para modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .stock-table {
        font-size: 14px;
    }
    
    .stock-table th,
    .stock-table td {
        padding: 8px;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
======================================== */

/* Tablet - max 768px */
@media (max-width: 768px) {
    /* Dashboard Header */
    .dashboard-header {
        padding: 12px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 18px;
        min-width: auto;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .welcome-text {
        display: block;
        margin-top: 5px;
        font-size: 13px;
    }
    
    /* Dashboard Main */
    .dashboard-main {
        padding: 15px 10px;
    }
    
    /* Stats Grid - Responsive */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-card .stat-icon {
        font-size: 32px;
    }
    
    .stat-card h3 {
        font-size: 20px;
    }
    
    .stat-card p {
        font-size: 13px;
    }
    
    .stat-card small {
        font-size: 11px;
    }
    
    /* Quick Actions */
    .quick-actions h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .action-card {
        padding: 15px 10px;
        min-height: 100px;
    }
    
    .action-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .action-text h3 {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .action-text p {
        font-size: 11px;
    }
    
    /* Alert Messages */
    .alert {
        padding: 12px;
        margin: 15px 0;
        font-size: 14px;
    }
    
    .alert p {
        margin: 0;
        line-height: 1.4;
    }
}

/* Mobile - max 480px */
@media (max-width: 480px) {
    /* Header */
    .dashboard-header {
        padding: 10px 0;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .header-content h1 {
        font-size: 16px;
    }
    
    .welcome-text {
        font-size: 12px;
    }
    
    .status-indicator {
        font-size: 12px;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Dashboard Main */
    .dashboard-main {
        padding: 10px 5px;
    }
    
    /* Stats Grid - Single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .stat-card .stat-icon {
        font-size: 28px;
    }
    
    .stat-card h3 {
        font-size: 18px;
        margin: 0;
    }
    
    .stat-card p {
        font-size: 12px;
        margin: 2px 0 0 0;
    }
    
    .stat-card small {
        font-size: 10px;
        margin-top: 2px;
    }
    
    /* Quick Actions - Mobile */
    .quick-actions h2 {
        font-size: 18px;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .action-card {
        padding: 12px 8px;
        min-height: 80px;
        text-align: center;
        border-radius: 8px;
    }
    
    .action-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .action-text h3 {
        font-size: 12px;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .action-text p {
        font-size: 10px;
        line-height: 1.2;
        margin: 0;
    }
    
    /* Alert Messages - Mobile */
    .alert {
        padding: 10px;
        margin: 10px 0;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .alert p {
        font-size: 12px;
        line-height: 1.3;
    }
    
    /* Modal Responsive - Mobile */
    .modal-content {
        width: 98%;
        margin: 5% auto;
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 12px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .stock-table {
        font-size: 12px;
    }
    
    .stock-table th,
    .stock-table td {
        padding: 6px 4px;
    }
    
    .btn-primary {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Construcción card mobile */
    .action-card.construction::after {
        font-size: 14px;
        top: 5px;
        right: 5px;
    }
}

/* Extra Small Devices - max 320px */
@media (max-width: 320px) {
    .header-content h1 {
        font-size: 14px;
    }
    
    .welcome-text {
        font-size: 11px;
    }
    
    .dashboard-main {
        padding: 8px 3px;
    }
    
    .stat-card {
        padding: 10px;
        gap: 8px;
    }
    
    .stat-card .stat-icon {
        font-size: 24px;
    }
    
    .stat-card h3 {
        font-size: 16px;
    }
    
    .stat-card p {
        font-size: 11px;
    }
    
    .actions-grid {
        gap: 6px;
    }
    
    .action-card {
        padding: 10px 6px;
        min-height: 70px;
    }
    
    .action-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .action-text h3 {
        font-size: 11px;
        margin-bottom: 1px;
    }
    
    .action-text p {
        font-size: 9px;
    }
}

/* Touch and Interaction Improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .action-card,
    .stat-card.clickable,
    .btn-primary,
    .logout-btn {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    /* Better hover states for touch */
    .action-card:active {
        transform: translateY(1px);
        opacity: 0.9;
    }
    
    .stat-card.clickable:active {
        transform: translateY(1px);
    }
    
    /* Improve text readability */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Scroll improvements */
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* RESPONSIVE IMPROVEMENTS FOR FORMS AND INPUTS */
@media (max-width: 768px) {
    /* Form improvements */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border: 2px solid #ddd;
        border-radius: 8px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #3498db;
        outline: none;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    }
    
    /* Button improvements */
    .btn,
    .btn-primary,
    .btn-add-product {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        margin: 10px 0;
        border: none;
        border-radius: 8px;
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Product grid responsive */
    .products-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-item {
        padding: 15px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .product-image {
        width: 100%;
        max-width: 150px;
        margin: 0 auto;
    }
    
    .product-image img {
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
    
    .product-details {
        text-align: center;
    }
    
    .product-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .product-actions button {
        flex: 1;
        min-width: 100px;
        padding: 10px;
        font-size: 14px;
    }
    
    /* Ventas form responsive */
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .productos-section {
        margin: 20px 0;
    }
    
    .producto-buscar-container {
        margin-bottom: 15px;
    }
    
    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 100%;
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px 4px;
        white-space: nowrap;
    }
    
    /* Navigation improvements */
    .btn-back {
        padding: 10px 15px;
        font-size: 14px;
        margin: 5px 0;
        display: inline-block;
        width: auto;
        min-width: 120px;
    }
    
    /* Header improvements */
    .header-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    
    .user-role {
        padding: 5px 10px;
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Even smaller screens */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn,
    .btn-primary,
    .btn-add-product {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions button {
        width: 100%;
        margin: 2px 0;
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 2% auto;
        width: 98%;
        max-height: 96vh;
    }
    
    .modal-header {
        padding: 10px;
    }
    
    .modal-body {
        padding: 10px;
        max-height: 70vh;
    }
    
    /* Form modal adjustments */
    .form-row {
        gap: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions button {
        width: 100%;
        margin: 0;
    }
}

/* ===== ESTILOS PARA REGISTRO DE ACTIVIDADES ===== */

/* Filtros de actividades */
.activity-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
    align-items: stretch;
    text-align: left;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 14px;
    text-align: left;
    align-self: flex-start;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn-filter {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-filter:hover {
    background: #0056b3;
}

.btn-clear {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-clear:hover {
    background: #545b62;
    color: white;
    text-decoration: none;
}

/* Sección de actividades */
.activities-section {
    margin-top: 20px;
}

.activities-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.btn-select-all {
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-select-all:hover {
    background: #1e7e34;
}

.btn-deselect-all {
    background: #ffc107;
    color: #212529;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-deselect-all:hover {
    background: #e0a800;
}

.btn-delete-selected {
    background: #dc3545;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-delete-selected:hover {
    background: #c82333;
}

/* Lista de actividades */
.activities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
}

.activity-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.activity-checkbox {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.activity-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.activity-type {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-date {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
}

.activity-description {
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.activity-module {
    color: #007bff;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
    font-size: 12px;
}

.btn-details {
    background: #17a2b8;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-details:hover {
    background: #138496;
}

.activity-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.activity-details pre {
    color: #495057;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Colores por tipo de actividad */
.activity-login .activity-type {
    background: #d4edda;
    color: #155724;
}

.activity-logout .activity-type {
    background: #f8d7da;
    color: #721c24;
}

.activity-venta .activity-type {
    background: #d1ecf1;
    color: #0c5460;
}

.activity-modificacion-producto .activity-type,
.activity-modificacion-cliente .activity-type,
.activity-modificacion-inversion .activity-type {
    background: #fff3cd;
    color: #856404;
}

.activity-eliminacion .activity-type {
    background: #f5c6cb;
    color: #721c24;
}

.activity-acceso-modulo .activity-type {
    background: #e2e3e5;
    color: #383d41;
}

.activity-configuracion .activity-type {
    background: #d4edda;
    color: #155724;
}

.activity-error .activity-type {
    background: #f5c6cb;
    color: #721c24;
}

/* Mensaje cuando no hay actividades */
.no-activities-message {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.no-activities-message .empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-activities-message h3 {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.no-activities-message p {
    color: #6c757d;
    font-size: 14px;
}

/* Herramientas de limpieza */
.cleanup-tools {
    margin-top: 30px;
    background: #fff8e1;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ffecb3;
}

.cleanup-tools h3 {
    color: #f57f17;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.cleanup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cleanup-option {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cleanup-option label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.cleanup-option select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    min-width: 120px;
}

.btn-cleanup {
    background: #ff9800;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-cleanup:hover {
    background: #f57c00;
}

/* Responsive para actividades */
@media (max-width: 768px) {
    /* Forzar alineación a la izquierda en todos los elementos del formulario */
    .activity-filters,
    .activity-filters *,
    .filters-form,
    .filters-form *,
    .filter-row,
    .filter-row *,
    .filter-group,
    .filter-group *,
    .filter-actions,
    .filter-actions * {
        text-align: left !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
    }
    
    /* Formulario de filtros optimizado para móviles */
    .activity-filters {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
        text-align: left !important;
    }
    
    .filters-form {
        gap: 20px;
        text-align: left !important;
        align-items: flex-start !important;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 15px;
        background: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        text-align: left !important;
        align-items: flex-start !important;
    }
    
    .filter-row:last-child {
        background: transparent;
        box-shadow: none;
        padding: 10px 0;
        text-align: left !important;
    }
    
    .filter-group {
        min-width: unset;
        margin-bottom: 0;
        width: 100%;
        text-align: left !important;
        align-items: flex-start !important;
        align-self: flex-start !important;
    }
    
    .filter-group label {
        font-size: 15px;
        font-weight: 700;
        color: #495057;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 5px;
        text-align: left !important;
        justify-content: flex-start !important;
        align-self: flex-start !important;
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input[type="date"] {
        padding: 12px 15px;
        font-size: 16px; /* Evitar zoom en iOS */
        border: 2px solid #e9ecef;
        border-radius: 8px;
        background-color: #fff;
        min-height: 44px; /* Área táctil adecuada */
        box-sizing: border-box;
        width: 100%;
        text-align: left !important;
        align-self: flex-start !important;
    }
    
    .filter-group select:focus,
    .filter-group input[type="date"]:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    }
    
    .filter-actions {
        flex-direction: row;
        gap: 10px;
        justify-content: stretch;
        margin-top: 10px;
        text-align: left !important;
        align-items: stretch !important;
        align-self: flex-start !important;
        width: 100%;
    }
    
    .btn-filter,
    .btn-clear {
        flex: 1;
        padding: 15px 20px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 8px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center !important;
        gap: 8px;
        text-decoration: none;
        transition: all 0.3s ease;
        text-align: center !important;
    }
    
    .btn-filter {
        background: linear-gradient(135deg, #007bff, #0056b3);
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    }
    
    .btn-filter:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    }
    
    .btn-clear {
        background: linear-gradient(135deg, #6c757d, #495057);
        box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    }
    
    .btn-clear:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    }
    
    /* Otras mejoras para actividades en móvil */
    .activities-actions {
        flex-direction: column;
        gap: 10px;
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin: 15px 0;
    }
    
    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }
    
    .activity-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-size: 15px;
    }
}

/* Estilos para móviles muy pequeños */
@media (max-width: 480px) {
    .activity-filters {
        padding: 10px;
        margin: 10px -10px 15px -10px;
    }
    
    .filter-row {
        padding: 12px;
        gap: 12px;
    }
    
    .filter-group label {
        font-size: 14px;
    }
    
    .filter-group select,
    .filter-group input[type="date"] {
        padding: 14px 12px;
        font-size: 16px;
        border-width: 1px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-filter,
    .btn-clear {
        padding: 16px 15px;
        font-size: 15px;
        min-height: 50px;
    }
    
    .activity-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cleanup-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cleanup-option select,
    .btn-cleanup {
        width: 100%;
    }
}

/* Estilos específicos para móviles en orientación vertical (portrait) */
@media (max-width: 768px) and (orientation: portrait) {
    .activity-filters {
        margin: 0 -15px 20px -15px;
        border-radius: 0 0 12px 12px;
    }
    
    .filters-form {
        align-items: stretch;
        text-align: left;
    }
    
    .filter-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 20px 15px;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        text-align: left;
        margin-bottom: 0;
    }
    
    .filter-group label {
        align-self: flex-start;
        text-align: left;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input[type="date"] {
        width: 100%;
        text-align: left;
        align-self: stretch;
        margin: 0;
    }
    
    .filter-actions {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 10px;
        align-items: stretch;
        justify-content: stretch;
    }
    
    .btn-filter,
    .btn-clear {
        flex: 1;
        text-align: center;
        width: auto;
    }
}

/* Estilos específicos para móviles muy pequeños en portrait */
@media (max-width: 480px) and (orientation: portrait) {
    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-filter,
    .btn-clear {
        width: 100%;
        flex: none;
    }
}