/* ==================== INLINE OWNER ASSIGNMENT (Multi-Select) ==================== */

.owners-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    position: relative;
}

.owner-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.owner-tag i {
    font-size: 0.7rem;
}

.remove-owner-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 0.125rem;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 0.7rem;
}

.remove-owner-btn:hover {
    opacity: 1;
}

.no-owner {
    color: var(--text-light);
    font-size: 0.75rem;
    font-style: italic;
}

.add-owner-dropdown {
    position: relative;
    display: inline-block;
}

.add-owner-btn {
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.add-owner-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.add-owner-btn i {
    font-size: 0.7rem;
}

.owner-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999; /* ✅ Aumentado para estar sobre todo */
    min-width: 280px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08); /* ✅ Sombra más fuerte */
    margin-top: 0.5rem;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out; /* ✅ Animación suave */
}

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

/* Dropdown Header with Search */
.dropdown-header {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.manager-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.manager-search:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dropdown Options */
.dropdown-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
}

.owner-checkbox-option {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    gap: 0.5rem;
}

.owner-checkbox-option:hover {
    background: #f1f5f9;
}

.owner-checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    transition: transform 0.2s;
}

.owner-checkbox-option input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    flex: 1;
}

.checkbox-label i {
    font-size: 0.75rem;
    color: #94a3b8;
}

.badge-assigned {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    background: #10b981;
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Dropdown Footer with Update Button */
.dropdown-footer {
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.btn-update-owners {
    width: 100%;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-update-owners:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-update-owners:active:not(:disabled) {
    transform: translateY(0);
}

.btn-update-owners:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-update-owners.loading {
    background: #94a3b8;
}

.btn-update-owners.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-update-owners.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-update-owners i.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Scrollbar styling */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .owners-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .owner-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 260px;
    }
}
