/* Header del Dashboard */
.dashboard-header {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    margin: 20px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.header-title h1 {
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    position: relative;
    z-index: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.time-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.time-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.time-toggle-btn:active {
    transform: scale(0.95);
}

.time-toggle-btn.active {
    background: var(--success-gradient);
}

.theme-toggle-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(140, 17, 17, 0.1), transparent);
    transition: left 0.5s;
}

.theme-toggle-btn:hover::before {
    left: 100%;
}

.theme-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn i {
    font-size: 18px;
    transition: var(--transition);
}

/* Botón HITL Dashboard */
.btn-hitl-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    position: relative;
    overflow: visible;
    z-index: 10;
}

.btn-hitl-dashboard:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%);
}

.btn-hitl-dashboard:active {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-hitl-dashboard i {
    font-size: 16px;
}

/* Botón configurar WhatsApp (QR / reset sesión) */
.btn-whatsapp-config {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.btn-whatsapp-config:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%);
}

.btn-whatsapp-config:active {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-whatsapp-config i {
    font-size: 16px;
}

/* Botón galería WhatsApp */
.btn-whatsapp-media {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(79, 70, 229, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.btn-whatsapp-media:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(79, 70, 229, 1) 100%);
}

.btn-whatsapp-media:active {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-whatsapp-media i {
    font-size: 16px;
}

/* Botón activo/inactivo por usuario */
.btn-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.btn-active-toggle.btn-active-on {
    background: rgba(34, 197, 94, 0.25);
    color: rgb(34, 197, 94);
    border-color: rgba(34, 197, 94, 0.4);
}
.btn-active-toggle.btn-active-on:hover {
    background: rgba(34, 197, 94, 0.4);
}
.btn-active-toggle.btn-active-off {
    background: rgba(107, 114, 128, 0.25);
    color: rgb(156, 163, 175);
    border-color: rgba(107, 114, 128, 0.4);
}
.btn-active-toggle.btn-active-off:hover {
    background: rgba(107, 114, 128, 0.4);
}
.btn-active-toggle i {
    font-size: 18px;
}
.entry-row.entry-inactive {
    opacity: 0.7;
}
.entry-row.entry-inactive .entry-name {
    color: var(--text-muted, #9ca3af);
}

/* Botón cargar factura */
.btn-upload-factura {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.9) 0%, rgba(234, 88, 12, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.3);
    position: relative;
    overflow: visible;
    z-index: 10;
}

.btn-upload-factura:hover {
    box-shadow: 0 6px 20px rgba(251, 146, 60, 0.4);
    background: linear-gradient(135deg, rgba(251, 146, 60, 1) 0%, rgba(234, 88, 12, 1) 100%);
}

.btn-upload-factura:active {
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.3);
}

.btn-upload-factura i {
    font-size: 16px;
}

/* Separador de botones en el header */
.header-buttons-separator {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 8px;
    pointer-events: none; /* No bloquear clics */
    flex-shrink: 0;
}

.header-buttons-group {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.hitl-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.4);
    border: 2px solid var(--card-bg);
    line-height: 1;
    white-space: nowrap;
}

.hitl-notification-badge.has-pending {
    display: flex !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Galería de imágenes de WhatsApp */
.modal-gallery {
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-gallery .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.gallery-controls {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.gallery-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gallery-filters .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.gallery-filters label {
    font-size: 12px;
    margin-bottom: 5px;
}

.gallery-filters input,
.gallery-filters select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
}

.gallery-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.gallery-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.gallery-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-image-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    overflow: hidden;
    background: var(--bg-secondary);
}

.gallery-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image-card:hover .gallery-image-wrapper img {
    transform: scale(1.05);
}

.gallery-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image-card:hover .gallery-image-overlay {
    opacity: 1;
}

.gallery-image-info {
    color: white;
    text-align: center;
    font-weight: 600;
}

.gallery-image-info i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.gallery-image-details {
    padding: 12px;
}

.gallery-image-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-image-name i {
    font-size: 12px;
    color: var(--primary-color);
}

.gallery-image-phone,
.gallery-image-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-image-phone i,
.gallery-image-date i {
    font-size: 10px;
}

.gallery-image-caption {
    font-size: 12px;
    color: var(--text-primary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Visor de imagen ampliada */
.modal-image-viewer {
    max-width: 90vw;
    max-height: 90vh;
}

.image-viewer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.image-viewer-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.image-viewer-info {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.image-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.image-info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.image-info-item strong {
    min-width: 120px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-info-item span {
    color: var(--text-secondary);
    flex: 1;
}

.image-url-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    transition: var(--transition);
}

.image-url-link:hover {
    text-decoration: underline;
}

/* Responsive para galería */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .gallery-filters {
        flex-direction: column;
    }
    
    .gallery-filters .form-group {
        min-width: 100%;
    }
    
    .modal-image-viewer {
        max-width: 95vw;
    }
}

/* Botón ver facturas */
.btn-view-facturas {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: visible;
    z-index: 10;
}

.btn-view-facturas:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 1) 0%, rgba(124, 58, 237, 1) 100%);
}

.btn-view-facturas:active {
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-view-facturas i {
    font-size: 16px;
}

/* Filtros de facturas */
.facturas-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.facturas-filters .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.facturas-filters label {
    font-size: 12px;
    margin-bottom: 5px;
}

.facturas-filters select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
}

/* Grid de facturas */
.facturas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Tarjeta de factura */
.factura-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

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

.factura-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
}

.factura-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.factura-title i {
    color: var(--primary-color);
}

.factura-estado {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: capitalize;
}

.estado-pendiente {
    background-color: rgba(251, 146, 60, 0.1);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.estado-procesado {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.estado-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.factura-body {
    padding: 16px;
    flex: 1;
}

.factura-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.factura-info-row:last-child {
    margin-bottom: 0;
}

.factura-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.factura-info-item strong {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.factura-info-item strong i {
    font-size: 11px;
}

.factura-info-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.factura-monto {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

.factura-error {
    margin-top: 12px;
    padding: 12px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius-sm);
    color: #ef4444;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.factura-error strong {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.factura-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 1) 0%, rgba(220, 38, 38, 1) 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive para facturas */
@media (max-width: 768px) {
    .facturas-grid {
        grid-template-columns: 1fr;
    }
    
    .factura-info-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .facturas-filters {
        flex-direction: column;
    }
    
    .facturas-filters .form-group {
        min-width: 100%;
    }
}

/* Botón agregar usuario */
.btn-add-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-add-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-add-user:hover::before {
    left: 100%;
}

.btn-add-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-add-user i {
    font-size: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.user-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.btn-logout {
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

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

.btn-logout i {
    font-size: 14px;
}

/* Contenedor principal */
.dashboard-main {
    padding: 0 20px 20px;
}

.entries-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Entrada estándar */
.entry-row {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.entry-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.entry-row:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

.entry-telefono {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.entry-telefono i {
    font-size: 12px;
    color: var(--primary-color);
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-name {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    white-space: pre;
    display: inline-flex;
    align-items: center;
}

.new-messages-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background: var(--danger-gradient);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6);
    }
}

.entry-group {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    white-space: pre;
}

.entry-controls {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: nowrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    position: relative;
}

.control-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-style: italic;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.control-date i {
    font-size: 11px;
    color: var(--primary-color);
}

.control-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: calc(100% - 5%);
    margin-right: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    flex-direction: column;
}

.control-arrows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    right: -0px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
}

.arrow-btn {
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 10px;
    font-size: 14px;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.arrow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.3s;
}

.arrow-btn:hover::before {
    left: 100%;
}

.arrow-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.arrow-btn:active {
    transform: translateY(0) scale(0.95);
}

.entry-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-btn {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1) 0%, rgba(229, 62, 62, 0.1) 100%);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: var(--danger-color);
    cursor: pointer;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.2);
    position: relative;
    overflow: hidden;
}

.delete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 101, 101, 0.1), transparent);
    transition: left 0.3s;
}

.delete-btn:hover::before {
    left: 100%;
}

.delete-btn:hover {
    background: var(--danger-gradient);
    color: white;
    border-color: var(--danger-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.3);
}

.delete-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Entrada expandida */
.entry-expanded {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.entry-expanded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.entry-expanded:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(102, 126, 234, 0.3);
}

.expanded-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

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

.expanded-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.expanded-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.messages-section {
    background: linear-gradient(135deg, rgba(22, 33, 62, 0.6) 0%, rgba(26, 26, 46, 0.6) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(170, 173, 174, 0.808);
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    border-radius: var(--border-radius-sm);
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    max-height: 40em;
}

.messages-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    pointer-events: none;
}

.messages-title {
    font-size: 18px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.messages-contentt {
    /* max-height: none; */
    overflow-y: auto;
    flex: 1;
    /* display: flex; */
    padding: 20px;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-top: 16px;
    /* display: flex; */
    flex-direction: column;
    gap: 16px;
}

/* Sección de acciones recomendadas */
.acciones-section {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(170, 173, 174, 0.808);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    min-height: 120px;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.acciones-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    pointer-events: none;
}

.acciones-title {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.acciones-title i {
    color: #f59e0b;
    -webkit-text-fill-color: #f59e0b;
}

.acciones-content {
    overflow-y: auto;
    flex: 1;
    padding: 12px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-top: 8px;
    flex-direction: column;
    gap: 10px;
    display: flex;
}

.accion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    transition: var(--transition);
}

.accion-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.accion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.accion-situacion {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accion-fecha {
    font-size: 10px;
    color: var(--text-muted);
}

.accion-content {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 12px;
}

.acciones-loading,
.no-acciones,
.error-acciones {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 12px;
    font-size: 12px;
}

.expanded-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.expanded-controls .control-group {
    align-items: flex-start;
}

.expanded-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;

    width: calc(100% - 5%);
    margin-right: 20px;
}

/* Estilos mejorados para tema claro con paleta pastel */
[data-theme="light"] .entry-name {
    color: #722F37;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Header con mismo color que las entries en tema claro */
[data-theme="light"] .dashboard-header {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.1) 0%, rgba(30, 41, 59, 0.08) 100%);
    border: 1px solid rgba(75, 85, 99, 0.2);
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.1);
}

[data-theme="light"] .dashboard-header::before {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.05) 0%, transparent 100%);
}

/* Barra de búsqueda con colores acordes en tema claro */
[data-theme="light"] .search-container {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.1) 0%, rgba(30, 41, 59, 0.08) 100%) !important;
    border: 1px solid rgba(75, 85, 99, 0.2) !important;
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.1) !important;
}

[data-theme="light"] #searchInput {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.05) 0%, rgba(30, 41, 59, 0.03) 100%) !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
    color: #722F37 !important;
    box-shadow: 0 2px 8px rgba(75, 85, 99, 0.1) !important;
}

[data-theme="light"] #searchInput:focus {
    border-color: rgba(75, 85, 99, 0.5) !important;
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.2) !important;
    outline: none !important;
}

[data-theme="light"] #searchInput::placeholder {
    color: rgba(75, 85, 99, 0.6) !important;
}

/* Fondo gris con azul oscuro para entries en tema claro */
[data-theme="light"] .entry-row {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.1) 0%, rgba(30, 41, 59, 0.08) 100%);
    border: 1px solid rgba(75, 85, 99, 0.2);
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.1);
}

[data-theme="light"] .entry-row:hover {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.15) 0%, rgba(30, 41, 59, 0.12) 100%);
    border-color: rgba(75, 85, 99, 0.3);
    box-shadow: 0 8px 25px rgba(75, 85, 99, 0.2);
}

[data-theme="light"] .entry-expanded {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.1) 0%, rgba(30, 41, 59, 0.08) 100%);
    border: 1px solid rgba(75, 85, 99, 0.2);
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.1);
}

[data-theme="light"] .entry-expanded:hover {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.15) 0%, rgba(30, 41, 59, 0.12) 100%);
    border-color: rgba(75, 85, 99, 0.3);
    box-shadow: 0 8px 25px rgba(75, 85, 99, 0.2);
}

/* Barras de progreso con tonos gris-azul oscuro */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(75, 85, 99, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4b5563 0%, #1e293b 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(75, 85, 99, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.control-number {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
    display: block;
}

/* Estilos para tema claro */
[data-theme="light"] .control-number {
    color: #722F37;
}

/* Estilos para tema oscuro */
[data-theme="dark"] .control-number {
    color: #ffffff;
}

[data-theme="light"] .control-value {
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.9) 0%, rgba(245, 235, 250, 0.9) 100%);
    border: 1px solid rgba(200, 180, 200, 0.6);
    color: #722F37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
} 

[data-theme="light"] .arrow-btn {
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.9) 0%, rgba(245, 235, 250, 0.9) 100%);
    border: 1px solid rgba(200, 180, 200, 0.6);
    color: #722F37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .arrow-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: rgba(75, 85, 99, 0.5);
    box-shadow: 0 6px 20px rgba(75, 85, 99, 0.25);
}

[data-theme="light"] .delete-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .delete-btn:hover {
    background: var(--danger-gradient);
    color: white;
    border-color: var(--danger-color);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        margin: 10px;
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 24px;
    }
    
    .entry-row {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .entry-controls {
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .control-group {
        min-width: 120px;
        flex: 1;
    }
    
    .control-arrows {
        position: static;
        opacity: 1;
        transform: none;
        flex-direction: row;
        justify-content: center;
        margin-top: 8px;
    }
    
    .expanded-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .entry-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 0 10px 10px;
    }
    
    .entry-controls {
        gap: 10px;
    }
    
    .control-group {
        min-width: 80px;
    }
}


.arrow-btn {
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 10px;
    font-size: 14px;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.arrow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.3s;
}

.arrow-btn:hover::before {
    left: 100%;
}

.arrow-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.arrow-btn:active {
    transform: translateY(0) scale(0.95);
}

.arrow-up {
    margin-bottom: 2px;
}

.arrow-down {
    margin-top: 2px;
}

/* Botón agregar pago en galería */
.gallery-image-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-add-pago {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-pago:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-add-pago i {
    font-size: 14px;
}

/* Modal de documentos del cliente */
.documentos-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.documentos-tab-content {
    display: none;
}

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

.documentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.documento-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

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

.documento-preview {
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.documento-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.documento-placeholder {
    font-size: 48px;
    color: var(--text-muted);
    opacity: 0.5;
}

.documento-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.documento-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.documento-detail {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.documento-detail i {
    font-size: 12px;
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 8px;
}

/* Responsive para documentos */
@media (max-width: 768px) {
    .documentos-grid {
        grid-template-columns: 1fr;
    }
    
    .documentos-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
}
